nuget - 打包仅构建工具的包

标签 nuget

我只用构建工具构建一个包:a .prop和一个 .target文件,以及带有 MSBuild 任务的 dll。我指定将这些文件放入 build <file> 中的文件夹nuspec 文件的部分:

<files>
  <file src="bin\Release\Acme.Build.Foo.dll" target="build" />
  <file src="MSBuild\Acme.Build.Foo.props"   target="build" />
  <file src="MSBuild\Acme.Build.Foo.targets" target="build" />
</files>

nuspec 文件 Acme.Build.Foo.nuspec放在Acme.Build.Foo.csproj旁边.

如果我使用 nuget pack Acme.Build.Foo.csproj , dll 文件也被打包到 lib/包的文件夹,并在将包添加到目标项目时作为引用添加。

如果我使用 nuget pack Acme.Build.Foo.nuspec ,我会失去关键字扩展的细节,如 $id$等等。

我可以兼得最好吗?是否可以(1)防止项目输出进入lib/.../自动或 (2) 如果不是,至少防止该文件被添加为对消费项目的引用?

我正在使用显然是最新的 NuGet 3.2.0.10516。

最佳答案

使用 -tool选项。所以所有其他文件都放在tools文件夹。

nuget pack Acme.Build.Foo.csproj -tool

关于nuget - 打包仅构建工具的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33817702/

相关文章:

jenkins - 与 nuget 的联系或神器?

c# - 如何让 .NET Core 项目将 NuGet 引用复制到构建输出?

powershell - NuGet init.ps1 执行两次

linux - 如何在 Linux 上从命令行安装 NuGet

nuget - 为 Octopus 部署创建 nuget 包

.net - Linux 上的 ildasm 通过 nuget 安装 : ildasm executable not found

nuget - 如何创建本地 nuget 存储库并仅与内部批准的软件包保持同步?

ssl - 让 Nuget 使用 SSL 将客户端证书传递到私有(private) ProGet 服务器

visual-studio-2012 - NuGet: 'StructureMap' 已经有一个为 'System.Collections.Concurrent' 定义的依赖项

asp.net - 无法在 Sitecore 8.1 项目中加载文件或程序集 Microsoft.Extensions.DependencyInjection.Abstractions