fix(templates): replace deprecated method in Package.swift
Some checks are pending
CI / checks (push) Waiting to run
CI / sanitize (push) Waiting to run
CI / build (push) Waiting to run
CI / check-wasm-stdlib (push) Waiting to run

This commit is contained in:
ObserverOfTime 2026-07-07 18:36:52 +03:00 committed by Will Lillis
parent 805a7cd0ae
commit 08fcb7f2ef
2 changed files with 11 additions and 4 deletions

View file

@ -836,6 +836,8 @@ fn generate_java_bindings(
Ok(())
}
// TODO: remove old migrations
fn update_package_json(path: &Path) -> Result<()> {
let mut contents = fs::read_to_string(path)?
.replace(
@ -1249,8 +1251,13 @@ fn update_swift_package(path: &Path) -> Result<()> {
"atPath: \"src/scanner.c\"",
"atPath: \"\\(dir)/src/scanner.c\"",
)
.replace("version: \"0.8.0\")", "version: \"0.9.0\")")
.replace("(url:", "(name: \"SwiftTreeSitter\", url:");
.replace("version: \"0.8.0\")", "version: \"0.10.0\")")
.replace("version: \"0.9.0\")", "version: \"0.10.0\")")
.replace("(name: \"SwiftTreeSitter\", url:", "(url:")
.replace(
" \"SwiftTreeSitter\"",
" .product(name: \"SwiftTreeSitter\", package: \"swift-tree-sitter\")",
);
if !replaced_contents.eq(&contents) {
info!("Updating Package.swift");
write_file(path, replaced_contents)?;

View file

@ -15,7 +15,7 @@ let package = Package(
.library(name: "PARSER_CLASS_NAME", targets: ["PARSER_CLASS_NAME"]),
],
dependencies: [
.package(name: "SwiftTreeSitter", url: "https://github.com/tree-sitter/swift-tree-sitter", from: "0.9.0"),
.package(url: "https://github.com/tree-sitter/swift-tree-sitter", from: "0.10.0"),
],
targets: [
.target(
@ -32,7 +32,7 @@ let package = Package(
.testTarget(
name: "PARSER_CLASS_NAMETests",
dependencies: [
"SwiftTreeSitter",
.product(name: "SwiftTreeSitter", package: "swift-tree-sitter"),
"PARSER_CLASS_NAME",
],
path: "bindings/swift/PARSER_CLASS_NAMETests"