Skip to content

Commit 755fe9b

Browse files
[build] target net6.0 instead of netcoreapp3.1
Context: dotnet/android#5891 Context: dotnet/android@e59f649 xamarin-android should imminently be building libraries targeting `net6.0` instead of `netcoreapp3.1`. We should be able to do this now, because Mono 6.12.0.137 supports building both .NET 5.0 and .NET 6.0.
1 parent df4c5e7 commit 755fe9b

File tree

18 files changed

+36
-28
lines changed

18 files changed

+36
-28
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<AppendTargetFrameworkToOutputPath Condition=" '$(AppendTargetFrameworkToOutputPath)' == '' ">False</AppendTargetFrameworkToOutputPath>
2828
<BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">obj\</BaseIntermediateOutputPath>
2929
</PropertyGroup>
30-
<PropertyGroup Condition=" '$(TargetFramework)' != '' And $(TargetFramework.StartsWith ('netcoreapp')) ">
30+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
3131
<JIBuildingForNetCoreApp>True</JIBuildingForNetCoreApp>
3232
</PropertyGroup>
3333
<PropertyGroup Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">

build-tools/automation/azure-pipelines.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ variables:
1919
RunningOnCI: true
2020
Build.Configuration: Release
2121
MaxJdkVersion: 8
22-
DotNetCoreVersion: 5.0.103
22+
DotNetCoreVersion: 6.0.x
2323
HostedMacImage: macOS-10.15
2424
HostedWinVS2019: Hosted Windows 2019 with VS2019
25-
NetCoreTargetFrameworkPathSuffix: -netcoreapp3.1
25+
NetCoreTargetFrameworkPathSuffix: -net6.0
2626
VSInstallRoot: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
2727

2828
jobs:
@@ -38,15 +38,13 @@ jobs:
3838

3939
- template: templates\install-dependencies.yaml
4040

41-
- task: NuGetToolInstaller@0
41+
- task: MSBuild@1
42+
displayName: MSBuild Java.Interop.sln /t:Restore
4243
inputs:
43-
versionSpec: 5.x
44+
solution: Java.Interop.sln
45+
configuration: $(Build.Configuration)
46+
msbuildArguments: /t:Restore /p:RestoreConfigFile=$(System.DefaultWorkingDirectory)\external\xamarin-android-tools\NuGet.config
4447

45-
- task: NuGetCommand@2
46-
inputs:
47-
command: custom
48-
arguments: restore external\xamarin-android-tools\Xamarin.Android.Tools.sln -ConfigFile external\xamarin-android-tools\NuGet.config
49-
5048
- task: MSBuild@1
5149
displayName: MSBuild Java.Interop.sln /t:Prepare
5250
inputs:
@@ -108,7 +106,12 @@ jobs:
108106
submodules: recursive
109107

110108
- template: templates\install-dependencies.yaml
111-
109+
110+
- script: >
111+
dotnet tool install --global boots &&
112+
boots --preview Mono
113+
displayName: Install Mono
114+
112115
- script: make prepare CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion)
113116
displayName: make prepare
114117

build-tools/automation/templates/install-dependencies.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ steps:
66
displayName: Use .NET Core $(DotNetCoreVersion)
77
inputs:
88
version: $(DotNetCoreVersion)
9+
includePreviewVersions: true

build-tools/jnienv-gen/jnienv-gen.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
5+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
66
<IsPackable>false</IsPackable>
77
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
88
</PropertyGroup>

global.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"sdk": {
3+
"allowPrerelease": true
4+
},
25
"msbuild-sdks": {
36
"Microsoft.Build.NoTargets": "2.0.1"
47
}

src/Java.Interop.Export/Java.Interop.Export.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
55
<LangVersion>8.0</LangVersion>
66
<ProjectGuid>{B501D075-6183-4E1D-92C9-F7B5002475B1}</ProjectGuid>
77
<SignAssembly>true</SignAssembly>

src/Java.Interop/Java.Interop.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66
<Import Condition="Exists ('$(XAConfigPath)')" Project="$(XAConfigPath)" />
77
<PropertyGroup>
8-
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
8+
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
99
<NoWarn>1591</NoWarn>
1010
<SignAssembly>true</SignAssembly>
1111
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
@@ -56,6 +56,7 @@
5656
<None Include="Documentation\Java.Interop\JniManagedPeerStates.xml" />
5757
<None Include="Documentation\Java.Interop\JniEnvironment.References.xml" />
5858
<ProjectReference Include="..\..\build-tools\jnienv-gen\jnienv-gen.csproj"
59+
SkipGetTargetFrameworkProperties="true"
5960
ReferenceOutputAssembly="false"
6061
/>
6162
</ItemGroup>

src/java-interop/java-interop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.Build.NoTargets">
22
<PropertyGroup>
3-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
44
<OutputPath>$(ToolOutputFullPath)</OutputPath>
55
<JNIEnvGenPath>$(BuildToolOutputFullPath)</JNIEnvGenPath>
66
<OutputName>java-interop</OutputName>

tests/Java.Interop-PerformanceTests/Java.Interop-PerformanceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
</PropertyGroup>

tests/Java.Interop-Tests/Java.Interop-Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
4+
<TargetFrameworks>net472;net6.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
</PropertyGroup>
@@ -10,7 +10,7 @@
1010
<OutputPath>$(TestOutputFullPath)</OutputPath>
1111
</PropertyGroup>
1212

13-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
13+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
1414
<DefineConstants>$(DefineConstants);NO_MARSHAL_MEMBER_BUILDER_SUPPORT;NO_GC_BRIDGE_SUPPORT</DefineConstants>
1515
</PropertyGroup>
1616

@@ -37,7 +37,7 @@
3737
<ProjectReference Include="..\TestJVM\TestJVM.csproj" />
3838
</ItemGroup>
3939

40-
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' ">
40+
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
4141
<ProjectReference Include="..\..\src\Java.Interop.Export\Java.Interop.Export.csproj" />
4242
</ItemGroup>
4343

0 commit comments

Comments
 (0)