Skip to content

[One .NET] improve default MSBuild item groups#5349

Merged
jonpryor merged 1 commit intodotnet:masterfrom
jonathanpeppers:dotnet-autoimport-bindings
Dec 3, 2020
Merged

[One .NET] improve default MSBuild item groups#5349
jonpryor merged 1 commit intodotnet:masterfrom
jonathanpeppers:dotnet-autoimport-bindings

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers commented Dec 1, 2020

When implementing #5348, I noticed that we could add a wildcard to
make Java bindings simpler:

<TransformFile Include="Transforms\**\*.xml" />

This way you can just put .xml files in the Transforms folder so
they will be picked up automatically.

We also need to include some additional wildcards:

<AndroidLibrary       Include="**\*.jar" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<AndroidLibrary       Include="**\*.aar" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<AndroidNativeLibrary Include="**\*.so"  Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />

To make sure we exclude folders like bin and obj, we can rely on
$(DefaultItemExcludes) and $(DefaultExcludesInProjectFolder) as
the dotnet/sdk does:

https://github.com/dotnet/sdk/blob/3e9e1d1e3082cab14593b54562c956b155881658/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.props#L37

I updated a test that uses a Metadata.xml, and it now relies on the
new defaults.

Comment thread src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/Sdk/AutoImport.props Outdated
When implementing dotnet#5348, I noticed that we could add a wildcard to
make Java bindings simpler:

    <TransformFile Include="Transforms\**\*.xml" />

This way you can just put `.xml` files in the `Transforms` folder so
they will be picked up automatically.

We also need to include some additional wildcards:

    <AndroidLibrary       Include="**\*.jar" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
    <AndroidLibrary       Include="**\*.aar" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
    <AndroidNativeLibrary Include="**\*.so"  Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />

To make sure we exclude folders like `bin` and `obj`, we can rely on
`$(DefaultItemExcludes)` and `$(DefaultExcludesInProjectFolder)` as
the dotnet/sdk does:

https://github.com/dotnet/sdk/blob/3e9e1d1e3082cab14593b54562c956b155881658/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.props#L37

I updated a test that uses a `Metadata.xml`, and it now relies on the
new defaults.
@jonathanpeppers jonathanpeppers force-pushed the dotnet-autoimport-bindings branch from fe0afef to 23fee30 Compare December 2, 2020 20:25
@jonathanpeppers jonathanpeppers changed the title [One .NET] setup default MSBuild items for bindings [One .NET] improve default MSBuild item groups Dec 2, 2020
@jonathanpeppers jonathanpeppers marked this pull request as ready for review December 3, 2020 19:44
@jonpryor jonpryor merged commit 8cc3e4f into dotnet:master Dec 3, 2020
@jonathanpeppers jonathanpeppers deleted the dotnet-autoimport-bindings branch December 3, 2020 22:06
@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.

4 participants