-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add an "macOS .NET Core" build (#655)
Add a `Mac - .NET Core` build to Azure Pipelines, which *mostly* uses .NET Core to build the Java.Interop repo on macOS, with *few* Mono dependencies. Some notable changes: * Adds the `Prepare` target on Mac (.NET Core only) to move closer to what Windows uses, with the eventual goal of all systems being identical. * Adds the [`Microsoft.NETFramework.ReferenceAssemblies`][0] NuGet package to all assemblies that target `net472`. This allows them to be built on .NET Core, which does not have `net472` reference assemblies. * [Use `/`, not `\`, in `<Exec/>` tasks][1]. Mono will fix these for us, while `dotnet build` will not. * Expanded `jnienv-gen` logic to handle running `jnienv-gen.dll` on `dotnet` in `src\java-interop` as well as `src\Java.Interop`. Note that Mono is still used in the following cases: 1. `make prepare-core` uses Mono/MSBuild to build `BootstrapTasks.dll` to, which creates `JdkInfo.props`. 2. `mono jnienv-gen.exe` is used when it is run from a project build targeting `net472`. 3. Mono headers are needed to build `libjava-interop.dylib`. [0]: https://www.nuget.org/packages/Microsoft.NETFramework.ReferenceAssemblies/ [1]: dotnet/msbuild#1024 (comment)
- Loading branch information
Showing
32 changed files
with
195 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildThisFileDirectory)build-tools\scripts\PrepareWindows.targets" Condition=" '$(OS)' == 'Windows_NT' " /> | ||
<Import Project="$(MSBuildThisFileDirectory)build-tools\scripts\Prepare.targets" /> | ||
<Import Project="$(MSBuildThisFileDirectory)build-tools\scripts\RunNUnitTests.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
parameters: | ||
condition: succeeded() | ||
|
||
steps: | ||
- task: DotNetCoreCLI@2 | ||
displayName: Prepare Solution | ||
inputs: | ||
projects: Java.Interop.sln | ||
arguments: '-c $(Build.Configuration) -target:Prepare' | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: Build Solution | ||
inputs: | ||
projects: Java.Interop.sln | ||
arguments: '-c $(Build.Configuration) -m:1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
parameters: | ||
condition: succeeded() | ||
|
||
steps: | ||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: generator' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/generator-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: JavaCallableWrappers' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.JavaCallableWrappers-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: logcat-parse' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/logcat-parse-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: ApiXmlAdjuster' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/Xamarin.Android.Tools.ApiXmlAdjuster-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: Bytecode' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/Xamarin.Android.Tools.Bytecode-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: Java.Interop.Tools.Generator' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.Generator-Tests.dll | ||
continueOnError: true | ||
|
||
- task: DotNetCoreCLI@2 | ||
displayName: 'Tests: Java.Interop.Tools.JavaSource' | ||
inputs: | ||
command: test | ||
arguments: bin/Test$(Build.Configuration)/Java.Interop.Tools.JavaSource-Tests.dll | ||
continueOnError: true | ||
|
||
# Running native Java.Interop tests are not yet supported on .NET Core | ||
#- task: DotNetCoreCLI@2 | ||
# displayName: 'Tests: Java.Interop' | ||
# inputs: | ||
# command: test | ||
# arguments: bin/Test$(Build.Configuration)/Java.Interop-Tests.dll | ||
# continueOnError: true | ||
|
||
#- task: DotNetCoreCLI@2 | ||
# displayName: 'Tests: Java.Interop.Dynamic' | ||
# inputs: | ||
# command: test | ||
# arguments: bin/Test$(Build.Configuration)/Java.Interop.Dynamic-Tests.dll | ||
# continueOnError: true | ||
|
||
#- task: DotNetCoreCLI@2 | ||
# displayName: 'Tests: Java.Interop.Export' | ||
# inputs: | ||
# command: test | ||
# arguments: bin/Test$(Build.Configuration)/Java.Interop.Export-Tests.dll | ||
# continueOnError: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
parameters: | ||
condition: succeeded() | ||
|
||
steps: | ||
- powershell: | | ||
Write-Host "Current job status is: $env:AGENT_JOBSTATUS" | ||
if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") { | ||
Write-Host "##vso[task.complete result=Failed;]DONE" | ||
} | ||
displayName: fail if any issues occurred |
14 changes: 14 additions & 0 deletions
14
build-tools/automation/templates/install-dependencies.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
parameters: | ||
condition: succeeded() | ||
|
||
steps: | ||
- task: UseDotNet@2 | ||
displayName: Use .NET Core $(DotNetCoreVersion) | ||
inputs: | ||
version: $(DotNetCoreVersion) | ||
|
||
- script: | | ||
dotnet tool install --global boots | ||
boots --stable Mono | ||
displayName: Install Mono-Stable | ||
condition: and(succeeded(), eq(variables['agent.os'], 'Darwin')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.