-
Notifications
You must be signed in to change notification settings - Fork 527
/
Copy pathbuild_apple_llm_demo.sh
executable file
·58 lines (45 loc) · 1.6 KB
/
build_apple_llm_demo.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
set -euo pipefail
ARTIFACTS_DIR_NAME="$1"
APP_PATH="extension/benchmark/apple/Benchmark/Benchmark"
xcodebuild build-for-testing \
-project "${APP_PATH}.xcodeproj" \
-scheme Benchmark \
-destination "platform=iOS" \
-sdk iphoneos \
-allowProvisioningUpdates \
DEVELOPMENT_TEAM=78E7V7QP35 \
CODE_SIGN_STYLE=Manual \
PROVISIONING_PROFILE_SPECIFIER="ExecuTorch Benchmark" \
CODE_SIGN_IDENTITY="iPhone Distribution" \
CODE_SIGNING_REQUIRED=No \
CODE_SIGNING_ALLOWED=No
# The hack to figure out where the xctest package locates
BUILD_DIR=$(xcodebuild -showBuildSettings -project "$APP_PATH.xcodeproj" -json | jq -r ".[0].buildSettings.BUILD_DIR")
# Prepare the demo app, debug mode here is the default from xcodebuild and match
# with what we have in the test spec
MODE="Release"
PLATFORM="iphoneos"
pushd "${BUILD_DIR}/${MODE}-${PLATFORM}"
rm -rf Payload && mkdir Payload
APP_NAME=Benchmark
ls -lah
cp -r "${APP_NAME}.app" Payload && zip -vr "${APP_NAME}.ipa" Payload
popd
# Prepare the test suite
pushd "${BUILD_DIR}"
ls -lah
zip -vr "${APP_NAME}.xctestrun.zip" *.xctestrun
popd
if [[ -n "${ARTIFACTS_DIR_NAME}" ]]; then
mkdir -p "${ARTIFACTS_DIR_NAME}"
# Prepare all the artifacts to upload
cp "${BUILD_DIR}/${MODE}-${PLATFORM}/${APP_NAME}.ipa" "${ARTIFACTS_DIR_NAME}/"
cp "${BUILD_DIR}/${APP_NAME}.xctestrun.zip" "${ARTIFACTS_DIR_NAME}/"
ls -lah "${ARTIFACTS_DIR_NAME}/"
fi