Skip to content

Commit

Permalink
Merge pull request #4608 from bdukes/snupkg
Browse files Browse the repository at this point in the history
Produce snupkg format for NuGet
  • Loading branch information
mitchelsellers authored Apr 14, 2021
2 parents 0b9e026 + f8ed3ac commit 2e68b5d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Build/Tasks/CreateNugetPackages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace DotNetNuke.Build.Tasks
using Cake.Common.IO;
using Cake.Common.Tools.NuGet;
using Cake.Common.Tools.NuGet.Pack;
using Cake.Core;
using Cake.Frosting;

using DotNetNuke.Build;

/// <summary>A cake task to create the platform's NuGet packages.</summary>
Expand All @@ -24,6 +24,7 @@ public override void Run(Context context)
{
// look for solutions and start building them
var nuspecFiles = context.GetFiles("./Build/Tools/NuGet/*.nuspec");
var noSymbolsNuspecFiles = context.GetFiles("./Build/Tools/NuGet/DotNetNuke.WebApi.nuspec");

context.Information("Found {0} nuspec files.", nuspecFiles.Count);

Expand All @@ -35,15 +36,22 @@ public override void Run(Context context)
IncludeReferencedProjects = true,
Symbols = true,
Properties = new Dictionary<string, string> { { "Configuration", "Release" } },
ArgumentCustomization = args => args.Append("-SymbolPackageFormat snupkg"),
};

// loop through each nuspec file and create the package
nuspecFiles -= noSymbolsNuspecFiles;
foreach (var spec in nuspecFiles)
{
var specPath = spec.ToString();
context.Information("Starting to pack: {0}", spec);
context.NuGetPack(spec.FullPath, nuGetPackSettings);
}

context.Information("Starting to pack: {0}", specPath);
context.NuGetPack(specPath, nuGetPackSettings);
nuGetPackSettings.Symbols = false;
nuGetPackSettings.ArgumentCustomization = null;
foreach (var spec in noSymbolsNuspecFiles)
{
context.Information("Starting to pack: {0}", spec);
context.NuGetPack(spec.FullPath, nuGetPackSettings);
}
}
}
Expand Down

0 comments on commit 2e68b5d

Please sign in to comment.