Gar*_*ark 5 c# nuget cakebuild
我正在尝试使用以下Cake脚本:
Task("Create-NuGet-Packages")
.IsDependentOn("Build")
.WithCriteria(() =>DirectoryExists(parameters.Paths.Directories.NugetNuspecDirectory))
.Does(() =>
{
var nuspecFiles = GetFiles(parameters.Paths.Directories.NugetNuspecDirectory + "/**/*.nuspec");
EnsureDirectoryExists(parameters.Paths.Directories.NuGetPackages);
foreach(var nuspecFile in nuspecFiles)
{
// TODO: Addin the release notes
// ReleaseNotes = parameters.ReleaseNotes.Notes.ToArray(),
// Create packages.
NuGetPack(nuspecFile, new NuGetPackSettings {
Version = parameters.Version.SemVersion,
BasePath = parameters.Paths.Directories.PublishedLibraries.Combine(nuspecFile.GetFilenameWithoutExtension().ToString()),
OutputDirectory = parameters.Paths.Directories.NuGetPackages,
Symbols = false,
NoPackageAnalysis = true
});
}
});
Run Code Online (Sandbox Code Playgroud)
但我一直得到同样的错误:
我已确认生成的*.temp.nuspec文件确实包含正确的文件,并且文件存在于指定的位置,并且BasePath是正确的.
注意:我已经习惯-Verbosity Diagnostic生成传递给NuGet.exe的实际命令,并直接运行它也会导致相同的错误消息.因此,我认为这不是直接与Cake有关的问题,而是与NuGet.exe有关.
事实证明,这是我正在使用的目录路径的错误.我试图用.build\_temp\_PublishedLibraries\Cake.Twitter.
更改.build到BuildArtifacts立即作出一切工作:
在进行了一些挖掘之后,这似乎是NuGet的一个已知问题(至少对某些人来说已知):
https://twitter.com/ferventcoder/status/505048107520765952
即任何以a开头的文件或文件夹.都无法被nuget pack识别.
似乎这个问题已在Chocolatey中得到纠正,因此,它可以在那里工作.
注意:我在此处提出了这个问题:https://github.com/NuGet/Home/issues/3308
| 归档时间: |
|
| 查看次数: |
6671 次 |
| 最近记录: |