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

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 >
    <id>Your ID</id>
    <authors>Whatever name</authors>
    <owners>Wahtever name</owners>
    <description>Blah blah</description>
    <copyright>Copyright 2017</copyright>
      <group targetFramework="portable-net45+win+wpa81+wp80">
        <!-- Your nuget packages dependencies -->
      <group targetFramework="MonoAndroid10">
        <!-- Your nuget packages dependencies -->
      <group targetFramework="Xamarin.iOS10">
        <!-- Your nuget packages dependencies -->
      <group targetFramework="uap">
        <!-- Your nuget packages dependencies -->
     <file src="..\YourProjectName\Plugin.YourProjectName\bin\Release\Plugin.YourProjectName.*" target="lib\portable-net45+win+wpa81+wp80" />

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

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

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

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
Вопросы из категории :