如何使用NuGet将其他文件添加到包中?
Nuspec
<files>
<file src="https://raw.githubusercontent.com/030/chocolateyautomatic/master/common/Uninstall-ChocolateyZipPackage030.ps1" target="tools" />
</files>
结果
文件不会被添加到工具目录
运行cpack
表示下列内容:
Calling 'C:\ProgramData\Chocolatey\chocolateyinstall\nuget.exe pack -NoPackageAnalysis
Attempting to build package from 'eclipse.nuspec'.
The given path's format is not supported.
尝试2
<files>
<file src="path\to\chocolateyautomatic\common\Uninstall-ChocolateyZipPackage030.ps1" target="tools\Uninstall-ChocolateyZipPackage030.ps1" />
</files>
结果两个
的The given path's format is not supported.
问题已经消失,但Uninstall-ChocolateyZipPackage030.ps1
文件不被添加到工具目录。
<files>
<file src="..\..\..\common\Uninstall-ChocolateyZipPackage030.ps1" target="tools\Uninstall-ChocolateyZipPackage030.ps1" />
<file src="tools\*" target="tools" />
</files>
将所有文件添加到nupkg
文件。
你可能不想使用一个硬编码的文件路径。您应该使用文件的相对路径。这样,如果您更改存储库的checkout目录,文件包含将仍然有效。 – 2014-12-02 09:57:45
@GaryEwanPark同意但这怎么可能实现?常用文件夹不驻留在eclipse文件夹中,例如工具目录。我正在检查[本文档](http://docs.nuget.org/docs/reference/nuspec-reference) – 030 2014-12-02 10:10:55
我原以为你应该能够做类似于src =“.. \ .. \常见\ ...“,即相对于nuspec文件所在的位置导航文件夹,然后导航到所需的文件夹路径。 – 2014-12-02 10:59:47
是你的 标记 标记?换句话说,整个文件看起来像什么? –
Swoogan
2014-12-01 21:51:52
@Sogogan https://github.com/030/chocolateyautomatic/blob/master/eclipse/eclipse.nuspec – 030 2014-12-01 22:26:47