@@ -24,10 +24,6 @@ properties {
24
24
25
25
task default
26
26
27
- task RestoreNuGetPackages {
28
- exec { nuget.exe restore $sln_file }
29
- }
30
-
31
27
task SetChocolateyPath {
32
28
$script :chocolateyDir = $null
33
29
if ($env: ChocolateyInstall -ne $null ) {
@@ -41,6 +37,13 @@ task SetChocolateyPath {
41
37
Write-Output " Chocolatey installed at $script :chocolateyDir " ;
42
38
}
43
39
40
+ task RestoreNuGetPackages - depends SetChocolateyPath {
41
+ $chocolateyBinDir = Join-Path $script :chocolateyDir - ChildPath " bin" ;
42
+ $NuGetExe = Join-Path $chocolateyBinDir - ChildPath " NuGet.exe" ;
43
+
44
+ exec { & $NuGetExe restore $sln_file }
45
+ }
46
+
44
47
task GitVersion - depends SetChocolateyPath {
45
48
$chocolateyBinDir = Join-Path $script :chocolateyDir - ChildPath " bin" ;
46
49
$gitVersionExe = Join-Path $chocolateyBinDir - ChildPath " GitVersion.exe" ;
@@ -151,7 +154,7 @@ task archive-only {
151
154
152
155
task pack - depends build, pack- only
153
156
154
- task pack- only {
157
+ task pack- only - depends SetChocolateyPath {
155
158
156
159
mkdir $nuget_pack_dir
157
160
cp " $nuspec_filename " " $nuget_pack_dir "
@@ -162,7 +165,10 @@ task pack-only {
162
165
$Spec.package.metadata.version = ([string ]$Spec.package.metadata.version ).Replace(" {Version}" , $script :nugetVersion )
163
166
$Spec.Save (" $nuget_pack_dir \$nuspec_filename " )
164
167
165
- exec { nuget pack " $nuget_pack_dir \$nuspec_filename " }
168
+ $chocolateyBinDir = Join-Path $script :chocolateyDir - ChildPath " bin" ;
169
+ $NuGetExe = Join-Path $chocolateyBinDir - ChildPath " NuGet.exe" ;
170
+
171
+ exec { & $NuGetExe pack " $nuget_pack_dir \$nuspec_filename " }
166
172
}
167
173
168
174
task postbuild - depends pack, archive, coverage- only, coveralls
0 commit comments