Skip to content

Commit

Permalink
(maint) Re-implement package creating
Browse files Browse the repository at this point in the history
This allows us to use a single nuspec file for creating all
of the supported runtimes
  • Loading branch information
AdmiringWorm committed Feb 10, 2020
1 parent 1e0f6f8 commit 88eb6fb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@ Codecov global executable uploader for PowerShell and .NET applications/librarie
<releaseNotes>All release notes for Codecov can be found on the GitHub site - https://github.com/codecov/codecov-exe/releases/tag/$version$</releaseNotes>
<tags>coverage codecov</tags>
</metadata>
<files>
<!-- Must use '\' on windows platforms when using globbing -->
<!-- May need to change to '/' for unix platforms -->
<file src="..\..\BuildArtifacts\temp\Native\win-x64\*" target="tools" />
</files>
</package>
38 changes: 38 additions & 0 deletions recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 88eb6fb

Please sign in to comment.