Skip to content

Commit

Permalink
Initial Mono Android CI (#34125)
Browse files Browse the repository at this point in the history
  • Loading branch information
directhex authored Apr 2, 2020
1 parent 907b5ae commit a4a1c8b
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 1 deletion.
88 changes: 88 additions & 0 deletions eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,94 @@ jobs:
# asArray: []
# ${{ insert }}: ${{ parameters.jobParameters }}

# Android x64

- ${{ if containsValue(parameters.platforms, 'Android_x64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: Android
archType: x64
platform: Android_x64
container:
image: ubuntu-18.04-android-20200401093035-1517ea2
registry: mcr
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
${{ insert }}: ${{ parameters.jobParameters }}

# Android x86

- ${{ if containsValue(parameters.platforms, 'Android_x86') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: Android
archType: x86
platform: Android_x86
container:
image: ubuntu-18.04-android-20200401093035-1517ea2
registry: mcr
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
${{ insert }}: ${{ parameters.jobParameters }}

# Android arm

- ${{ if containsValue(parameters.platforms, 'Android_arm') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: Android
archType: arm
platform: Android_arm
container:
image: ubuntu-18.04-android-20200401093035-1517ea2
registry: mcr
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
${{ insert }}: ${{ parameters.jobParameters }}

# Android arm64

- ${{ if containsValue(parameters.platforms, 'Android_arm64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
osGroup: Android
archType: arm64
platform: Android_arm64
container:
image: ubuntu-18.04-android-20200401093035-1517ea2
registry: mcr
jobParameters:
runtimeFlavor: mono
stagedBuild: ${{ parameters.stagedBuild }}
buildConfig: ${{ parameters.buildConfig }}
${{ if eq(parameters.passPlatforms, true) }}:
platforms: ${{ parameters.platforms }}
helixQueueGroup: ${{ parameters.helixQueueGroup }}
${{ insert }}: ${{ parameters.jobParameters }}

# iOS x64

- ${{ if containsValue(parameters.platforms, 'iOS_x64') }}:
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/common/xplat-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ jobs:
- name: ROOTFS_DIR
value: ${{ parameters.jobParameters.crossrootfsDir }}

- ${{ if eq(parameters.osGroup, 'Android') }}:
- name: ANDROID_NDK_HOME
value: /usr/local/ndk

- name: runtimeFlavorName
${{ if eq(parameters.jobParameters.runtimeFlavor, 'mono') }}:
value: Mono
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/libraries/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
- ${{ if eq(parameters.osGroup, 'iOS') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

# force a value for OS when cross-building Android on Linux
- ${{ if eq(parameters.osGroup, 'Android') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}

- ${{ if ne(parameters.framework, '') }}:
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _extraHelixArguments: /p:BuildTargetFramework=${{ parameters.framework }}
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/mono/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
- ${{ if eq(parameters.osGroup, 'iOS') }}:
- name: osOverride
value: -os iOS
- ${{ if eq(parameters.osGroup, 'Android') }}:
- name: osOverride
value: -os Android
- ${{ parameters.variables }}

steps:
Expand Down
8 changes: 8 additions & 0 deletions eng/pipelines/runtime-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ stages:
runtimeFlavor: mono
buildConfig: release
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_x64
- iOS_arm
- iOS_arm64
Expand Down Expand Up @@ -116,6 +120,10 @@ stages:
buildConfig: Release
runtimeFlavor: mono
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_x64
- iOS_arm
- iOS_arm64
Expand Down
16 changes: 16 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ jobs:
runtimeFlavor: mono
buildConfig: debug
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_x64
- iOS_arm
- iOS_arm64
Expand Down Expand Up @@ -261,6 +265,10 @@ jobs:
runtimeFlavor: mono
buildConfig: release
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_x64
- iOS_arm
- iOS_arm64
Expand Down Expand Up @@ -378,6 +386,10 @@ jobs:
buildConfig: Release
runtimeFlavor: mono
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_arm
- iOS_arm64
- iOS_x64
Expand All @@ -390,6 +402,10 @@ jobs:
buildConfig: Debug
runtimeFlavor: mono
platforms:
- Android_x64
- Android_x86
- Android_arm
- Android_arm64
- iOS_arm
- iOS_arm64
- iOS_x64
Expand Down
4 changes: 4 additions & 0 deletions src/libraries/Native/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ elif [[ "$__TargetOS" == Android && -z "$ROOTFS_DIR" ]]; then
# keep ANDROID_NATIVE_API_LEVEL in sync with src/mono/Directory.Build.props
__CMakeArgs="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_STL=none -DANDROID_NATIVE_API_LEVEL=21 $__CMakeArgs"

# workaround init-compiler.sh trying to detect clang, it's handled in android.toolchain.cmake already
export CLR_CC=$(which false)
export CLR_CXX=$(which false)

if [[ "$__BuildArch" == x64 ]]; then
__CMakeArgs="-DANDROID_ABI=x86_64 $__CMakeArgs"
elif [[ "$__BuildArch" == x86 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
</PropertyGroup>

<!-- Linux options -->
<ItemGroup Condition="'$(TargetsLinux)' == true and '$(TargetsAndroid)' != 'true'">
<ItemGroup Condition="'$(TargetsLinux)' == true">
<_MonoCFLAGS Include="-Wl,--build-id" />
<_MonoCXXFLAGS Include="-Wl,--build-id" />
</ItemGroup>
Expand Down

0 comments on commit a4a1c8b

Please sign in to comment.