我正在尝试使用以下 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
});
}
});
但我不断收到同样的错误:
我已经确认生成的*.temp.nuspec
文件确实包含正确的文件,并且这些文件存在于指定的位置,并且 BasePath 是正确的。
注意:我曾经-Verbosity Diagnostic
生成传递给 NuGet.exe 的实际命令,并且直接运行它也会导致相同的错误消息。因此,我不认为这直接是 Cake 的问题,而是 NuGet.exe 的问题。