diff --git a/nuspec/nuget/chocolatey-lsp-win64.nuspec b/nuspec/nuget/chocolatey-lsp.nuspec similarity index 83% rename from nuspec/nuget/chocolatey-lsp-win64.nuspec rename to nuspec/nuget/chocolatey-lsp.nuspec index 256fb5b..ef87609 100644 --- a/nuspec/nuget/chocolatey-lsp-win64.nuspec +++ b/nuspec/nuget/chocolatey-lsp.nuspec @@ -18,9 +18,4 @@ Codecov global executable uploader for PowerShell and .NET applications/librarie All release notes for Codecov can be found on the GitHub site - https://github.com/codecov/codecov-exe/releases/tag/$version$ coverage codecov - - - - - \ No newline at end of file diff --git a/recipe.cake b/recipe.cake index 687753f..5a3079d 100644 --- a/recipe.cake +++ b/recipe.cake @@ -61,6 +61,44 @@ Task("DotNetCore-Publish") } }); +((CakeTask)BuildParameters.Tasks.CreateNuGetPackagesTask.Task).Actions.Clear(); + +BuildParameters.Tasks.CreateNuGetPackagesTask.Does(() => +{ + var nuspecFiles = GetFiles(BuildParameters.Paths.Directories.NugetNuspecDirectory + "/**/*.nuspec"); + + EnsureDirectoryExists(BuildParameters.Paths.Directories.NuGetPackages); + + foreach (var nuspecFile in nuspecFiles) + { + foreach (var runtime in NativeRuntimes) + { + var runtimeName = runtime.Value; + var baseDirectory = BuildParameters.Paths.Directories.TempBuild.Combine("Native").Combine(runtimeName); + if (!DirectoryExists(baseDirectory)) + { + Warning("Published directory for " + runtimeName + "Does not exist"); + continue; + } + + NuGetPack(nuspecFile, new NuGetPackSettings + { + Id = nuspecFile.GetFilenameWithoutExtension() + ".Runtime." + runtimeName, + Version = BuildParameters.Version.SemVersion, + BasePath = baseDirectory, + OutputDirectory = BuildParameters.Paths.Directories.NuGetPackages, + Symbols = false, + NoPackageAnalysis = true, + Files = GetFiles(baseDirectory + "/*").Select(f => new NuSpecContent + { + Source = f.FullPath, + Target = "tools/" + runtimeName + f.GetFilename() + }).ToList() + }); + } + } +}); + Build.RunDotNetCore(); \ No newline at end of file