Search code examples
c#xamarin.iosnuget-packagexamarin-binding

How to generate nuget package from Xamarin.iOS binding project?


I have created a Xamarin.iOS binding project by adding UnityFramework.framework as Native References. When I build this binding project it generstes a .dll file. Now I want to generate a Nuget package and for my actual project I need to add this nuget package instead of the DLL. I did read this but not clear how to apply it for my existing binding project. Please help me on how to create a nuget package from my biding project. Thank you very much.


Solution

  • You can do that using a nuspec file like so:

    %NUGET_EXE_PATH% pack YourApplication.nuspec -version 1.0.0.0 -Properties Configuration=Release
    

    The nuspec file looks something like this:

    <?xml version="1.0"?>
    <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
        <metadata>
            <id>YourApplicationName</id>
            <version>1.0.0.0</version>
            <title>Title</title>
            <authors>Author</authors>
            <owners/>
            <licenseUrl>https://yoururl.com</licenseUrl>
            <projectUrl>https://yoururl.com</projectUrl>
            <iconUrl>file://YourProgram_Icon.ico</iconUrl>
            <requireLicenseAcceptance>false</requireLicenseAcceptance>
            <description>Your description</description>
            <releaseNotes/>
            <copyright>Your copyright notice</copyright>
            <tags/>
            <dependencies>
                <dependency id=""/>
            </dependencies>
            <summary/>
        </metadata>
        <files>
            <file src="..\InstallDir\YourApplication.exe" target="YourApplication.exe"/>
            <file src="..\InstallDir\Library1.dll" target="Library1.dll"/>
            <file src="..\InstallDir\library2.dll" target="Library2.dll"/>
        </files>
    </package>