Skip to content

Commit

Permalink
Add support of Android multi-ABI builds
Browse files Browse the repository at this point in the history
This patchset adds the rules to utilize build artifacts from multiple
android abi builds and to use them for building and running tests.
If target.arch has the value 'Multi', coin will now skip building Qt
itself, since this means that all Qt versions were build previously.
It only builds test using the pre-built Qt for Android archives and
then runs the regular Android tests using multi-ABI apks. The rules
are implemented for qtbase only.

Change-Id: I265c70c45caa2155c75cd15c7e3a4f6a863252b8
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
semlanik committed Nov 4, 2022
1 parent 8d76c5a commit 7b9bb69
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ instructions:
variableName: INSTALL_DIR_FOR_CMAKE_TESTS
variableValue: "{{.InstallDir}}/target"
disable_if:
condition: property
property: host.os
equals_value: Windows
condition: or
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: Android_ANY
- condition: property
property: target.arch
equals_value: Multi
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "{{.Env.COMMON_TARGET_TEST_CMAKE_ARGS}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ instructions:
- type: Group
instructions:
- type: ExecuteCommand
command: "{{.InstallDir}}/libexec/android_emulator_launcher.sh"
command: "{{.Env.LIBEXEC_INSTALL_DIR}}/android_emulator_launcher.sh"
maxTimeInSeconds: 600
maxTimeBetweenOutput: 300
userMessageOnFailure: "Failed to start emulator, check coin log and ~/emulator.log"
Expand Down
14 changes: 13 additions & 1 deletion coin/instructions/coin_qtbase_build_template_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@ instructions:
not_contains_value: "TargetBuildOnly"
- type: Group
instructions:
- !include "{{qt/qtbase}}/cmake_cross_compilation_qtbase_build_instructions.yaml"
- type: Group
instructions:
- !include "{{qt/qtbase}}/cmake_cross_compilation_qtbase_build_instructions.yaml"
disable_if:
condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: Android_ANY
- condition: property
property: target.arch
equals_value: Multi
- !include "{{qt/qtbase}}/prepare_android_multi_abi_env.yaml"
- type: Group
instructions:
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml"
Expand Down
29 changes: 29 additions & 0 deletions coin/instructions/prepare_android_multi_abi_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: INSTALL_DIR_FOR_CMAKE_TESTS
variableValue: "{{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86\"}}{{index .Env $android_artifact_path}}/install/target"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DQT_PATH_ANDROID_ABI_arm64-v8a={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-arm64-v8a\"}}{{index .Env $android_artifact_path}}/install/target"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DQT_PATH_ANDROID_ABI_armeabi-v7a={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-armeabi-v7a\"}}{{index .Env $android_artifact_path}}/install/target"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DQT_PATH_ANDROID_ABI_x86={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86\"}}{{index .Env $android_artifact_path}}/install/target"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DQT_PATH_ANDROID_ABI_x86_64={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86_64\"}}{{index .Env $android_artifact_path}}/install/target"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DQT_HOST_PATH={{.Env.HOST_INSTALL_DIR}}"
enable_if:
condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: Android_ANY
- condition: property
property: target.arch
equals_value: Multi
56 changes: 41 additions & 15 deletions coin/instructions/prepare_building_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,6 @@ instructions:
property: host.os
equals_value: Windows

- type: EnvironmentVariable
variableName: LIBEXEC_INSTALL_DIR
variableValue: "{{.InstallDir}}\\bin\\"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: LIBEXEC_INSTALL_DIR
variableValue: "{{.InstallDir}}/libexec/"
disable_if:
condition: property
property: host.os
equals_value: Windows

# Export ICC specific env. variables
- type: Group
instructions:
Expand Down Expand Up @@ -553,3 +538,44 @@ instructions:
- condition: property
property: host.os
contains_value: Windows

- type: EnvironmentVariable
variableName: HOST_INSTALL_DIR
variableValue: "{{$android_host_artifact_path := index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-host\" }}{{index .Env $android_host_artifact_path}}/install"
enable_if:
condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: Android_ANY
- condition: property
property: target.arch
equals_value: Multi

- type: EnvironmentVariable
variableName: HOST_INSTALL_DIR
variableValue: "{{.InstallDir}}"
disable_if:
condition: and
conditions:
- condition: property
property: target.osVersion
equals_value: Android_ANY
- condition: property
property: target.arch
equals_value: Multi

- type: EnvironmentVariable
variableName: LIBEXEC_INSTALL_DIR
variableValue: "{{.Env.HOST_INSTALL_DIR}}\\bin\\"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: LIBEXEC_INSTALL_DIR
variableValue: "{{.Env.HOST_INSTALL_DIR}}/libexec/"
disable_if:
condition: property
property: host.os
equals_value: Windows

0 comments on commit 7b9bb69

Please sign in to comment.