What this repo shows:
- When building an Android NET6 app that uses a Microsoft.NET.Sdk binding lib in terminal, a NuGet package is created.
- Meanwhile, when building an app that uses a Xamarin.Legacy.Sdk binding lib in terminal, no NuGet package is created.
- Note that for both binding libs,
GeneratePackageOnBuildis already set to true.
Projects:
- JavaBinding: a binding library that uses Xamarin.Legacy.Sdk to target NET6 and MonoAndroid11.0.
- UseJavaBinding: a NET6 app that uses JavaBinding.
- NET6JavaBinding: a binding library that uses Microsoft.NET.Sdk to target NET6.
- UseNET6JavaBinding: a NET6 app that uses NET6JavaBinding.
For context, the projects were created using Microsoft.Android.Templates::31.0.101-preview.10.59.
- .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
- Download the repo.
- Open terminal. In
JavaBindingfolder, rundotnet restore. - In
UseJavaBindingfolder, rundotnet build. - Observe that no
.nupkgis created in the build output. Alternatively, check by opening the Finder app and searching for.nupkgin theJavaBindingfolder (if there is one, its "Date Modified" time will not be the current time). - In
UseNET6JavaBindingfolder, rundotnet build. - Observe that a
.nupkgis created in the build output (for example, this line may show up in the build output:Successfully created package '<pathToRepo>/NET6JavaBinding/bin/Debug/NET6JavaBinding.1.0.0.nupkg'.). Alternatively, check by opening the Finder app and searching for.nupkgin theNET6JavaBindingfolder (its "Date Modified" time will be around the current time).