Skip to content

Commit df3bb73

Browse files
authored
Update the versions used to be .NET 9 and 10 (#1169)
This pull request includes updates to support newer versions of .NET and Android, removes outdated scripts and configurations, and simplifies the build pipeline. The most important changes focus on upgrading target frameworks, cleaning up legacy code, and improving build configurations. Updates to support newer versions of .NET and Android: * `.config/dotnet-tools.json`: Added tools for cake.tool, dotnet-test-slicer, and api-tools with specified versions and commands. * `Directory.Build.props`: Updated default target frameworks to net9.0-android and added configurations for net10.0-android. * `BUILDING.md`: Changed the required .NET SDK version from 8.0 to 9.0. * `.github/copilot-instructions.md`: Updated references to net9.0-android and adjusted API levels in documentation. Cleanup of legacy scripts and configurations: * `build.cake`: Removed unused targets and variables related to dotnet-next and net10 migrations. * `build/cake/dotnet-next.cake`: Deleted the script for testing preview versions of .NET. * `build/cake/nuget-install.cake`: Removed the script for downloading and managing NuGet packages. Simplifications in the build pipeline: * `azure-pipelines-public.yml`: Removed the RunDotnetNextTest parameter and its associated logic. * `azure-pipelines.yml`: Deleted the RunDotnetNextTest parameter and its usage across multiple stages. * These changes collectively streamline the codebase, align the project with newer technologies, and remove outdated dependencies and configurations.
1 parent 8bf0f9e commit df3bb73

File tree

47 files changed

+188
-1577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+188
-1577
lines changed

.config/dotnet-tools.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"cake.tool": {
6+
"version": "5.0.0",
7+
"commands": [
8+
"dotnet-cake"
9+
],
10+
"rollForward": false
11+
},
12+
"dotnet-test-slicer": {
13+
"version": "0.1.0-alpha7",
14+
"commands": [
15+
"dotnet-test-slicer"
16+
],
17+
"rollForward": false
18+
},
19+
"api-tools": {
20+
"version": "1.4.2-preview.2",
21+
"commands": [
22+
"api-tools"
23+
],
24+
"rollForward": false
25+
}
26+
}
27+
}

.github/ISSUE_TEMPLATE/01-use-package.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ body:
1515
options:
1616
- net8.0-android
1717
- net9.0-android
18+
- net10.0-android (Preview)
1819
- Other
1920
validations:
2021
required: true
@@ -23,7 +24,7 @@ body:
2324
attributes:
2425
label: Affected platform version
2526
description: Please provide the version number of the platform you see this issue on.
26-
placeholder: E.g. VS 2022 17.9.0, .NET 8.0.100, etc.
27+
placeholder: E.g. VS 2022 17.14.0, .NET 9.0.100, etc.
2728
validations:
2829
required: true
2930
- type: textarea

.github/ISSUE_TEMPLATE/04-other.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ body:
1414
options:
1515
- net8.0-android
1616
- net9.0-android
17+
- net10.0-android (Preview)
1718
- Other
1819
validations:
1920
required: true
@@ -22,7 +23,7 @@ body:
2223
attributes:
2324
label: Affected platform version
2425
description: Please provide the version number of the platform you see this issue on.
25-
placeholder: E.g. VS 2022 17.9.0, .NET 8.0.100, etc.
26+
placeholder: E.g. VS 2022 17.14.0, .NET 9.0.100, etc.
2627
validations:
2728
required: true
2829
- type: textarea

.github/copilot-instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ For comprehensive guidance on troubleshooting binding issues, see: https://githu
136136
## Target Frameworks
137137

138138
### Current Support
139-
- **Primary**: `net8.0-android` (API 21+)
139+
- **Primary**: `net9.0-android` (API 21+)
140140
- **Migration**: `net10.0-android` (API 35+) - migration capability exists but not currently enabled
141141
- **Legacy**: Xamarin.Android support ended May 1, 2024
142142

