@@ -132,33 +132,40 @@ void PackPrepareNative(ICakeContext context, BuildParameters parameters)
132
132
133
133
foreach ( var runtime in runtimes )
134
134
{
135
- var outputPath = parameters . Paths . Directories . Native . Combine ( platform . ToString ( ) . ToLower ( ) ) . Combine ( runtime ) ;
136
-
137
- var settings = new DotNetCorePublishSettings
138
- {
139
- Framework = parameters . CoreFxVersion31 ,
140
- Runtime = runtime ,
141
- NoRestore = false ,
142
- Configuration = parameters . Configuration ,
143
- OutputDirectory = outputPath ,
144
- MSBuildSettings = parameters . MSBuildSettings ,
145
- } ;
146
-
147
- settings . ArgumentCustomization =
148
- arg => arg
149
- . Append ( "/p:PublishSingleFile=true" )
150
- . Append ( "/p:PublishTrimmed=true" )
151
- . Append ( "/p:IncludeSymbolsInSingleFile=true" ) ;
152
-
153
- context . DotNetCorePublish ( "./src/GitVersionExe/GitVersionExe.csproj" , settings ) ;
154
-
155
- context . Information ( "Validating native lib:" ) ;
135
+ var outputPath = PackPrepareNative ( context , parameters , runtime ) ;
156
136
157
137
// testing windows and macos artifacts, ther linux is tested with docker
158
138
if ( platform != PlatformFamily . Linux )
159
139
{
140
+ context . Information ( "Validating native lib:" ) ;
160
141
var nativeExe = outputPath . CombineWithFilePath ( IsRunningOnWindows ( ) ? "gitversion.exe" : "gitversion" ) ;
161
142
ValidateOutput ( nativeExe . FullPath , "/showvariable FullSemver" , parameters . Version . GitVersion . FullSemVer ) ;
162
143
}
163
144
}
164
145
}
146
+
147
+ DirectoryPath PackPrepareNative ( ICakeContext context , BuildParameters parameters , string runtime )
148
+ {
149
+ var platform = Context . Environment . Platform . Family ;
150
+ var outputPath = parameters . Paths . Directories . Native . Combine ( platform . ToString ( ) . ToLower ( ) ) . Combine ( runtime ) ;
151
+
152
+ var settings = new DotNetCorePublishSettings
153
+ {
154
+ Framework = parameters . CoreFxVersion31 ,
155
+ Runtime = runtime ,
156
+ NoRestore = false ,
157
+ Configuration = parameters . Configuration ,
158
+ OutputDirectory = outputPath ,
159
+ MSBuildSettings = parameters . MSBuildSettings ,
160
+ } ;
161
+
162
+ settings . ArgumentCustomization =
163
+ arg => arg
164
+ . Append ( "/p:PublishSingleFile=true" )
165
+ . Append ( "/p:PublishTrimmed=true" )
166
+ . Append ( "/p:IncludeSymbolsInSingleFile=true" ) ;
167
+
168
+ context . DotNetCorePublish ( "./src/GitVersionExe/GitVersionExe.csproj" , settings ) ;
169
+
170
+ return outputPath ;
171
+ }
0 commit comments