Skip to content

Commit d61dbd4

Browse files
committed
build: Strip local and debugging entries from the symbol table
This reduces the binary size significantly. Starting from the next official version we will distribute them as separate `dSYM` packages. They will be attached as binaries to the release in GitHub.
1 parent 2a15777 commit d61dbd4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

build/scripts/build-nativescript-framework.sh

+9
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,19 @@ checkpoint "Packaging NativeScript.framework"
2121
mkdir -p "$DIST_DIR" && pushd "$_"
2222
cp -r "$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphoneos/NativeScript.framework" "."
2323
rm "NativeScript.framework/NativeScript"
24+
25+
# Strip debug information, dSYM package must be used for debugging and symbolicating
26+
strip -S -x "$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphonesimulator/NativeScript.framework/NativeScript" \
27+
"$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphoneos/NativeScript.framework/NativeScript"
28+
echo "CodeSign $WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphonesimulator/NativeScript.framework/NativeScript"
29+
30+
/usr/bin/codesign --force --sign - --timestamp=none "$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphonesimulator/NativeScript.framework/NativeScript"
31+
2432
lipo -create -output "NativeScript.framework/NativeScript" \
2533
"$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphonesimulator/NativeScript.framework/NativeScript" \
2634
"$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphoneos/NativeScript.framework/NativeScript"
2735

36+
2837
cp -r "$WORKSPACE/cmake-build/src/NativeScript/RelWithDebInfo-iphoneos/NativeScript.framework.dSYM" "."
2938
rm "NativeScript.framework.dSYM/Contents/Resources/DWARF/NativeScript"
3039
lipo -create -output "NativeScript.framework.dSYM/Contents/Resources/DWARF/NativeScript" \

build/scripts/package-tns-ios.sh

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ PACKAGE_DIR="$DIST_DIR/package"
1010
FRAMEWORK_DIR="$PACKAGE_DIR/framework"
1111
INTERNAL_DIR="$FRAMEWORK_DIR/internal"
1212

13+
# Start with a clean package directory
14+
rm -rf $PACKAGE_DIR
1315
mkdir -p "$INTERNAL_DIR"
1416

1517
"$WORKSPACE/build/scripts/build-livesync-static-lib.sh"

0 commit comments

Comments
 (0)