Skip to content

Commit 7b1fe94

Browse files
authored
Fixing various issues with build pipeline (#102)
Fixing a bunch of things that have broken in the build pipeline with build agent updates over the last few months: - MacOS & iOS: Use newer versions of Xcode (14 is no longer available) - iOS: On either newer MacOS versions or Xcode versions, the emulator has to be booted before the build, otherwise the build thinks there is no available "destination" for the build. - Android: SDKManager requires Java 8, which is no longer the default, so it needs to be set explicitly before running SDKManager. - Android: The emulator boot has errors if audio isn't disabled, so disabling audio (and splash screen to make it faster). - Android: The pipeline is setup to use an x86/x64 emulator, but the newer MacOS build agent images are arm64. For now I just switched these pipelines back to macos-13. Separately we can probably update the pipeline to use arm64 emulator images. - Android: The build would not deploy on the device. I tried locally and got the same behavior. The only way I could get it to work was to upgrade gradle. I did this with the upgrade assistant in Android Studio. - Android: With the newer version of gradle, I also had to update to Java 17 when running the gradle command. - Android: Once the build was deploying, I was getting a runtime error that seemed to be related to how the app interfaces with the emulator. After some research, I found that I needed to upgrade the NDK to 23. I assume this is because we are using a newer version of the emulator itself (not the device image or API level). - Android: With the gradle update, the gradle version is now in the test result file names, but with spaces (e.g. `Pixel_API_27(AVD) - 8.1.0/aapt.1.ok.txt`), so I had to update the script that dumps the contents of these files to the console.
1 parent 4638802 commit 7b1fe94

File tree

8 files changed

+26
-19
lines changed

8 files changed

+26
-19
lines changed

.github/azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ jobs:
7676
# iOS
7777
- template: jobs/ios.yml
7878
parameters:
79-
name: 'iOS_Xcode142'
79+
name: 'iOS_Xcode162'
8080
vmImage: 'macOS-latest'
81-
xCodeVersion: 14.2
82-
simulator: 'iPhone 11'
81+
xCodeVersion: 16.2
82+
simulator: 'iPhone 16'
8383

8484
- template: jobs/ios.yml
8585
parameters:
86-
name: 'iOS_Xcode150'
86+
name: 'iOS_Xcode152'
8787
vmImage: 'macOS-13'
88-
xCodeVersion: 15.0
88+
xCodeVersion: 15.2
8989
simulator: 'iPhone 14'
9090

9191
# Linux

.github/jobs/android.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ jobs:
99
timeoutInMinutes: 30
1010

1111
pool:
12-
vmImage: macos-latest
12+
vmImage: macos-13
1313

1414
steps:
1515
- script: |
1616
echo Install Android image
17+
export JAVA_HOME=$JAVA_HOME_8_X64
1718
echo 'y' | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;default;x86_64'
1819
echo 'y' | $ANDROID_HOME/tools/bin/sdkmanager --licenses
1920
echo Create AVD
@@ -22,7 +23,7 @@ jobs:
2223
2324
- script: |
2425
echo Start emulator
25-
nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_27 -gpu host -no-window 2>&1 &
26+
nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_27 -gpu host -no-window -no-audio -no-boot-anim 2>&1 &
2627
echo Wait for emulator
2728
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do echo '.'; sleep 1; done'
2829
$ANDROID_HOME/platform-tools/adb devices
@@ -34,13 +35,14 @@ jobs:
3435
workingDirectory: 'Tests/UnitTests/Android'
3536
options: '-PabiFilters=x86_64 -PjsEngine=${{parameters.jsEngine}} -PndkVersion=$(ndkVersion)'
3637
tasks: 'connectedAndroidTest'
37-
jdkVersionOption: 1.11
38+
jdkVersionOption: 1.17
3839
displayName: 'Run Connected Android Test'
3940

4041
- script: |
41-
export results=$(find ./app/build/outputs/androidTest-results -name "*.txt")
42-
echo cat "$results"
43-
cat "$results"
42+
find ./app/build/outputs/androidTest-results -name "*.txt" -print0 | while IFS= read -r -d '' file; do
43+
echo "cat \"$file\""
44+
cat "$file"
45+
done
4446
workingDirectory: 'Tests/UnitTests/Android'
4547
condition: succeededOrFailed()
4648
displayName: 'Dump logcat from Test Results'

.github/jobs/ios.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
cmake -B Build/iOS -G Xcode -D IOS=ON
2121
displayName: 'Configure CMake'
2222
23+
- script: |
24+
echo Boot "${{parameters.simulator}}"
25+
xcrun simctl boot "${{parameters.simulator}}"
26+
displayName: 'Boot Simulator'
27+
2328
- task: Xcode@5
2429
inputs:
2530
xcWorkspacePath: 'Build/iOS/JsRuntimeHost.xcodeproj'
@@ -30,8 +35,6 @@ jobs:
3035
displayName: 'Build Xcode Project'
3136

3237
- script: |
33-
echo Boot "${{parameters.simulator}}"
34-
xcrun simctl boot "${{parameters.simulator}}"
3538
echo Install UnitTests app
3639
xcrun simctl install booted "Build/iOS/Tests/UnitTests/RelWithDebInfo-iphonesimulator/UnitTests.app"
3740
echo Launch UnitTests app

.github/jobs/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77

88
steps:
99
- script: |
10-
sudo xcode-select --switch /Applications/Xcode_14.0.app/Contents/Developer
11-
displayName: 'Select Xcode 14.0'
10+
sudo xcode-select --switch /Applications/Xcode_15.1.app/Contents/Developer
11+
displayName: 'Select Xcode 15.1'
1212
1313
- script: |
1414
cmake -B Build/macOS -GXcode

Tests/UnitTests/Android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (project.hasProperty("jsEngine")) {
1010
android {
1111
namespace 'com.jsruntimehost.unittests'
1212
compileSdk 33
13-
ndkVersion = "21.4.7075529"
13+
ndkVersion = "23.1.7779620"
1414
if (project.hasProperty("ndkVersion")) {
1515
ndkVersion = project.property("ndkVersion")
1616
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '7.3.1' apply false
4-
id 'com.android.library' version '7.3.1' apply false
3+
id 'com.android.application' version '8.8.0' apply false
4+
id 'com.android.library' version '8.8.0' apply false
55
}

Tests/UnitTests/Android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ android.useAndroidX=true
1919
# resources declared in the library itself and none from the library's dependencies,
2020
# thereby reducing the size of the R class for that library
2121
android.nonTransitiveRClass=true
22+
android.defaults.buildfeatures.buildconfig=true
23+
android.nonFinalResIds=false
2224
# Select the JavaScript engine to use
2325
#jsEngine=JavaScriptCore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Jan 20 12:19:56 PST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)