I am trying to use the following Cake script:
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
});
}
});
But I keep getting the same error:
I have confirmed that the generated *.temp.nuspec
file does indeed contain the correct files, and that the files exist within the specified location, and that the BasePath is correct.
NOTE: I have used -Verbosity Diagnostic
to generate the actual command that is being passed to NuGet.exe, and running that directly also results in the same error message. As a result, I don't think that this is a problem directly with Cake, but rather with NuGet.exe.
nuget update -self
to have latest version installed. – Triaxialunfortunately, the way the application is written, will require substantial re-work to determine if something was included as a result of being hardcoded or as a result of wildcard. It's especially more difficult with dotnet.exe pack / msbuild /t:pack where msbuild resolves all the wildcards and passes NuGet a full list of files.
– Triceratops