-
Notifications
You must be signed in to change notification settings - Fork 0
/
appcenter-pre-build.sh
31 lines (25 loc) · 1.13 KB
/
appcenter-pre-build.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
#!/usr/bin/env bash
export JAVA_HOME=${JAVA_HOME_17_X64}
export PATH=${JAVA_HOME}/bin:${PATH}
if [[ $SUPPORTS_MOBILE_TOOLKIT == True ]]; then
echo "Configuring template with mobile toolkit"
npm run configure
fi
INFO_PLIST=$APPCENTER_SOURCE_DIRECTORY/ios/$APPCENTER_XCODE_SCHEME/Info.plist
if [[ -e "$INFO_PLIST" && $IS_DEV_APP == False ]]; then
echo "Removing old MendixNative lib"
rm -rf $APPCENTER_SOURCE_DIRECTORY/ios/MendixNative
echo "Stripping references of old MendixNative (i386, x86_64, arm64) archs"
LIB_PATH=$APPCENTER_SOURCE_DIRECTORY/ios/MendixNative/libMendix.a
lipo -remove arm64 -output $LIB_PATH $LIB_PATH || true
lipo -remove x86_64 -output $LIB_PATH $LIB_PATH || true
lipo -remove i386 -output $LIB_PATH $LIB_PATH || true
lipo -info $LIB_PATH || true
cat $INFO_PLIST
fi
CODE_PUSH_KEY_FILE=$APPCENTER_SOURCE_DIRECTORY/android/app/src/main/res/raw/code_push_key
if [[ -e "$CODE_PUSH_KEY_FILE" && $IS_DEV_APP == False ]]; then
echo "Updating Android code_push_key resource file with code push key"
sed -i '' 's/.*/'$CODE_PUSH_KEY'/' $CODE_PUSH_KEY_FILE;
cat $CODE_PUSH_KEY_FILE
fi