Skip to content

Commit 9bfa664

Browse files
committed
Do NuGet restore before build
1 parent 1eb45b6 commit 9bfa664

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

build/Tasks/Package.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ namespace Engage.Dnn.SqlServerTypes.Build.Tasks
22
{
33
using System.Linq;
44

5-
using Cake.Common.Build;
65
using Cake.Common.Diagnostics;
76
using Cake.Common.IO;
87
using Cake.Common.IO.Paths;
98
using Cake.Common.Solution.Project.Properties;
109
using Cake.Common.Tools.MSBuild;
10+
using Cake.Common.Tools.NuGet;
11+
using Cake.Common.Tools.NuGet.Restore;
1112
using Cake.Common.Xml;
1213
using Cake.Core.Diagnostics;
1314
using Cake.Core.IO;
@@ -19,7 +20,10 @@ public override void Run(Context context)
1920
{
2021
var version = ReadVersion(context);
2122
SetAssemblyInfoVersion(context, version);
22-
CleanAndBuild(context);
23+
24+
var sln = context.File("Engage.Dnn.SqlServerTypes.sln");
25+
context.NuGetRestore(sln, new NuGetRestoreSettings { Verbosity = NuGetVerbosity.Quiet });
26+
CleanAndBuild(context, sln);
2327

2428
var dist = context.Directory("dist");
2529
var (pkg, pkgBin) = CreateAndCleanDist(context, dist);
@@ -66,13 +70,13 @@ private static void SetManifestVersions(Context context, FilePath manifest, stri
6670
context.XmlPoke(manifest, "//assembly[name/text()=\"SqlServerSpatial140.dll\"]/version", version);
6771
}
6872

69-
private static void CleanAndBuild(Context context)
73+
private static void CleanAndBuild(Context context, FilePath sln)
7074
{
7175
var settings = new MSBuildSettings { Configuration = "Release", MaxCpuCount = 0, Verbosity = Verbosity.Minimal, }
7276
.WithRestore()
7377
.WithTarget("clean")
7478
.WithTarget("build");
75-
context.MSBuild("Engage.Dnn.SqlServerTypes.sln", settings);
79+
context.MSBuild(sln, settings);
7680
}
7781

7882
private static void SetAssemblyInfoVersion(Context context, string version)

0 commit comments

Comments
 (0)