Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

No NuGet package created for binding lib dependency #31

Open
akwanpdf opened this issue Nov 16, 2021 · 3 comments
Open

No NuGet package created for binding lib dependency #31

akwanpdf opened this issue Nov 16, 2021 · 3 comments

Comments

@akwanpdf
Copy link

Describe the bug
When building an Android NET6 app that uses a Xamarin.Legacy.Sdk binding library in terminal, no NuGet package is created even though GeneratePackageOnBuild is true.

Meanwhile, when building an Android NET6 app that uses a Microsoft.NET.Sdk binding library in terminal, a NuGet package is properly created when GeneratePackageOnBuild is true.

Steps to Reproduce the Problem
I've created a minimal working example of this bug at TestXamarinLegacySdk. Please follow these steps to run the example.

Expected behavior
A NuGet package should be created.

Context:

  • .NET SDK version 6.0.100
  • Visual Studio Community 2022 for Mac Preview, Version 17.0 Preview (17.0 build 4729)
  • macOS Big Sur Version 11.6

Please let me know if this is intentional behaviour, if there is anything wrong with the example, or if there is another method necessary to generate the package. Thank you.

@jonathanpeppers
Copy link
Member

Does this still happen if you're only building net6.0-android as a single $(TargetFramework)? (remove any monoandroid)

One thing you could try as a workaround is to add a target like:

<Target Name="_ForcePack" DependsOnTargets="Pack" AfterTargets="Build" Condition=" '$(TargetFramework)' == '' " />

Basically just forcing this new target to trigger a Pack on the "outer" build that builds all $(TargetFrameworks).

@akwanpdf
Copy link
Author

Thanks for the response!

This issue does not happen when I only build net6.0-android as a single $(TargetFramework). It doesn't occur when I only build monoandroid11.0 as a single $(TargetFramework) either.

For the workaround, unfortunately when building UseJavaBinding, the only value of TargetFramework that ever occurs is net6.0-android so the Pack is never triggered. This "outer" build that builds all $(TargetFrameworks) isn't happening in terminal (although it does occur when building in VS Mac).

@akwanpdf
Copy link
Author

akwanpdf commented Dec 7, 2021

Hi! Any update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants