Skip to content

Commit 46aaa61

Browse files
committed
build macOS as a normal xcframework rather than using build_xcframework.mts
1 parent a0ed205 commit 46aaa61

File tree

18 files changed

+1506
-13
lines changed

18 files changed

+1506
-13
lines changed

build_nativescript.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,14 @@ if $BUILD_MACOS; then
179179
-debug-symbols "$DIST/intermediates/macos/$CONFIG_BUILD/NativeScript.framework.dSYM" )
180180

181181
if [[ "$TARGET_ENGINE" == "none" ]]; then
182-
checkpoint "Creating the XCFramework for macOS (NativeScript.apple.node)"
182+
checkpoint "Creating the XCFramework for macOS (NativeScript.xcframework)"
183183

184-
# We adhere to the prebuilds standard as described here:
185-
# https://github.com/callstackincubator/react-native-node-api/blob/9b231c14459b62d7df33360f930a00343d8c46e6/docs/PREBUILDS.md
186-
OUTPUT_DIR="packages/macos/build/$CONFIG_BUILD/NativeScript.apple.node"
184+
# We were unable to get the approach used for iOS to work, so instead use
185+
# this alternative:
186+
# https://github.com/callstackincubator/react-native-node-api/discussions/262#discussion-9012292
187+
OUTPUT_DIR="packages/macos/build/$CONFIG_BUILD/NativeScript.xcframework"
187188
rm -rf $OUTPUT_DIR
188-
deno run -A ./scripts/build_xcframework.mts --output "$OUTPUT_DIR" ${XCFRAMEWORKS[@]}
189+
xcodebuild -create-xcframework ${XCFRAMEWORKS[@]} -output "$OUTPUT_DIR"
189190
else
190191
checkpoint "Creating NativeScript.node for macOS"
191192
cp -r "$DIST/intermediates/macos/$CONFIG_BUILD/libNativeScript.dylib" "$DIST/NativeScript.node"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "NativeScript"
7+
s.version = package['version']
8+
s.summary = "An embeddable, engine-agnostic NativeScript runtime for iOS based on Node-API"
9+
s.homepage = "https://github.com/NativeScript/runtime-node-api.git"
10+
s.author = "DjDeveloperr", "Jamie Birch"
11+
s.source = { git: '' }
12+
s.vendored_frameworks = "build/RelWithDebInfo/NativeScript.xcframework"
13+
14+
s.platform = :macos, '11.0'
15+
end

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/react-native-node-api-module

Whitespace-only changes.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/Info.plist renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<dict>
88
<key>BinaryPath</key>
99
<string>NativeScript.framework/Versions/0.1.0/NativeScript</string>
10+
<key>DebugSymbolsPath</key>
11+
<string>dSYMs</string>
1012
<key>LibraryIdentifier</key>
1113
<string>macos-arm64_x86_64</string>
1214
<key>LibraryPath</key>

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/Headers renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/Headers

File renamed without changes.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/NativeScript renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/NativeScript

File renamed without changes.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/Resources renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/Resources

File renamed without changes.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/Headers/NativeScript.h renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/Headers/NativeScript.h

File renamed without changes.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/NativeScript renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/NativeScript

14.4 MB
Binary file not shown.

packages/macos/build/RelWithDebInfo/NativeScript.apple.node/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/Resources/Info.plist renamed to packages/macos/build/RelWithDebInfo/NativeScript.xcframework/macos-arm64_x86_64/NativeScript.framework/Versions/0.1.0/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>BuildMachineOSBuild</key>
6-
<string>25A354</string>
6+
<string>25B5062e</string>
77
<key>CFBundleDevelopmentRegion</key>
88
<string>English</string>
99
<key>CFBundleExecutable</key>

0 commit comments

Comments
 (0)