Skip to content

Conversation

@pjcollins
Copy link
Member

@pjcollins pjcollins commented May 15, 2020

The latest .NET 5 previews now have support for a $(TargetFramework) of
net5.0, which allows us to replace our usage of netcoreapp5.0 with
net5.0.

The .NET 5 version of _ResolveSdks has also been updated to avoid
usage of the projects $(TargetFramework) value when setting the path
to Mono.Android.dll. This fixes an issue that was occurring when
using the latest .NET 5 nightly preview, which was the result of Android
projects using targeting packs with different $(TargetFramework) values.

/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: System.ArgumentException: `/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0-preview.6.20264.1/ref/netcoreapp5.0` must be a directory! (Parameter 'frameworkDirectories')
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tools.AndroidVersions..ctor(IEnumerable`1 frameworkDirectories) in /Users/peter/source/pj/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/AndroidVersions.cs:line 30
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.MonoAndroidHelper.RefreshSupportedVersions(String[] referenceAssemblyPaths)
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.ResolveSdks.RunTask()
/Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.AndroidTask.Execute()

@pjcollins pjcollins requested a review from jonathanpeppers May 15, 2020 18:59
The latest .NET 5 previews now have support for a $(TargetFramework) of
`net5.0`, which allows us to replace our usage of `netcoreapp5.0` with
`net5.0`.

The .NET 5 version of `_ResolveSdks` has also been updated to avoid
avoid usage of $(TargetFramework) when setting the path to
`Mono.Android.dll`.  This fixes an issue that was occurring when using
the latest .NET 5 nightly preview, which was the result of Android
projects using targeting packs with different $(TargetFramework) values.

    /Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004: System.ArgumentException: `/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0-preview.6.20264.1/ref/netcoreapp5.0` must be a directory! (Parameter 'frameworkDirectories')
    /Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tools.AndroidVersions..ctor(IEnumerable`1 frameworkDirectories) in /Users/peter/source/pj/xamarin-android/external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/AndroidVersions.cs:line 30
    /Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.MonoAndroidHelper.RefreshSupportedVersions(String[] referenceAssemblyPaths)
    /Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.ResolveSdks.RunTask()
    /Users/peter/.nuget/packages/microsoft.android.sdk/10.0.100-ci.net5-fix-tf.22/tools/Xamarin.Android.Tooling.targets(61,5): error XARSD7004:    at Xamarin.Android.Tasks.AndroidTask.Execute()
@pjcollins pjcollins force-pushed the net5-fix-tf branch 2 times, most recently from da0ae13 to a816e23 Compare May 18, 2020 17:17
Certain tasks require that $(_XATargetFrameworkDirectories) contains
paths to both Mono.Android.dll and mscorlib.dll. In order to ensure that
this property contains all known assembly paths we'll use the
@(ResolvedTargetingPack) ItemGroup. These items contain metadata
definitions for %(TargetFramework) and %(PackagePath), which can be
combined to construct the full assembly path for each pack.
@pjcollins pjcollins marked this pull request as ready for review May 18, 2020 19:04
@jonathanpeppers jonathanpeppers merged commit b7b18bf into dotnet:master May 19, 2020
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 2, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as xamarin-android:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as xamarin-android:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 3, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
jonathanpeppers added a commit to dotnet/maui-samples that referenced this pull request Jun 4, 2020
Fixes: #16

`$(TargetFramework)` should be `net5.0` now.

Android has the following fixes:

* dotnet/android#4663
* dotnet/android#4692

This enables several workarounds to be removed.

Also use the same .NET 5 build as `xamarin-android`:

https://github.com/xamarin/xamarin-android/blob/cde7b79dce48d9f3fdfc396641a01fb27d165042/build-tools/automation/azure-pipelines.yaml#L53

I updated the `README.md` and our Azure DevOps build pipeline.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants