Skip to content

Commit 732c439

Browse files
authored
feat: swift package release workflow (#395)
1 parent 6778dfd commit 732c439

12 files changed

Lines changed: 595 additions & 110 deletions

File tree

.github/workflows/npm_release.yml

Lines changed: 292 additions & 68 deletions
Large diffs are not rendered by default.

build_all_ios.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ rm -rf ./dist
77
./build_nativescript.sh --no-vision
88
./build_tklivesync.sh --no-vision
99
./prepare_dSYMs.sh
10+
./build_spm_artifacts.sh ios
1011
./build_npm_ios.sh

build_all_vision.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ rm -rf ./dist
77
./build_nativescript.sh --no-catalyst --no-iphone --no-sim
88
./build_tklivesync.sh --no-catalyst --no-iphone --no-sim
99
./prepare_dSYMs.sh
10+
./build_spm_artifacts.sh visionos
1011
./build_npm_vision.sh

build_npm_ios.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ cp ./package.json "$OUTPUT_DIR"
1111

1212
cp -r "./project-template-ios/" "$OUTPUT_DIR/framework"
1313

14-
cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal"
15-
cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal"
16-
14+
# The NativeScript / TKLiveSync xcframeworks are NO LONGER bundled in npm. They
15+
# are published as GitHub Release artifacts and consumed via SwiftPM
16+
# (github.com/NativeScript/ios-spm). Stamp the runtime version into the packaged
17+
# template's SwiftPM reference so it resolves the matching release.
18+
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
19+
node ./scripts/stamp-template-version.mjs \
20+
"$OUTPUT_DIR/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj" \
21+
"$NPM_VERSION"
22+
23+
# Build-time metadata generator is still shipped in npm (Phase 1). See the
24+
# distribution plan for moving this to an on-demand artifact (Phase 2).
1725
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
1826
cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
1927

2028
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
2129
cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
2230

23-
# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI)
24-
(
25-
set -e
26-
cd $OUTPUT_DIR/framework/internal
27-
zip -qr --symlinks XCFrameworks.zip *.xcframework
28-
rm -rf *.xcframework
29-
)
30-
3131
pushd "$OUTPUT_DIR"
3232
npm pack
3333
mv *.tgz ../
3434
popd
3535

36-
checkpoint "npm package created."
36+
checkpoint "npm package created."

build_npm_vision.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ cp ./package.json "$OUTPUT_DIR"
1111

1212
cp -r "./project-template-vision/" "$OUTPUT_DIR/framework"
1313

14-
cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal"
15-
cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal"
16-
14+
# The NativeScript / TKLiveSync xcframeworks are NO LONGER bundled in npm. They
15+
# are published as GitHub Release artifacts and consumed via SwiftPM
16+
# (github.com/NativeScript/ios-spm). Stamp the runtime version into the packaged
17+
# template's SwiftPM reference so it resolves the matching release.
18+
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
19+
node ./scripts/stamp-template-version.mjs \
20+
"$OUTPUT_DIR/framework/__PROJECT_NAME__.xcodeproj/project.pbxproj" \
21+
"$NPM_VERSION"
22+
23+
# Build-time metadata generator is still shipped in npm (Phase 1). See the
24+
# distribution plan for moving this to an on-demand artifact (Phase 2).
1725
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
1826
cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
1927

2028
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
2129
cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
2230

23-
# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI)
24-
(
25-
set -e
26-
cd $OUTPUT_DIR/framework/internal
27-
zip -qr --symlinks XCFrameworks.zip *.xcframework
28-
rm -rf *.xcframework
29-
)
30-
3131
pushd "$OUTPUT_DIR"
3232
npm pack
3333
mv *.tgz ../
3434
popd
3535

36-
checkpoint "npm package created."
36+
checkpoint "npm package created."

build_spm_artifacts.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
# Package the built xcframeworks as SwiftPM binary-target artifacts:
3+
# * a .zip per xcframework (framework at the zip root, symlinks preserved)
4+
# * a SHA-256 checksum for each (the value SwiftPM's binaryTarget(checksum:) expects)
5+
#
6+
# Output goes to dist/artifacts/:
7+
# <name>.zip and a combined checksums.env (KEY=sha256 lines)
8+
#
9+
# Usage: ./build_spm_artifacts.sh [ios|visionos] (default: ios)
10+
#
11+
# These artifacts are uploaded to the GitHub Release and referenced by
12+
# github.com/NativeScript/ios-spm (see scripts/stamp-spm-release.mjs).
13+
set -e
14+
source "$(dirname "$0")/build_utils.sh"
15+
16+
TARGET="${1:-ios}"
17+
DIST="$(pwd)/dist"
18+
OUT="$DIST/artifacts"
19+
20+
case "$TARGET" in
21+
ios)
22+
NS_ZIP="NativeScript.xcframework.zip"
23+
TK_ZIP="TKLiveSync.xcframework.zip"
24+
NS_KEY="NS_CHECKSUM_NATIVESCRIPT_IOS"
25+
TK_KEY="NS_CHECKSUM_TKLIVESYNC_IOS"
26+
;;
27+
visionos|vision|xr)
28+
TARGET="visionos"
29+
NS_ZIP="NativeScript.visionos.xcframework.zip"
30+
TK_ZIP="TKLiveSync.visionos.xcframework.zip"
31+
NS_KEY="NS_CHECKSUM_NATIVESCRIPT_VISIONOS"
32+
TK_KEY="NS_CHECKSUM_TKLIVESYNC_VISIONOS"
33+
;;
34+
*)
35+
echo "Unknown target '$TARGET' (expected ios or visionos)" >&2
36+
exit 1
37+
;;
38+
esac
39+
40+
checkpoint "Packaging SwiftPM artifacts for $TARGET..."
41+
rm -rf "$OUT"
42+
mkdir -p "$OUT"
43+
44+
# SwiftPM's binaryTarget(checksum:) is the SHA-256 of the zip. `swift package
45+
# compute-checksum` is the canonical producer; shasum -a 256 yields the same
46+
# value and is the portable fallback.
47+
compute_checksum() {
48+
local zip="$1"
49+
if command -v swift >/dev/null 2>&1 && swift package compute-checksum "$zip" >/dev/null 2>&1; then
50+
swift package compute-checksum "$zip"
51+
else
52+
shasum -a 256 "$zip" | awk '{print $1}'
53+
fi
54+
}
55+
56+
# zip_xcframework <SourceXcframeworkDir> <OutputZipName>
57+
zip_xcframework() {
58+
local src="$1" zipname="$2"
59+
if [ ! -d "$DIST/$src" ]; then
60+
echo "Missing $DIST/$src — run the runtime build first." >&2
61+
exit 1
62+
fi
63+
( cd "$DIST" && zip -qr --symlinks "$OUT/$zipname" "$src" )
64+
}
65+
66+
zip_xcframework "NativeScript.xcframework" "$NS_ZIP"
67+
zip_xcframework "TKLiveSync.xcframework" "$TK_ZIP"
68+
69+
NS_SUM="$(compute_checksum "$OUT/$NS_ZIP")"
70+
TK_SUM="$(compute_checksum "$OUT/$TK_ZIP")"
71+
72+
# Per-target filename so the iOS and visionOS env files don't collide when the
73+
# release/stamp jobs merge both platforms' artifacts into one directory.
74+
CHECKSUMS="$OUT/checksums-$TARGET.env"
75+
{
76+
echo "${NS_KEY}=${NS_SUM}"
77+
echo "${TK_KEY}=${TK_SUM}"
78+
} > "$CHECKSUMS"
79+
80+
checkpoint "SwiftPM artifacts ready in $OUT:"
81+
( cd "$OUT" && ls -lh *.zip )
82+
echo "Checksums ($CHECKSUMS):"
83+
cat "$CHECKSUMS"

project-template-ios/__PROJECT_NAME__.xcodeproj/project.pbxproj

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
11-
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
10+
AA10000000000000000000C1 /* NativeScript in Frameworks */ = {isa = PBXBuildFile; productRef = AA10000000000000000000B1 /* NativeScript */; };
1211
858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 858B833A18CA111C00AB12DE /* InfoPlist.strings */; };
1312
AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */; };
1413
CD45EE7C18DC2D5800FB50C0 /* app in Resources */ = {isa = PBXBuildFile; fileRef = CD45EE7A18DC2D5800FB50C0 /* app */; };
@@ -22,8 +21,6 @@
2221
dstPath = "";
2322
dstSubfolderSpec = 10;
2423
files = (
25-
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */,
26-
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */,
2724
);
2825
name = "Embed Frameworks";
2926
runOnlyForDeploymentPostprocessing = 0;
@@ -35,8 +32,6 @@
3532
391174B721F1D99900BA2583 /* plugins-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-release.xcconfig"; sourceTree = SOURCE_ROOT; };
3633
391174B821F1D99900BA2583 /* plugins-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
3734
39940D8122C4E84C0050DDE1 /* __PROJECT_NAME__.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = __PROJECT_NAME__.entitlements; sourceTree = "<group>"; };
38-
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = NativeScript.xcframework; path = internal/NativeScript.xcframework; sourceTree = "<group>"; };
39-
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TKLiveSync.xcframework; path = internal/TKLiveSync.xcframework; sourceTree = "<group>"; };
4035
42C751E2232B769100186695 /* nativescript-pre-link */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-pre-link"; path = "internal/nativescript-pre-link"; sourceTree = SOURCE_ROOT; };
4136
42C751E3232B769100186695 /* strip-dynamic-framework-architectures.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "strip-dynamic-framework-architectures.sh"; path = "internal/strip-dynamic-framework-architectures.sh"; sourceTree = SOURCE_ROOT; };
4237
42C751E4232B769100186695 /* nsld.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = nsld.sh; path = internal/nsld.sh; sourceTree = SOURCE_ROOT; };
@@ -63,6 +58,7 @@
6358
isa = PBXFrameworksBuildPhase;
6459
buildActionMask = 2147483647;
6560
files = (
61+
AA10000000000000000000C1 /* NativeScript in Frameworks */,
6662
);
6763
runOnlyForDeploymentPostprocessing = 0;
6864
};
@@ -115,8 +111,6 @@
115111
858B833018CA111C00AB12DE /* Frameworks */ = {
116112
isa = PBXGroup;
117113
children = (
118-
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */,
119-
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */,
120114
);
121115
name = Frameworks;
122116
sourceTree = "<group>";
@@ -176,6 +170,9 @@
176170
dependencies = (
177171
);
178172
name = __PROJECT_NAME__;
173+
packageProductDependencies = (
174+
AA10000000000000000000B1 /* NativeScript */,
175+
);
179176
productName = JDBridgeApp;
180177
productReference = 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */;
181178
productType = "com.apple.product-type.application";
@@ -206,6 +203,9 @@
206203
Base,
207204
);
208205
mainGroup = 858B832518CA111C00AB12DE;
206+
packageReferences = (
207+
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */,
208+
);
209209
productRefGroup = 858B832F18CA111C00AB12DE /* Products */;
210210
projectDirPath = "";
211211
projectRoot = "";
@@ -498,6 +498,25 @@
498498
defaultConfigurationName = Release;
499499
};
500500
/* End XCConfigurationList section */
501+
502+
/* Begin XCRemoteSwiftPackageReference section */
503+
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */ = {
504+
isa = XCRemoteSwiftPackageReference;
505+
repositoryURL = "https://github.com/NativeScript/ios-spm.git";
506+
requirement = {
507+
kind = exactVersion;
508+
version = "__NS_RUNTIME_VERSION__";
509+
};
510+
};
511+
/* End XCRemoteSwiftPackageReference section */
512+
513+
/* Begin XCSwiftPackageProductDependency section */
514+
AA10000000000000000000B1 /* NativeScript */ = {
515+
isa = XCSwiftPackageProductDependency;
516+
package = AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */;
517+
productName = NativeScript;
518+
};
519+
/* End XCSwiftPackageProductDependency section */
501520
};
502521
rootObject = 858B832618CA111C00AB12DE /* Project object */;
503522
}

