Skip to content

Conversation

@jonathanpeppers
Copy link
Member

The CheckMetadataSkipItemsAreProcessedCorrectly test was failing
under a dotnet context due to item metadata missing, such as:

<AndroidSkipAddToPackage>True</AndroidSkipAddToPackage>
<AndroidSkipJavaStubGeneration>True</AndroidSkipJavaStubGeneration>
<AndroidSkipResourceExtraction>True</AndroidSkipResourceExtraction>

These metadata support AndroidX.Migration, and they are completely
missing from the item groups generated in
Microsoft.Android.Sdk.AssemblyResolution.targets.

After the <ProcessAssemblies/> MSBuild task is called, we should
call <AppendCustomMetadataToItemGroup/> to populate the missing
metadata.

The CheckMetadataSkipItemsAreProcessedCorrectly test now passes.

@jonathanpeppers jonathanpeppers marked this pull request as ready for review July 23, 2020 18:48
Copy link
Contributor

@dellis1972 dellis1972 left a comment

Choose a reason for hiding this comment

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

Should these metadata items also be on _ShrunkAssemblies Items as well? Under normal .net these items end up on @(_ReferencePath) and @(_ReferenceDependencyPaths) which will then cascade down all the item groups that are used.

I'm curious why _AddAndroidCustomMetaData is not working as intended in this case? It appears in the BuildOrder.targets, but does not seem to work?

@jonathanpeppers
Copy link
Member Author

Should these metadata items also be on _ShrunkAssemblies Items as well?

Yeah, I should add this.

I'm curious why _AddAndroidCustomMetaData is not working as intended in this case? It appears in the BuildOrder.targets, but does not seem to work?

_AddAndroidCustomMetaData still works "before the build", like for _ResolveLibraryProjectImports.

After the build in "legacy" Xamarin.Android, @(_ReferencePath) is passed through to <ResolveAssemblies/>:

https://github.com/xamarin/xamarin-android/blob/946f269e656fb42fba98b2e3490737bef77e682b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets#L259-L273

But in the new world, we use the @(ResolvedFileToPublish) item group coming from the dotnet/sdk. So we are basically starting over with any metadata we need.

But the bright side is, we don't call <ResolveAssemblies/> anymore!

The `CheckMetadataSkipItemsAreProcessedCorrectly` test was failing
under a `dotnet` context due to item metadata missing, such as:

    <AndroidSkipAddToPackage>True</AndroidSkipAddToPackage>
    <AndroidSkipJavaStubGeneration>True</AndroidSkipJavaStubGeneration>
    <AndroidSkipResourceExtraction>True</AndroidSkipResourceExtraction>

These metadata support AndroidX.Migration, and they are completely
missing from the item groups generated in
`Microsoft.Android.Sdk.AssemblyResolution.targets`.

After the `<ProcessAssemblies/>` MSBuild task is called, we should
call `<AppendCustomMetadataToItemGroup/>` to populate the missing
metadata.

The `CheckMetadataSkipItemsAreProcessedCorrectly` test now passes.
@jonathanpeppers jonathanpeppers merged commit eb6ea0b into dotnet:master Jul 24, 2020
@jonathanpeppers jonathanpeppers deleted the dotnet-androidskip branch July 24, 2020 19:09
@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.

3 participants