Skip to content

Commit 335d237

Browse files
committed
Fixed build issue by adding version retrieval for package target.
1 parent a2f6146 commit 335d237

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

build/build.cake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ void VerifyHeaders(bool Replace)
9494
}
9595
}
9696

97+
void RetrieveVersion()
98+
{
99+
Information("\nRetrieving version...");
100+
var results = StartPowershellFile(versionClient);
101+
Version = results[1].Properties["NuGetPackageVersion"].Value.ToString();
102+
Information("\nBuild Version: " + Version);
103+
}
104+
97105
//////////////////////////////////////////////////////////////////////
98106
// DEFAULT TASK
99107
//////////////////////////////////////////////////////////////////////
@@ -137,10 +145,7 @@ Task("Version")
137145

138146
NuGetInstall(new []{"nerdbank.gitversioning"}, installSettings);
139147

140-
Information("\nRetrieving version...");
141-
var results = StartPowershellFile(versionClient);
142-
Version = results[1].Properties["NuGetPackageVersion"].Value.ToString();
143-
Information("\nBuild Version: " + Version);
148+
RetrieveVersion();
144149
});
145150

146151
Task("BuildProjects")
@@ -240,12 +245,14 @@ Task("Package")
240245
buildSettings.SetPlatformTarget(PlatformTarget.x86);
241246
MSBuild(Solution, buildSettings);
242247

248+
RetrieveVersion();
249+
243250
var nuGetPackSettings = new NuGetPackSettings
244251
{
245252
OutputDirectory = nupkgDir,
246253
Version = Version
247254
};
248-
255+
249256
var nuspecs = GetFiles("./*.nuspec");
250257
foreach (var nuspec in nuspecs)
251258
{

0 commit comments

Comments
 (0)