project-template-ios/internal/nativescript-build.xcconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// * NativeScript build related flags
22
// * Add [sdk=*] after each one to avoid conflict with CocoaPods flags
3-
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -framework NativeScript -framework TKLiveSync -F"$(SRCROOT)/internal" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
3+
// * NativeScript + TKLiveSync are provided by the SwiftPM "NativeScript" product
4+
// * (github.com/NativeScript/ios-spm), so SwiftPM links/embeds them automatically.
5+
// * The explicit -framework NativeScript / -framework TKLiveSync / -F internal are
6+
// * intentionally omitted. SwiftPM stages the resolved framework slice into
7+
// * CONFIGURATION_BUILD_DIR (below), which is where the metadata generator finds it.
8+
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
49

510
// We need to add CONFIGURATION_BUILD_DIR here so that we can explicitly quote-escape any paths in it, because the implicitly added path by Xcode is not always escaped
611
FRAMEWORK_SEARCH_PATHS[sdk=*] = $(inherited) "$(SRCROOT)/internal/" "$(CONFIGURATION_BUILD_DIR)"

project-template-vision/__PROJECT_NAME__.xcodeproj/project.pbxproj

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
11-
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
10+
AA10000000000000000000C1 /* NativeScriptVisionOS in Frameworks */ = {isa = PBXBuildFile; productRef = AA10000000000000000000B1 /* NativeScriptVisionOS */; };
1211
858B842D18CA22B800AB12DE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 858B833A18CA111C00AB12DE /* InfoPlist.strings */; };
1312
AAA0AADB2A54B96B00EE55A4 /* NativeScriptStart.m in Sources */ = {isa = PBXBuildFile; fileRef = AAA0AADA2A54B96B00EE55A4 /* NativeScriptStart.m */; };
1413
CD45EE7C18DC2D5800FB50C0 /* app in Resources */ = {isa = PBXBuildFile; fileRef = CD45EE7A18DC2D5800FB50C0 /* app */; };
@@ -21,8 +20,6 @@
2120
dstPath = "";
2221
dstSubfolderSpec = 10;
2322
files = (
24-
39940D9122C4EF600050DDE1 /* NativeScript.xcframework in Embed Frameworks */,
25-
39940E1C22C5DFFF0050DDE1 /* TKLiveSync.xcframework in Embed Frameworks */,
2623
);
2724
name = "Embed Frameworks";
2825
runOnlyForDeploymentPostprocessing = 0;
@@ -34,8 +31,6 @@
3431
391174B721F1D99900BA2583 /* plugins-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-release.xcconfig"; sourceTree = SOURCE_ROOT; };
3532
391174B821F1D99900BA2583 /* plugins-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "plugins-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
3633
39940D8122C4E84C0050DDE1 /* __PROJECT_NAME__.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = __PROJECT_NAME__.entitlements; sourceTree = "<group>"; };
37-
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = NativeScript.xcframework; path = internal/NativeScript.xcframework; sourceTree = "<group>"; };
38-
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TKLiveSync.xcframework; path = internal/TKLiveSync.xcframework; sourceTree = "<group>"; };
3934
42C751E2232B769100186695 /* nativescript-pre-link */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "nativescript-pre-link"; path = "internal/nativescript-pre-link"; sourceTree = SOURCE_ROOT; };
4035
42C751E3232B769100186695 /* strip-dynamic-framework-architectures.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "strip-dynamic-framework-architectures.sh"; path = "internal/strip-dynamic-framework-architectures.sh"; sourceTree = SOURCE_ROOT; };
4136
42C751E4232B769100186695 /* nsld.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = nsld.sh; path = internal/nsld.sh; sourceTree = SOURCE_ROOT; };
@@ -61,6 +56,7 @@
6156
isa = PBXFrameworksBuildPhase;
6257
buildActionMask = 2147483647;
6358
files = (
59+
AA10000000000000000000C1 /* NativeScriptVisionOS in Frameworks */,
6460
);
6561
runOnlyForDeploymentPostprocessing = 0;
6662
};
@@ -112,8 +108,6 @@
112108
858B833018CA111C00AB12DE /* Frameworks */ = {
113109
isa = PBXGroup;
114110
children = (
115-
39940E1B22C5DFFF0050DDE1 /* TKLiveSync.xcframework */,
116-
39940D8C22C4EAAA0050DDE1 /* NativeScript.xcframework */,
117111
);
118112
name = Frameworks;
119113
sourceTree = "<group>";
@@ -173,6 +167,9 @@
173167
dependencies = (
174168
);
175169
name = __PROJECT_NAME__;
170+
packageProductDependencies = (
171+
AA10000000000000000000B1 /* NativeScriptVisionOS */,
172+
);
176173
productName = JDBridgeApp;
177174
productReference = 858B843318CA22B800AB12DE /* __PROJECT_NAME__.app */;
178175
productType = "com.apple.product-type.application";
@@ -203,6 +200,9 @@
203200
Base,
204201
);
205202
mainGroup = 858B832518CA111C00AB12DE;
203+
packageReferences = (
204+
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */,
205+
);
206206
productRefGroup = 858B832F18CA111C00AB12DE /* Products */;
207207
projectDirPath = "";
208208
projectRoot = "";
@@ -504,6 +504,25 @@
504504
defaultConfigurationName = Release;
505505
};
506506
/* End XCConfigurationList section */
507+
508+
/* Begin XCRemoteSwiftPackageReference section */
509+
AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */ = {
510+
isa = XCRemoteSwiftPackageReference;
511+
repositoryURL = "https://github.com/NativeScript/ios-spm.git";
512+
requirement = {
513+
kind = exactVersion;
514+
version = "__NS_RUNTIME_VERSION__";
515+
};
516+
};
517+
/* End XCRemoteSwiftPackageReference section */
518+
519+
/* Begin XCSwiftPackageProductDependency section */
520+
AA10000000000000000000B1 /* NativeScriptVisionOS */ = {
521+
isa = XCSwiftPackageProductDependency;
522+
package = AA10000000000000000000A1 /* XCRemoteSwiftPackageReference "ios-spm" */;
523+
productName = NativeScriptVisionOS;
524+
};
525+
/* End XCSwiftPackageProductDependency section */
507526
};
508527
rootObject = 858B832618CA111C00AB12DE /* Project object */;
509528
}

project-template-vision/internal/nativescript-build.xcconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// * NativeScript build related flags
22
// * Add [sdk=*] after each one to avoid conflict with CocoaPods flags
3-
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -framework NativeScript -framework TKLiveSync -F"$(SRCROOT)/internal" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
3+
// * NativeScript + TKLiveSync are provided by the SwiftPM "NativeScriptVisionOS" product
4+
// * (github.com/NativeScript/ios-spm); SwiftPM links/embeds them automatically. The
5+
// * explicit -framework NativeScript / -framework TKLiveSync / -F internal are omitted.
6+
OTHER_LDFLAGS[sdk=*] = $(inherited) -ObjC -sectcreate __DATA __TNSMetadata "$(CONFIGURATION_BUILD_DIR)/metadata-$(CURRENT_ARCH).bin" -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreServices -framework Security
47

58
// We need to add CONFIGURATION_BUILD_DIR here so that we can explicitly quote-escape any paths in it, because the implicitly added path by Xcode is not always escaped
69
FRAMEWORK_SEARCH_PATHS[sdk=*] = $(inherited) "$(SRCROOT)/internal/" "$(CONFIGURATION_BUILD_DIR)"

0 commit comments

Comments
 (0)