Skip to content

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Nov 1, 2021

Context: dotnet/maui#3018 (review)

In order for the .NET MAUI workload to properly implement implicit
global usings:

  1. The .NET MAUI workload will add many @(Using) entries that
    conflict with each platform's APIs.

  2. We need something to identify @(Using) is for a specific
    platform, so we can use a new %(Platform) metadata for this.

  3. Late in .NET MAUI's MSBuild targets, we can do:

<ItemGroup Condition=" '$(UseMaui)' == 'true' and ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable') ">
  <Using Remove="@(Using->HasMetadata('Platform'))" />
</ItemGroup>

In .NET 7, we might have a nicer design around this, but for now this
is the plan for .NET 6.

Context: dotnet/maui#3018 (review)

In order for the .NET MAUI workload to properly implement implicit
global usings:

1. The .NET MAUI workload will add many `@(Using)` entries that
   conflict with each platform's APIs.

2. We need *something* to identify `@(Using)` is for a specific
   platform, so we can use a new `%(Platform)` metadata for this.

3. Late in .NET MAUI's MSBuild targets, we can do:

    <ItemGroup Condition=" '$(UseMaui)' == 'true' and ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable') ">
      <Using Remove="@(Using->HasMetadata('Platform'))" />
    </ItemGroup>

In .NET 7, we might have a nicer design around this, but for now this
is the plan for .NET 6.
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
Generator Diff (only version changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 127 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run crashed)
  • link sdk/tvOS - simulator/Debug [dotnet]: Failed

Pipeline on Agent XAMBOT-1104.BigSur'
Merge d9e1963 into 8d39c86

@rolfbjarne
Copy link
Member

Test failures are unrelated

@rolfbjarne rolfbjarne merged commit 7fb9bc9 into dotnet:main Nov 2, 2021
@jonathanpeppers jonathanpeppers deleted the maui-implicit-global-usings branch November 2, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-notes-worthy Ignore for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants