Skip to content

Commit 286c5be

Browse files
committed
chore: cleanup build scripts
1 parent 3b2fc94 commit 286c5be

File tree

5 files changed

+58
-21
lines changed

5 files changed

+58
-21
lines changed

build_metadata_generator.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
set -e
3+
source "$(dirname "$0")/build_utils.sh"
34

45
./download_llvm.sh
56

@@ -20,10 +21,10 @@ function build {
2021
pushd "metadata-generator"
2122
rm -rf dist
2223
mkdir dist
23-
echo "Building metadata generator for x86_64 ..."
24+
checkpoint "Building metadata generator for x86_64 ..."
2425
build "x86_64"
2526

26-
echo "Building metadata generator for arm64 ..."
27+
checkpoint "Building metadata generator for arm64 ..."
2728
build "arm64"
2829
rm -rf build
2930
popd

build_nativescript.sh

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#!/bin/bash
22
set -e
3+
source "$(dirname "$0")/build_utils.sh"
34

45
DEV_TEAM=${DEVELOPMENT_TEAM:-}
56
DIST=$(PWD)/dist
67
mkdir -p $DIST
78

89
mkdir -p $DIST/intermediates
910

10-
echo "Cleanup"
11-
xcodebuild -project v8ios.xcodeproj -target "NativeScript" -configuration Release clean
11+
checkpoint "Cleanup NativeScript"
12+
xcodebuild -project v8ios.xcodeproj \
13+
-target "NativeScript" \
14+
-configuration Release clean \
15+
-quiet
1216

13-
echo "Building for Mac Catalyst"
17+
checkpoint "Building NativeScript for Mac Catalyst"
1418
xcodebuild archive -project v8ios.xcodeproj \
1519
-scheme "NativeScript" \
1620
-configuration Release \
@@ -19,7 +23,7 @@ xcodebuild archive -project v8ios.xcodeproj \
1923
SKIP_INSTALL=NO \
2024
-archivePath $DIST/intermediates/NativeScript.maccatalyst.xcarchive
2125

22-
# echo "Building for x86_64 iphone simulator"
26+
# checkpoint "Building for x86_64 iphone simulator"
2327
# xcodebuild archive -project v8ios.xcodeproj \
2428
# -scheme "NativeScript" \
2529
# -configuration Release \
@@ -30,7 +34,7 @@ xcodebuild archive -project v8ios.xcodeproj \
3034
# SKIP_INSTALL=NO \
3135
# -archivePath $DIST/NativeScript.x86_64-iphonesimulator.xcarchive
3236

33-
# echo "Building for ARM64 iphone simulator"
37+
# checkpoint "Building for ARM64 iphone simulator"
3438
# xcodebuild archive -project v8ios.xcodeproj \
3539
# -scheme "NativeScript" \
3640
# -configuration Release \
@@ -41,25 +45,26 @@ xcodebuild archive -project v8ios.xcodeproj \
4145
# SKIP_INSTALL=NO \
4246
# -archivePath $DIST/NativeScript.arm64-iphonesimulator.xcarchive
4347

44-
echo "Building for iphone simulators (multi-arch)"
48+
checkpoint "Building NativeScript for iphone simulators (multi-arch)"
4549
xcodebuild archive -project v8ios.xcodeproj \
4650
-scheme "NativeScript" \
4751
-configuration Release \
52+
-destination "generic/platform=iOS Simulator" \
4853
-sdk iphonesimulator \
49-
-arch x86_64 \
50-
-arch arm64 \
5154
-quiet \
55+
EXCLUDED_ARCHS="i386" \
5256
DEVELOPMENT_TEAM=$DEV_TEAM \
5357
SKIP_INSTALL=NO \
5458
-archivePath $DIST/intermediates/NativeScript.iphonesimulator.xcarchive
5559

56-
echo "Building for ARM64 device"
60+
checkpoint "Building NativeScript for ARM64 device"
5761
xcodebuild archive -project v8ios.xcodeproj \
5862
-scheme "NativeScript" \
5963
-configuration Release \
60-
-arch arm64 \
64+
-destination "generic/platform=iOS" \
6165
-sdk iphoneos \
6266
-quiet \
67+
EXCLUDED_ARCHS="armv7" \
6368
DEVELOPMENT_TEAM=$DEV_TEAM \
6469
SKIP_INSTALL=NO \
6570
-archivePath $DIST/intermediates/NativeScript.iphoneos.xcarchive
@@ -79,7 +84,7 @@ xcodebuild archive -project v8ios.xcodeproj \
7984
# -output \
8085
# "$DIST/NativeScript.iphonesimulator.xcarchive/Products/Library/Frameworks/NativeScript.framework/NativeScript"
8186

82-
echo "Creating NativeScript.xcframework"
87+
checkpoint "Creating NativeScript.xcframework"
8388
OUTPUT_DIR="$DIST/NativeScript.xcframework"
8489
rm -rf $OUTPUT_DIR
8590
xcodebuild -create-xcframework \

build_tklivesync.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
#!/bin/bash
22
set -e
3+
source "$(dirname "$0")/build_utils.sh"
34

45
DIST=$(PWD)/dist
56
mkdir -p $DIST
67

78
mkdir -p $DIST/intermediates
89

910
#cleanup
10-
xcodebuild -project v8ios.xcodeproj -target TKLiveSync -configuration Release clean
11+
checkpoint "Cleanup TKLiveSync"
12+
xcodebuild -project v8ios.xcodeproj \
13+
-target TKLiveSync \
14+
-configuration Release clean \
15+
-quiet
1116

1217
#generates library for Mac Catalyst target
18+
checkpoint "Building TKLiveSync for Mac Catalyst"
1319
xcodebuild archive -project v8ios.xcodeproj \
1420
-scheme TKLiveSync \
1521
-configuration Release \
@@ -38,20 +44,22 @@ xcodebuild archive -project v8ios.xcodeproj \
3844
# -archivePath $DIST/TKLiveSync.arm64-iphonesimulator.xcarchive
3945

4046
# generates library for simulator targets (usually includes arm64, x86_64)
47+
checkpoint "Building TKLiveSync for iphone simulators (multi-arch)"
4148
xcodebuild archive -project v8ios.xcodeproj \
4249
-scheme TKLiveSync \
4350
-configuration Release \
51+
-destination "generic/platform=iOS Simulator" \
4452
-sdk iphonesimulator \
45-
-arch x86_64 \
46-
-arch arm64 \
4753
-quiet \
4854
SKIP_INSTALL=NO \
4955
-archivePath $DIST/intermediates/TKLiveSync.iphonesimulator.xcarchive
5056

5157
#generates library for device target
58+
checkpoint "Building TKLiveSync for ARM64 device"
5259
xcodebuild archive -project v8ios.xcodeproj \
5360
-scheme TKLiveSync \
5461
-configuration Release \
62+
-destination "generic/platform=iOS" \
5563
-sdk iphoneos \
5664
-quiet \
5765
SKIP_INSTALL=NO \
@@ -77,6 +85,7 @@ rm -rf "${OUTPUT_PATH}"
7785
# "$DIST/TKLiveSync.iphonesimulator.xcarchive/Products/Library/Frameworks/TKLiveSync.framework/TKLiveSync"
7886

7987
#Creates xcframework
88+
checkpoint "Creating TKLiveSync.xcframework"
8089
xcodebuild -create-xcframework \
8190
-framework "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/Products/Library/Frameworks/TKLiveSync.framework" \
8291
-debug-symbols "$DIST/intermediates/TKLiveSync.maccatalyst.xcarchive/dSYMs/TKLiveSync.framework.dSYM" \

build_utils.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# include this in other bash scripts with the following line:
5+
#
6+
# source "$(dirname "$0")/build_utils.sh"
7+
#
8+
9+
# Prints a timestamp + title for a step/section
10+
function checkpoint {
11+
local delimiter="--------------------------------------------------------------------------------"
12+
13+
echo ""
14+
echo ""
15+
echo "$delimiter"
16+
echo "--- $(date +'%T') --- $1 "
17+
echo "$delimiter"
18+
echo ""
19+
}

download_llvm.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/bin/bash
22
set -e
3+
source "$(dirname "$0")/build_utils.sh"
4+
5+
LLVM_VERSION="13.0.1"
36

47
function download_llvm() {
5-
echo 'Downloading llvm...'
8+
checkpoint "Downloading llvm (version $LLVM_VERSION)..."
69
mkdir -p /tmp/llvm-dl/
7-
curl -L https://github.com/NativeScript/ios-llvm/releases/download/v13.0.1/llvm-13.0.1.tgz -o /tmp/llvm-dl/llvm-13.0.1.tgz
10+
curl -L https://github.com/NativeScript/ios-llvm/releases/download/v$LLVM_VERSION/llvm-$LLVM_VERSION.tgz -o /tmp/llvm-dl/llvm-$LLVM_VERSION.tgz
811
mkdir -p ./llvm/
9-
echo 'extracting llvm...'
10-
tar -xzf /tmp/llvm-dl/llvm-13.0.1.tgz -C ./llvm/
12+
checkpoint 'extracting llvm...'
13+
tar -xzf /tmp/llvm-dl/llvm-$LLVM_VERSION.tgz -C ./llvm/
1114
}
1215

13-
if [ ! -d "./llvm/13.0.1" ]; then
16+
if [ ! -d "./llvm/$LLVM_VERSION" ]; then
1417
download_llvm
1518
fi

0 commit comments

Comments
 (0)