Skip to content

Commit 220f39b

Browse files
Add Java.Interop CI stage and merge follow-ups
Adds a shared 'Java.Interop Tests' stage template at build-tools/automation/yaml-templates/stage-java-interop-tests.yaml that runs the two jobs from the upstream java-interop pipeline (Windows - .NET, Mac - .NET) using the in-tree external/Java.Interop/build-tools/automation/templates/ files. The stage is wired into both the official pipeline (azure-pipelines.yaml) and the public PR validation pipeline (azure-pipelines-public.yaml) so they stay in lockstep with zero duplication. A follow-up PR will reorganize external/Java.Interop and dedupe its nested external/* submodules against dotnet/android's own external/.
1 parent ec38a73 commit 220f39b

19 files changed

Lines changed: 125 additions & 2540 deletions

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@
3333
[submodule "external/termux-elf-cleaner"]
3434
path = external/termux-elf-cleaner
3535
url = https://github.com/termux/termux-elf-cleaner
36+
[submodule "external/Java.Interop/external/xamarin-android-tools"]
37+
path = external/Java.Interop/external/xamarin-android-tools
38+
url = https://github.com/xamarin/xamarin-android-tools.git
39+
branch = main

build-tools/automation/azure-pipelines-public.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ stages:
412412
parameters:
413413
condition: true
414414

415+
# Java.Interop Tests Stage
416+
- template: /build-tools/automation/yaml-templates/stage-java-interop-tests.yaml@self
417+
415418
# MAUI Tests Stage
416419
- stage: maui_tests
417420
displayName: MAUI Tests

build-tools/automation/azure-pipelines.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ extends:
9999
parameters:
100100
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}
101101

102+
- template: /build-tools/automation/yaml-templates/stage-java-interop-tests.yaml@self
103+
102104
- stage: maui_tests
103105
displayName: MAUI Tests
104106
dependsOn: mac_build

build-tools/automation/yaml-templates/cache-gradle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ parameters:
99

1010
steps:
1111
- script: |
12-
git submodule status --cached external/Java.Interop > $(Agent.TempDirectory)/java-interop-submodule-hash.txt
12+
git log -1 --format=%H external/Java.Interop > $(Agent.TempDirectory)/java-interop-submodule-hash.txt
1313
echo "##vso[task.setvariable variable=GRADLE_CACHE_DIR]$HOME/.gradle/caches"
1414
workingDirectory: ${{ parameters.xaSourcePath }}
1515
displayName: prepare Gradle cache variables
1616
condition: ne(variables['Agent.OS'], 'Windows_NT')
1717

1818
- pwsh: |
19-
git submodule status --cached external/Java.Interop > $(Agent.TempDirectory)/java-interop-submodule-hash.txt
19+
git log -1 --format=%H external/Java.Interop > $(Agent.TempDirectory)/java-interop-submodule-hash.txt
2020
$gradleCacheDir = Join-Path $env:USERPROFILE ".gradle\caches"
2121
Write-Host "##vso[task.setvariable variable=GRADLE_CACHE_DIR]$gradleCacheDir"
2222
workingDirectory: ${{ parameters.xaSourcePath }}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Java.Interop tests stage
2+
#
3+
# Mirrors the two jobs from
4+
# external/Java.Interop/build-tools/automation/azure-pipelines.yaml
5+
# (windows_dotnet_build, mac_dotnet_build) so that the Java.Interop
6+
# build + tests continue to run as part of dotnet/android CI now that
7+
# Java.Interop has been merged in-tree.
8+
#
9+
# Referenced from both:
10+
# - build-tools/automation/azure-pipelines.yaml (official / 1ES)
11+
# - build-tools/automation/azure-pipelines-public.yaml (public PR validation)
12+
13+
parameters:
14+
- name: stageName
15+
type: string
16+
default: java_interop_tests
17+
- name: dependsOn
18+
type: object
19+
default: []
20+
- name: condition
21+
type: string
22+
default: succeeded()
23+
24+
stages:
25+
- stage: ${{ parameters.stageName }}
26+
displayName: Java.Interop Tests
27+
dependsOn: ${{ parameters.dependsOn }}
28+
condition: ${{ parameters.condition }}
29+
variables:
30+
# Variables consumed by external/Java.Interop/build-tools/automation/templates/*.yaml.
31+
# Defined at stage scope so they don't conflict with dotnet/android-wide
32+
# variables (e.g. DotNetTargetFramework=net11.0).
33+
DotNetCoreVersion: $(DotNetSdkVersion).x
34+
DotNetTargetFramework: $(DotNetStableTargetFramework)
35+
NetCoreTargetFrameworkPathSuffix: -$(DotNetStableTargetFramework)
36+
Build.Configuration: Release
37+
RunningOnCI: true
38+
jobs:
39+
40+
# Check - "Xamarin.Android (Java.Interop Tests Windows - .NET)"
41+
- job: java_interop_windows_dotnet_build
42+
displayName: Windows - .NET
43+
pool:
44+
name: Azure Pipelines
45+
vmImage: $(HostedWinImage)
46+
timeoutInMinutes: 60
47+
workspace:
48+
clean: all
49+
steps:
50+
- checkout: self
51+
submodules: recursive
52+
clean: true
53+
54+
- template: /external/Java.Interop/build-tools/automation/templates/install-dependencies.yaml@self
55+
56+
- template: /external/Java.Interop/build-tools/automation/templates/core-build.yaml@self
57+
58+
- template: /external/Java.Interop/build-tools/automation/templates/core-tests.yaml@self
59+
parameters:
60+
runNativeDotnetTests: true
61+
nativeAotRid: win-x64
62+
platformName: .NET - Windows
63+
64+
- template: /external/Java.Interop/build-tools/automation/templates/fail-on-dirty-tree.yaml@self
65+
66+
- template: /external/Java.Interop/build-tools/automation/templates/fail-on-issue.yaml@self
67+
68+
- task: PublishPipelineArtifact@1
69+
displayName: Publish build artifacts
70+
inputs:
71+
artifactName: java-interop-windows
72+
targetPath: external/Java.Interop/bin
73+
condition: succeededOrFailed()
74+
75+
# Check - "Xamarin.Android (Java.Interop Tests Mac - .NET)"
76+
- job: java_interop_mac_dotnet_build
77+
displayName: Mac - .NET
78+
pool:
79+
name: Azure Pipelines
80+
vmImage: $(HostedMacImage)
81+
timeoutInMinutes: 20
82+
workspace:
83+
clean: all
84+
steps:
85+
- checkout: self
86+
submodules: recursive
87+
clean: true
88+
89+
- template: /external/Java.Interop/build-tools/automation/templates/install-dependencies.yaml@self
90+
91+
- template: /external/Java.Interop/build-tools/automation/templates/core-build.yaml@self
92+
93+
- template: /external/Java.Interop/build-tools/automation/templates/core-tests.yaml@self
94+
parameters:
95+
runNativeTests: true
96+
nativeAotRid: osx-x64
97+
platformName: .NET - MacOS
98+
99+
- template: /external/Java.Interop/build-tools/automation/templates/fail-on-dirty-tree.yaml@self
100+
101+
- template: /external/Java.Interop/build-tools/automation/templates/fail-on-issue.yaml@self

build-tools/scripts/XAVersionInfo.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
<!-- If anything changes in this list, make sure to update:
1717
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets (the _GenerateXACommonProps target)
1818
-->
19-
<_SubmoduleBranchInfo Include="external/Java.Interop">
20-
<OutputPropertyName>_BuildInfo_JavaInteropCommit</OutputPropertyName>
21-
</_SubmoduleBranchInfo>
19+
<!-- Java.Interop is no longer a submodule; it lives in-tree under
20+
external/Java.Interop/. Its commit is the dotnet/android commit. -->
2221
<_SubmoduleBranchInfo Include="external/xamarin-android-tools">
2322
<OutputPropertyName>_BuildInfo_XamarinAndroidToolsCommit</OutputPropertyName>
2423
</_SubmoduleBranchInfo>

external/Java.Interop/.github/dependabot.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)