我想使用构建后事件自动创建 nuget 包,然后将其复制到我们网络上的共享文件夹,如下所示(版本号 1.0.0.0. 在 MyLib.nuspec 文件中指定):
nuget.exe pack "$(SolutionDir)MyLib.nuspec"
xcopy /Y "$(TargetDir)MyLib.1.0.0.0.nupkg" \\folder\subfolder\NuGetPackages
这可行,但现在我想更新此脚本,以便它也包含程序集版本,但我无法在构建后事件中获取程序集版本。我需要这样的东西:
nuget.exe pack -Version $(AssemblyVersion) "$(SolutionDir)MyLib.nuspec"
xcopy /Y "$(TargetDir)MyLib." + $(AssemblyVersion) + ".nupkg" \\folder\subfolder\NuGetPackages
但是 $(AssemblyVersion) 变量不存在...有什么想法吗?
这个帖子构建脚本对我有用。它在每个版本上打包并发布我的开发版本。很简单。
del $(ProjectDir)bin\Debug\*.nupkg
"$(ProjectDir)NuGet.exe" pack "$(ProjectDir)MyProject.csproj"
forfiles /P $(ProjectDir)bin\Debug\ /m *.nupkg /c "cmd /c "$(ProjectDir)NuGet.exe" push @FILE -Source \\SHARE\NuGet"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)