Вопрос:

Automatically add all the dll in Xamarin Forms PCL

xamarin.forms nuget

114 просмотра

1 ответ

750 Репутация автора

I am trying to create a Nuget Package - I followed these steps https://developer.xamarin.com/guides/cross-platform/advanced/nuget/

Is there a way to automatically generate this tag with any available command to create a nuspec file

Thank you

Автор: vivianaranha Источник Размещён: 08.11.2017 11:24

Ответы (1)


0 плюса

375 Репутация автора

Решение

There is the command "nuget spec". It just creates empty template.

Your nuspec file could look like this:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>Your ID</id>
    <version>0.0.1</version>
    <authors>Whatever name</authors>
    <owners>Wahtever name</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Blah blah</description>
    <releaseNotes></releaseNotes>
    <copyright>Copyright 2017</copyright>
    <tags></tags>
    <dependencies>
      <group targetFramework="portable-net45+win+wpa81+wp80">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="MonoAndroid10">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="Xamarin.iOS10">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="uap">
        <!-- Your nuget packages dependencies -->
      </group>
    </dependencies>
  </metadata>
    <files>
     <!--Portable-->
     <file src="..\YourProjectName\Plugin.YourProjectName\bin\Release\Plugin.YourProjectName.*" target="lib\portable-net45+win+wpa81+wp80" />

     <!--Xamarin.Android-->
     <file src="..\YourProjectName\Plugin.YourProjectName.Android\bin\Release\Plugin.YourProjectName.*" target="lib\MonoAndroid10" />

     <!--Xamarin.iOS-->
     <file src="..\YourProjectName\Plugin.YourProjectName.iOS\bin\iPhone\Release\Plugin.YourProjectName.*" target="lib\Xamarin.iOS10" />

     <!--UWP-->
     <file src="..\YourProjectName\Plugin.YourProjectName.UWP\bin\Release\Plugin.YourProjectName.*" target="lib\UAP10" />
  </files>
</package>

There is template for Visual Studio 2015 here. As a reference you can follow this project.

In case that you don't need to write any platform specific code for iOS, Android or UWP create in Visual Studio 2017 .NET standard class library targeting framework .NET Standard 1.4.

Open project properties and change target framework. Then in the tab "Package" check "Generate Nuget package on build".

Автор: Jan Nepraš Размещён: 09.11.2017 08:25
Вопросы из категории :
32x32