forked from NativeScript/ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_npm_ios.sh
executable file
·36 lines (28 loc) · 1.05 KB
/
build_npm_ios.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
source "$(dirname "$0")/build_utils.sh"
checkpoint "Preparing npm package for iOS..."
OUTPUT_DIR="dist/npm"
rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR/framework"
cp ./package.json "$OUTPUT_DIR"
cp -r "project-template-ios/." "$OUTPUT_DIR/framework"
cp -r "dist/NativeScript.xcframework" "$OUTPUT_DIR/framework/internal"
cp -r "dist/TKLiveSync.xcframework" "$OUTPUT_DIR/framework/internal"
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
cp -r "metadata-generator/dist/x86_64/." "$OUTPUT_DIR/framework/internal/metadata-generator-x86_64"
mkdir -p "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
cp -r "metadata-generator/dist/arm64/." "$OUTPUT_DIR/framework/internal/metadata-generator-arm64"
# Add xcframeworks to .zip (NPM modules do not support symlinks, unzipping is done by {N} CLI)
(
set -e
cd $OUTPUT_DIR/framework/internal
zip -qr --symlinks XCFrameworks.zip *.xcframework
rm -rf *.xcframework
)
pushd "$OUTPUT_DIR"
npm pack
mv *.tgz ../
popd
checkpoint "npm package created."