-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't generate nuget package from .NET 6 MacOS bindings project #12631
Comments
I'm not quite sure if this is a bug or if we just have to figure out how to to do (and then document it), but I'm keeping it open so that we can investigate. |
I've got a temporary workaround. It is the following: <!--Temporary workaround for https://github.com/xamarin/xamarin-macios/issues/12631-->
<PropertyGroup Condition=" '$(MakingNugetPackage)' == 'true' ">
<IsBindingProject></IsBindingProject>
</PropertyGroup>
<ItemGroup Condition=" '$(MakingNugetPackage)' == 'true' ">
<None Remove="@(None)" />
<Folder Remove="@(Folder)" />
<Compile Remove="@(Compile)" />
<ObjcBindingApiDefinition Remove="@(ObjcBindingApiDefinition)" />
<ObjcBindingCoreSource Remove="@(ObjcBindingCoreSource)" />
<NativeReference Remove="@(NativeReference)" />
</ItemGroup> And then to make a nupkg (and a snupkg), you build with the following script: build_macos_native.sh.zip. The script essentially builds a fake version of the library and then puts the real dll, xml and pdb into the nupkg and snupkg. If you were to use it, you'd obviously need to update the paths and filenames in the script though (and possibly other things). I've tested it and it seems to work properly when referenced with Aside: Interestingly |
Possible fix: I noticed that novotnyllc/MSBuildSdkExtras#176 is almost exactly the same thing as the error I'm getting (except for file names and line numbers), so perhaps whatever fixed it can pretty much be copied and pasted here (seems like a simple fix there). |
Add support for 'dotnet pack', by: 1. Add a workaround for the fact that as soon as a project has a 'NativeReference' item, .NET's MSBuild logic wants to include a 'Native.$(AssemblyName).manifest' file in the NuGet. This obviously breaks, because we don't create such a file, so we work around it by removing the file in question from the corresponding item groups. 2. Add any binding resource packages to the NuGet. 3. Add tests. Fixes dotnet#12631.
Add support for 'dotnet pack', by: 1. Add a workaround for the fact that as soon as a project has a 'NativeReference' item, .NET's MSBuild logic wants to include a 'Native.$(AssemblyName).manifest' file in the NuGet. This obviously breaks, because we don't create such a file, so we work around it by removing the file in question from the corresponding item groups. 2. Add any binding resource packages to the NuGet. 3. Add tests. Fixes #12631.
Steps to Reproduce
dotnet build --configuration Release -p:GeneratePackageOnBuild=true -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:DebugSymbols=true -p:DebugType=portable
to generate a nuget packageExpected Behavior
The project builds successfully and generates a nuget package.
Actual Behavior
The build fails with the following error:
Environment
Build Logs
msbuild.log.zip
Example Project (If Possible)
TestBindingsProject2.zip
Note, before building this project, you need to first extract the zip at TestBindingsProject/Natives/MetalANGLE.framework.mac.zip first using Archive Utility (other unarchivers may also work) - it should create a folder called MetalANGLE.framework in the Natives folder (same structure as the framework for the project in #12630).
The text was updated successfully, but these errors were encountered: