Skip to content

Commit 942f787

Browse files
authored
[CI] Add a .NET Core Windows lane. (#640)
Create a `Windows - .NET Core` lane for building and testing Java.Interop. This builds and runs the same projects and tests as the current Windows build. Also removed some unnecessary `nuget` work in `/t:Prepare` now that we no longer use `packages.config`. The `Mac - .NET Core` lane requires more investigation and changes before it succeeds, and I need to focus on other priorities right now, so we'll just start with Windows.
1 parent 377c4c7 commit 942f787

File tree

2 files changed

+72
-14
lines changed

2 files changed

+72
-14
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ pr:
1010

1111
# Global variables
1212
variables:
13-
DotNetCoreVersion: 3.1.100
13+
DotNetCoreVersion: 3.1.201
1414
HostedMac: Hosted Mac Internal
1515
HostedWinVS2019: Hosted Windows 2019 with VS2019
1616

1717
jobs:
1818
- job: windows_build
19-
displayName: Windows Build and Test
19+
displayName: Windows - .NET Framework
2020
pool: $(HostedWinVS2019)
2121
timeoutInMinutes: 20
2222
workspace:
@@ -68,8 +68,77 @@ jobs:
6868
testResultsFiles: TestResult-*.xml
6969
condition: succeededOrFailed()
7070

71+
- job: windows_dotnet_build
72+
displayName: Windows - .NET Core
73+
pool: $(HostedWinVS2019)
74+
timeoutInMinutes: 20
75+
workspace:
76+
clean: all
77+
steps:
78+
- checkout: self
79+
submodules: recursive
80+
81+
- task: UseDotNet@2
82+
displayName: Use .NET Core $(DotNetCoreVersion)
83+
inputs:
84+
version: $(DotNetCoreVersion)
85+
86+
- task: DotNetCoreCLI@2
87+
displayName: Prepare Solution
88+
inputs:
89+
projects: Java.Interop.sln
90+
arguments: '-c $(Build.Configuration) -target:Prepare'
91+
92+
- task: DotNetCoreCLI@2
93+
displayName: Build Solution
94+
inputs:
95+
projects: Java.Interop.sln
96+
arguments: '-c $(Build.Configuration)'
97+
98+
- task: DotNetCoreCLI@2
99+
displayName: 'Tests: generator'
100+
inputs:
101+
command: test
102+
arguments: bin\Test$(Build.Configuration)\generator-Tests.dll
103+
continueOnError: true
104+
105+
- task: DotNetCoreCLI@2
106+
displayName: 'Tests: JavaCallableWrappers'
107+
inputs:
108+
command: test
109+
arguments: bin\Test$(Build.Configuration)\Java.Interop.Tools.JavaCallableWrappers-Tests.dll
110+
continueOnError: true
111+
112+
- task: DotNetCoreCLI@2
113+
displayName: 'Tests: logcat-parse'
114+
inputs:
115+
command: test
116+
arguments: bin\Test$(Build.Configuration)\logcat-parse-Tests.dll
117+
continueOnError: true
118+
119+
- task: DotNetCoreCLI@2
120+
displayName: 'Tests: ApiXmlAdjuster'
121+
inputs:
122+
command: test
123+
arguments: bin\Test$(Build.Configuration)\Xamarin.Android.Tools.ApiXmlAdjuster-Tests.dll
124+
continueOnError: true
125+
126+
- task: DotNetCoreCLI@2
127+
displayName: 'Tests: Bytecode'
128+
inputs:
129+
command: test
130+
arguments: bin\Test$(Build.Configuration)\Xamarin.Android.Tools.Bytecode-Tests.dll
131+
continueOnError: true
132+
133+
- powershell: |
134+
Write-Host "Current job status is: $env:AGENT_JOBSTATUS"
135+
if ($env:AGENT_JOBSTATUS -eq "SucceededWithIssues") {
136+
Write-Host "##vso[task.complete result=Failed;]DONE"
137+
}
138+
displayName: Fail job if tests failed
139+
71140
- job: mac_build
72-
displayName: Mac Build and Test
141+
displayName: Mac - Mono
73142
pool: $(HostedMac)
74143
timeoutInMinutes: 20
75144
workspace:

build-tools/scripts/PrepareWindows.targets

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,11 @@
22
<Project DefaultTargets="Prepare" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<_TopDir>$(MSBuildThisFileDirectory)..\..</_TopDir>
6-
<_NuGetUri>https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe</_NuGetUri>
7-
<_NuGetPath>$(_TopDir)\.nuget</_NuGetPath>
8-
<_NuGet>$(_NuGetPath)\NuGet.exe</_NuGet>
95
</PropertyGroup>
106
<UsingTask AssemblyFile="$(_TopDir)\bin\Build$(Configuration)\Java.Interop.BootstrapTasks.dll" TaskName="Java.Interop.BootstrapTasks.JdkInfo" />
11-
<UsingTask AssemblyFile="$(_TopDir)\bin\Build$(Configuration)\Java.Interop.BootstrapTasks.dll" TaskName="Java.Interop.BootstrapTasks.DownloadUri" />
127
<Target Name="Prepare">
138
<Exec Command="git submodule update --init --recursive" WorkingDirectory="$(_TopDir)" />
149
<MSBuild Projects="$(MSBuildThisFileDirectory)..\..\build-tools\Java.Interop.BootstrapTasks\Java.Interop.BootstrapTasks.csproj" />
15-
<MakeDir Directories="$(_NuGetPath)" />
16-
<DownloadUri
17-
SourceUris="$(_NuGetUri)"
18-
DestinationFiles="$(_NuGet)"
19-
/>
20-
<Exec Command="$(_NuGet) restore Java.Interop.sln" WorkingDirectory="$(_TopDir)" />
2110
<JdkInfo
2211
JdksRoot="$(ProgramFiles)\Java"
2312
MakeFragmentFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\JdkInfo.mk"

0 commit comments

Comments
 (0)