@@ -150,12 +150,12 @@ For comprehensive guidance on troubleshooting binding issues, see: https://githu
150150
### NuGet Package Structure
151151
```
152152
lib/
153-
net8.0-android34.0/
153+
net9.0-android35.0/
154154
{assembly}.dll
155155
net10.0-android36.0/
156156
{assembly}.dll
157157
build/
158-
net8.0-android34.0/
158+
net9.0-android35.0/
159159
{package}.targets
160160
net10.0-android36.0/
161161
{package}.targets

BUILDING.md

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

55
Before building the libraries and samples in this repository, you will need to install:
66

7-
* [.NET](https://dotnet.microsoft.com/download) ([.NET SDK 8.0.404](https://github.com/dotnet/core/blob/main/release-notes/8.0/8.0.11/8.0.11.md?WT.mc_id=dotnet-35129-website) is currently required)
7+
* [.NET 9.0](https://dotnet.microsoft.com/download) (.NET SDK 9.0 is currently required)
88

99
* [Cake .NET Tool](http://cakebuild.net):
1010

Directory.Build.props

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
<RepositoryCommit>$(BUILD_SOURCEVERSION)</RepositoryCommit>
77

88
<!-- Default TFM's we build for -->
9-
<_DefaultTargetFrameworks>net8.0-android</_DefaultTargetFrameworks>
10-
<_DefaultNetTargetFrameworks>net8.0</_DefaultNetTargetFrameworks>
9+
<_DefaultNetTargetFramework>net9.0</_DefaultNetTargetFramework>
10+
<!-- base -->
11+
<_DefaultPlatformVersionBase>35</_DefaultPlatformVersionBase>
12+
<_DefaultTargetFrameworkVersionBase>9.0</_DefaultTargetFrameworkVersionBase>
13+
<_DefaultTargetFrameworkBase>net$(_DefaultTargetFrameworkVersionBase)-android$(_DefaultPlatformVersionBase).0</_DefaultTargetFrameworkBase>
14+
<!-- next -->
15+
<_DefaultPlatformVersionNext>36</_DefaultPlatformVersionNext>
16+
<_DefaultTargetFrameworkVersionNext>10.0</_DefaultTargetFrameworkVersionNext>
17+
<_DefaultTargetFrameworkNext>net$(_DefaultTargetFrameworkVersionNext)-android$(_DefaultPlatformVersionNext).0</_DefaultTargetFrameworkNext>
18+
<!-- combined -->
19+
<_DefaultTargetFrameworks>$(_DefaultTargetFrameworkBase);$(_DefaultTargetFrameworkNext)</_DefaultTargetFrameworks>
1120

1221
<CheckEolWorkloads>false</CheckEolWorkloads>
1322

@@ -85,13 +94,16 @@
8594

8695
<!-- Folders that .targets files need to go into -->
8796
<ItemGroup>
88-
<AndroidXNuGetTargetFolders Include="build\net8.0-android34.0" />
89-
<AndroidXNuGetTargetFolders Include="buildTransitive\net8.0-android34.0" />
97+
<AndroidXNuGetTargetFolders Include="build\$(_DefaultTargetFrameworkBase)" />
98+
<AndroidXNuGetTargetFolders Include="buildTransitive\$(_DefaultTargetFrameworkBase)" />
99+
<AndroidXNuGetTargetFolders Include="build\$(_DefaultTargetFrameworkNext)" />
100+
<AndroidXNuGetTargetFolders Include="buildTransitive\$(_DefaultTargetFrameworkNext)" />
90101
</ItemGroup>
91102

92103
<!-- Folders that _._ files need to go into for packages without managed libraries -->
93104
<ItemGroup>
94-
<AndroidXNuGetLibFolders Include="lib\net8.0-android34.0" />
105+
<AndroidXNuGetLibFolders Include="lib\$(_DefaultTargetFrameworkBase)" />
106+
<AndroidXNuGetLibFolders Include="lib\$(_DefaultTargetFrameworkNext)" />
95107
</ItemGroup>
96108

97109
<ItemGroup>

azure-pipelines-public.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ trigger: none
33
pr:
44
- main
55

6-
parameters:
7-
- name: RunDotnetNextTest
8-
displayName: Run on .NET next preview?
9-
type: boolean
10-
default: false
11-
126
variables:
137
- template: build/ci/variables.yml
148

@@ -23,7 +17,6 @@ stages:
2317
name: $(NetCorePublicPoolName)
2418
demands:
2519
- ImageOverride -equals $(WindowsPoolImageNetCorePublic)
26-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
2720
use1ESTemplate: false
2821
installAndroidDependencies: true
2922

@@ -37,7 +30,6 @@ stages:
3730
buildPool:
3831
name: Azure Pipelines
3932
vmImage: macOS-15
40-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
4133
use1ESTemplate: false
4234

4335
- template: build/ci/stage-standard-tests.yml@self
@@ -46,5 +38,4 @@ stages:
4638
name: $(NetCorePublicPoolName)
4739
demands:
4840
- ImageOverride -equals $(WindowsPoolImageNetCorePublic)
49-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
5041
installAndroidDependencies: true

azure-pipelines.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ parameters:
1616
displayName: Run Extended Tests?
1717
type: boolean
1818
default: false
19-
- name: RunDotnetNextTest
20-
displayName: Run on .NET next preview?
21-
type: boolean
22-
default: false
2319

2420
variables:
2521
# Variables used by both AndroidX/GPS go in the template
@@ -61,7 +57,6 @@ extends:
6157
image: $(windowsImage)
6258
os: windows
6359
runAPIScan: true
64-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
6560

6661
- stage: build_mac
6762
displayName: Build - Mac
@@ -77,15 +72,13 @@ extends:
7772
demands:
7873
- macOS.Name -equals Sonoma
7974
- macOS.Architecture -equals x64
80-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
8175

8276
- template: build/ci/stage-standard-tests.yml@self
8377
parameters:
8478
buildPool:
8579
name: $(windowsAgentPoolName)
8680
image: $(windowsImage)
8781
os: windows
88-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
8982

9083
- template: build/ci/stage-extended-tests.yml@self
9184
parameters:
@@ -94,6 +87,5 @@ extends:
9487
name: $(windowsAgentPoolName)
9588
image: $(windowsImage)
9689
os: windows
97-
runDotnetNextTest: ${{ parameters.RunDotnetNextTest }}
9890

9991
- template: build/ci/stage-sign-artifacts.yml@self

build.cake

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,21 @@
77
#addin nuget:?package=SharpZipLib&version=1.4.2
88

99
// Imported scripts
10-
#load "build/cake/nuget-install.cake"
1110
#load "build/cake/setup-environment.cake"
1211
#load "build/cake/update-config.cake"
1312
#load "build/cake/tests.cake"
1413
#load "build/cake/gps-parameters.cake"
15-
#load "build/cake/dotnet-next.cake"
1614
#load "build/cake/binderate.cake"
1715
#load "build/cake/build-and-package.cake"
1816
#load "build/cake/validations.cake"
1917
#load "build/cake/executive-order.cake"
2018
#load "build/cake/clean.cake"
2119
#load "build/cake/performance-timings.cake"
22-
#load "build/cake/build-android-libraries-net10-net8.cake"
23-
24-
// Migrate packages to net10
25-
bool IsMigratingNet10 = false;
2620

2721
using System.Xml.Linq;
2822
using Newtonsoft.Json;
2923
using Newtonsoft.Json.Linq;
3024

31-
3225
// The main configuration points
3326
var TARGET = Argument ("t", Argument ("target", "Default"));
3427
var CONFIGURATION = Argument ("c", Argument ("configuration", "Release"));
@@ -48,13 +41,6 @@ Information ($"BUILD_COMMIT : {BUILD_COMMIT}");
4841
Information ($"BUILD_NUMBER : {BUILD_NUMBER}");
4942
Information ($"BUILD_TIMESTAMP : {BUILD_TIMESTAMP}");
5043

51-
RunTarget("nuget-install");
52-
53-
if (IsMigratingNet10)
54-
{
55-
RunTarget("build-android-libraries-net10-net8");
56-
}
57-
5844
Task ("packages")
5945
.IsDependentOn ("binderate")
6046
.IsDependentOn ("nuget");

build/cake/build-and-package.cake

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,8 @@ Task ("nuget")
1818
"./generated/AndroidX.sln",
1919
new DotNetBuildSettings { MSBuildSettings = settings }
2020
);
21-
22-
RunTarget("nuget-uninstall");
23-
2421
});
2522

26-
Task ("nuget-pack-without-build")
27-
.Does
28-
(
29-
() =>
30-
{
31-
var settings = new DotNetMSBuildSettings ()
32-
.SetConfiguration (CONFIGURATION)
33-
.EnableBinaryLogger ($"./output/nuget-pack-without-build.{CONFIGURATION}.binlog")
34-
.WithProperty ("NoBuild", "true")
35-
.WithProperty ("PackageOutputPath", MakeAbsolute ((DirectoryPath)"./output/").FullPath)
36-
.WithTarget ("Pack");
37-
38-
DotNetBuild
39-
(
40-
"./generated/AndroidX.sln",
41-
new DotNetBuildSettings { MSBuildSettings = settings }
42-
);
43-
}
44-
);
45-
46-
4723
// Builds the .csproj projects
4824
Task ("libs")
4925
.IsDependentOn("metadata-verify")

0 commit comments

Comments
 (0)