Skip to content
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

[ci] Add support to net6.0 for multi-targeting in VS #7261

Merged
merged 3 commits into from
Aug 26, 2022

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Aug 15, 2022

Context: https://github.com/xamarin/yaml-templates/pull/180
Context: https://github.com/xamarin/yaml-templates/pull/195
Context: https://github.com/xamarin/yaml-templates/pull/199

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts. The MSI and
VSMAN files generated for SDK packs have been split out into a new
vsdrop-multitarget-signed artifact, allowing us to include multiple
versions of the SDK packs in VS.

The Microsoft.Android.Sdk pack has been renamed to
Microsoft.Android.Sdk.net6 to match the pack alias that is referenced
in the .NET 7 manifest.

@pjcollins pjcollins force-pushed the multitarget-drops branch 2 times, most recently from e797a57 to b2026e3 Compare August 19, 2022 14:45
@pjcollins pjcollins changed the title WIP - Produce two sets of VS Drops [ci] Add support to net6.0 for multi-targeting in VS Aug 24, 2022
Context: xamarin/yaml-templates#180
Context: xamarin/yaml-templates#195
Context: xamarin/yaml-templates#199

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.

The `Microsoft.Android.Sdk` pack has been renamed to
`Microsoft.Android.Sdk.net6` to match the pack alias that is referenced
in the .NET 7 manifest.
@pjcollins pjcollins marked this pull request as ready for review August 24, 2022 22:05
jonathanpeppers added a commit to xamarin/Xamarin.Legacy.Sdk that referenced this pull request Aug 25, 2022
Context: dotnet/android#7261 (comment)

To make .NET 6 builds work from a .NET 7 SDK, we are changing:

    Microsoft.Android.Sdk

To:

    Microsoft.Android.Sdk.net6
    Microsoft.Android.Sdk.net7

To deal with this in Xamarin.Legacy.Sdk, by default it will check for:

    $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0'))
    $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0'))

To get the old behavior, you can set:

    <UseMicrosoftAndroidSdk>true</UseMicrosoftAndroidSdk>

Or to explicitly select, you can set one of:

    <UseMicrosoftAndroidSdkNet6>true</UseMicrosoftAndroidSdkNet6>
    <UseMicrosoftAndroidSdkNet7>true</UseMicrosoftAndroidSdkNet7>
jonathanpeppers added a commit to xamarin/Xamarin.Legacy.Sdk that referenced this pull request Aug 25, 2022
Context: dotnet/android#7261 (comment)

To make .NET 6 builds work from a .NET 7 SDK, we are changing:

    Microsoft.Android.Sdk

To:

    Microsoft.Android.Sdk.net6
    Microsoft.Android.Sdk.net7

To deal with this in Xamarin.Legacy.Sdk, by default it will check for:

    <!--
      if we are not .NET 7 use .NET 6, so legacy or net6.0 will import
      !$([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0'))
    -->
    <Import Sdk="Microsoft.Android.Sdk.net6" ... />
    <!--
      import .NET 7 if we are .NET 7
      $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0'))
    -->
    <Import Sdk="Microsoft.Android.Sdk.net7" ... />

To get the old behavior, you can set:

    <UseMicrosoftAndroidSdk>true</UseMicrosoftAndroidSdk>

Or to explicitly select, you can set one of:

    <UseMicrosoftAndroidSdkNet6>true</UseMicrosoftAndroidSdkNet6>
    <UseMicrosoftAndroidSdkNet7>true</UseMicrosoftAndroidSdkNet7>

In a future change, we can make .NET 7 the default, but likely only
after it is released GA.
jonathanpeppers added a commit to xamarin/Xamarin.Legacy.Sdk that referenced this pull request Aug 25, 2022
Context: dotnet/android#7261 (comment)

To make .NET 6 builds work from a .NET 7 SDK, we are changing:

    Microsoft.Android.Sdk

To:

    Microsoft.Android.Sdk.net6
    Microsoft.Android.Sdk.net7

To deal with this in Xamarin.Legacy.Sdk, by default it will check for:

    <!--
      if we are not .NET 7 use .NET 6, so legacy or net6.0 will import
      !$([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0'))
    -->
    <Import Sdk="Microsoft.Android.Sdk.net6" ... />
    <!--
      import .NET 7 if we are .NET 7
      $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0'))
    -->
    <Import Sdk="Microsoft.Android.Sdk.net7" ... />

To get the old behavior, you can set:

    <UseMicrosoftAndroidSdk>true</UseMicrosoftAndroidSdk>

Or to explicitly select, you can set one of:

    <UseMicrosoftAndroidSdkNet6>true</UseMicrosoftAndroidSdkNet6>
    <UseMicrosoftAndroidSdkNet7>true</UseMicrosoftAndroidSdkNet7>

In a future change, we can make .NET 7 the default, but likely only
after it is released GA.
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I reran a couple test phases, but we can merge if those look OK after.

@pjcollins pjcollins merged commit d6224ca into release/6.0.4xx Aug 26, 2022
@pjcollins pjcollins deleted the multitarget-drops branch August 26, 2022 14:56
@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.

2 participants