feat(ios): Embed XCFrameworks to zip

NPM doesn't support symlinks and as a workaround we're
embedding all XCFrameworks in a zip archive and extracting
them with a postinstall script
This commit is contained in:
Martin Bektchiev
2019-07-01 18:48:16 +03:00
parent 4add7da40c
commit f3643c2a6d
2 changed files with 9 additions and 5 deletions

View File

@@ -14,9 +14,12 @@ echo "Build iOS"
cd ios
./build.sh
cd ..
echo "Copy ios/TNSWidgets/build/*.framework dist/package/platforms/ios"
cp -R ios/TNSWidgets/build/TNSWidgets.xcframework dist/package/platforms/ios
echo "Zip ios/TNSWidgets/build/*.xcframework to dist/package/platforms/ios"
(
XCFRAMEWORKS_ZIPFILENAME="$PWD/dist/package/platforms/ios/XCFrameworks.zip"
cd ios/TNSWidgets/build
zip -q -r --symlinks $XCFRAMEWORKS_ZIPFILENAME *.xcframework
)
cp ios/TNSWidgets/build/*.framework.dSYM.zip dist/package/platforms/ios
@@ -38,4 +41,4 @@ else
cd ../..
mv dist/package/$PACKAGE dist/$PACKAGE
echo "Output: dist/$PACKAGE"
fi
fi

View File

@@ -3,7 +3,8 @@
"version": "6.1.0",
"description": "Native widgets used in the NativeScript framework.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "(set -e; cd platforms/ios; unzip -q XCFrameworks.zip; rm XCFrameworks.zip)"
},
"repository": {
"type": "git",