-
Notifications
You must be signed in to change notification settings - Fork 30
Move from netcoreapp3.1
to net6.0
#195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c0ff83a
to
16fedbe
Compare
nugetConfigPath: NuGet.config | ||
|
||
- task: MSBuild@1 | ||
- script: dotnet build Xamarin.Android.Tools.sln -bl:$(Build.ArtifactStagingDirectory)/build.binlog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be preferable to use DotNetCoreCLI@2 here, though it shouldn't make much of a difference
- task: DotNetCoreCLI@2
displayName: 'Build solution Xamarin.Android.Tools.sln'
inputs:
projects: Xamarin.Android.Tools.sln
arguments: -bl:$(Build.ArtifactStagingDirectory)/build.binlog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I would also have to put command: build
or command: pack
.
Does it do anything extra that is helpful? Like insert warnings inline in PRs? Something else?
Otherwise a one-line script:
block seems simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command: build
param is used by default, so it doesn't need to be set when building. You would need to set command: pack
for packing though.
I think the only advantage to using the task over a script is that it will probe multiple locations for dotnet
, but since we're using the UseDotNet
task there shouldn't be a difference either way.
There may also be some improvements to the Checks
tab of PRs/commits when things fail like you suggested (for instance some extra logger settings are set), though I am not positive.
@@ -73,15 +59,13 @@ jobs: | |||
Write-Host "##vso[task.setvariable variable=xat.nuget.version]$version" | |||
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) | |||
|
|||
- task: MSBuild@1 | |||
- script: dotnet pack src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj -p:Version=$(xat.nuget.version) -p:PackageOutputPath=$(Build.ArtifactStagingDirectory) -bl:$(Build.ArtifactStagingDirectory)/pack.binlog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use DotNetCoreCLI@2
here instead.
src/Microsoft.Android.Build.BaseTasks/Microsoft.Android.Build.BaseTasks.csproj
Show resolved
Hide resolved
I believe this is a good idea anyway, but this should assist with: dotnet/android#7451 Which is hitting the error: error NU1102: Unable to find package Microsoft.NETCore.App.Host.osx-x64 with version (= 3.1.31) .NET Core 3.1.31 is not released yet and is likely on a private feed. Also pass `6.0.x` to the [`UseDotNet`][0] yaml task. After these changes, the build failed with: error MSB3971: The reference assemblies for ".NETFramework,Version=v6.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK. Mono MSBuild probably can't build .NET 6 projects? So I fixed various things in the build: * Use `dotnet build` instead of MSBuild, remove NuGet commands * No tests were running: ``` [warning] Project file(s) matching the specified pattern were not found. ``` * Fixed the `$(XATBuildingForNetCoreApp)` property * Upload artifacts based on the pool name: `$(vmImage)` * Use `$(PackageOutputPath)` instead of `$(OutputPath)` * `PublishBuildArtifacts` is deprecated use `PublishPipelineArtifact` * Save `.binlog` files as artifacts [0]: https://learn.microsoft.com/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer
16fedbe
to
09ab950
Compare
@tondat is there anything we need to consider on the IDE side of things for this? |
I think the IDEs would all use the <TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to verify the build of androidtools repo with the bump of this change
I will test the latest in androidtools & xamarin-android shortly. |
FYI @tondat seemed to work fine: https://github.com/xamarin/androidtools/pull/362 |
Changes: dotnet/android-tools@0be567a...9f56dec * dotnet/android-tools@9f56dec: Move from `netcoreapp3.1` to `net6.0` (dotnet/android-tools#195) Move from `netcoreapp3.1` to `net6.0`
Changes: dotnet/android-tools@29f11f2...47f95ab * dotnet/android-tools@47f95ab: Fix CS0121 ambiguity errors. (dotnet/android-tools#200) * dotnet/android-tools@76c076f: Add support for Project Specific RegisterTaskObject. (dotnet/android-tools#199) * dotnet/android-tools@9f02d77: Add reference to System.Security.Cryptography.Xml (dotnet/android-tools#198) * dotnet/android-tools@fa3711b: [build] Update NuGet package versions (dotnet/android-tools#196) * dotnet/android-tools@59cac90: Enable CodeQL (dotnet/android-tools#197) * dotnet/android-tools@9f56dec: Move from `netcoreapp3.1` to `net6.0` (dotnet/android-tools#195) * dotnet/android-tools@0be567a: Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal (dotnet/android-tools#194)
Changes: dotnet/android-tools@29f11f2...099fd95 * dotnet/android-tools@099fd95: Add *Task.ProjectSpecificTaskObjectKey() for RegisterTaskObject() use (dotnet/android-tools#202) * dotnet/android-tools@ac9ea09: Revert IBuildEngine.ProjectFileOfTaskNode use. (dotnet/android-tools#201) * dotnet/android-tools@47f95ab: Fix CS0121 ambiguity errors. (dotnet/android-tools#200) * dotnet/android-tools@76c076f: Add support for Project Specific RegisterTaskObject. (dotnet/android-tools#199) * dotnet/android-tools@9f02d77: Add reference to System.Security.Cryptography.Xml (dotnet/android-tools#198) * dotnet/android-tools@fa3711b: [build] Update NuGet package versions (dotnet/android-tools#196) * dotnet/android-tools@59cac90: Enable CodeQL (dotnet/android-tools#197) * dotnet/android-tools@9f56dec: Move from `netcoreapp3.1` to `net6.0` (dotnet/android-tools#195) * dotnet/android-tools@0be567a: Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal (dotnet/android-tools#194)
Changes: dotnet/android-tools@29f11f2...099fd95 * dotnet/android-tools@099fd95: Add *Task.ProjectSpecificTaskObjectKey() for RegisterTaskObject() use (dotnet/android-tools#202) * dotnet/android-tools@ac9ea09: Revert IBuildEngine.ProjectFileOfTaskNode use. (dotnet/android-tools#201) * dotnet/android-tools@47f95ab: Fix CS0121 ambiguity errors. (dotnet/android-tools#200) * dotnet/android-tools@76c076f: Add support for Project Specific RegisterTaskObject. (dotnet/android-tools#199) * dotnet/android-tools@9f02d77: Add reference to System.Security.Cryptography.Xml (dotnet/android-tools#198) * dotnet/android-tools@fa3711b: [build] Update NuGet package versions (dotnet/android-tools#196) * dotnet/android-tools@59cac90: Enable CodeQL (dotnet/android-tools#197) * dotnet/android-tools@9f56dec: Move from `netcoreapp3.1` to `net6.0` (dotnet/android-tools#195) * dotnet/android-tools@0be567a: Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal (dotnet/android-tools#194)
I believe this is a good idea anyway, but this should assist with:
dotnet/android#7451
Which is hitting the error:
.NET Core 3.1.31 is not released yet and is likely on a private feed.
Also pass
6.0.x
to theUseDotNet
yaml task.After these changes, the build failed with:
Mono MSBuild probably can't build .NET 6 projects?
So I fixed various things in the build:
dotnet build
instead of MSBuild, remove NuGet commands$(XATBuildingForNetCoreApp)
property$(vmImage)
$(PackageOutputPath)
instead of$(OutputPath)
PublishBuildArtifacts
is deprecated usePublishPipelineArtifact
.binlog
files as artifacts