-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[One .NET] pack AndroidLibrary .aar files in .nupkg (#7045)
Fixes: #7040 It appears we were missing a test case of: 1. `dotnet new androidlib` 2. Add an `.aar` file 3. `dotnet pack` 4. Assert that `lib\net6.0-android31.0\MyAndroidLibrary.aar` exists in the `.nupkg` output We instead end up with "weird" output in the `.nupkg` like: lib\net6.0-android31.0\MyDotNetAssembly.dll lib\net6.0-android31.0\MyDotNetAssembly.xml lib\net6.0-android31.0\MyDotNetAssembly.aar content\MyAndroidLibrary.aar contentFiles\any\net6.0-android31.0\MyAndroidLibrary.aar `MyDotNetAssembly.aar` would contain any `.jar` files or `AndroidResource` files packed inside. However, *other* `.aar` files are supposed to sit next to `MyDotNetAssembly.dll`. It was surprisingly difficult to work alongside NuGet's MSBuild targets to get this to work. 1. In the `_CategorizeAndroidLibraries` MSBuild target, mark `TfmSpecificPackageFile="%(Pack)"` to be used in our `_IncludeAarInNuGetPackage` MSBuild target. 2. Add these files to `@(TfmSpecificPackageFileWithRecursiveDir)` and set `%(NuGetRecursiveDir)` to empty. Otherwise, these items can have `%(RecursiveDir)` set to some path, and this causes sub-directories in the `.nupkg` output. I updated several tests for this case. I also updated usage of `XASdkProject.OtherBuildItems` to use `Sources` instead. `OtherBuildItems` adds the files to the `.csproj`, and we should be testing our wildcards in `AutoImport.props`. Previously, some of these items were being added twice in these tests.
- Loading branch information
1 parent
52b30e3
commit 868ef05
Showing
3 changed files
with
66 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters