@@ -102,6 +102,8 @@ public class BuildParameters
102
102
IsMainRepo = IsOnMainRepo ( context ) ,
103
103
IsMainBranch = IsOnMainBranch ( context ) ,
104
104
IsTagged = IsBuildTagged ( context ) ,
105
+
106
+ MSBuildSettings = GetMsBuildSettings ( context )
105
107
} ;
106
108
}
107
109
@@ -136,20 +138,13 @@ public class BuildParameters
136
138
} ;
137
139
138
140
Credentials = BuildCredentials . GetCredentials ( context ) ;
139
-
140
- MSBuildSettings = GetMsBuildSettings ( context , Version ) ;
141
+ SetMSBuildSettingsVersion ( MSBuildSettings , Version ) ;
141
142
}
142
143
143
- private DotNetCoreMSBuildSettings GetMsBuildSettings ( ICakeContext context , BuildVersion version )
144
+ private static DotNetCoreMSBuildSettings GetMsBuildSettings ( ICakeContext context )
144
145
{
145
- var msBuildSettings = new DotNetCoreMSBuildSettings ( )
146
- . WithProperty ( "Version" , version . SemVersion )
147
- . WithProperty ( "AssemblyVersion" , version . Version )
148
- . WithProperty ( "PackageVersion" , version . NugetVersion )
149
- . WithProperty ( "FileVersion" , version . Version )
150
- . WithProperty ( "NoPackageAnalysis" , "true" ) ;
151
-
152
- if ( ! IsRunningOnWindows )
146
+ var msBuildSettings = new DotNetCoreMSBuildSettings ( ) ;
147
+ if ( ! context . IsRunningOnWindows ( ) )
153
148
{
154
149
var frameworkPathOverride = context . Environment . Runtime . IsCoreClr
155
150
? new [ ] {
@@ -165,11 +160,21 @@ public class BuildParameters
165
160
// Use FrameworkPathOverride when not running on Windows.
166
161
context . Information ( "Build will use FrameworkPathOverride={0} since not building on Windows." , frameworkPathOverride ) ;
167
162
msBuildSettings . WithProperty ( "FrameworkPathOverride" , frameworkPathOverride ) ;
163
+ msBuildSettings . WithProperty ( "POSIX" , "true" ) ;
168
164
}
169
165
170
166
return msBuildSettings ;
171
167
}
172
168
169
+ private void SetMSBuildSettingsVersion ( DotNetCoreMSBuildSettings msBuildSettings , BuildVersion version )
170
+ {
171
+ msBuildSettings . WithProperty ( "Version" , version . SemVersion ) ;
172
+ msBuildSettings . WithProperty ( "AssemblyVersion" , version . Version ) ;
173
+ msBuildSettings . WithProperty ( "PackageVersion" , version . NugetVersion ) ;
174
+ msBuildSettings . WithProperty ( "FileVersion" , version . Version ) ;
175
+ msBuildSettings . WithProperty ( "NoPackageAnalysis" , "true" ) ;
176
+ }
177
+
173
178
private static bool IsOnMainRepo ( ICakeContext context )
174
179
{
175
180
var buildSystem = context . BuildSystem ( ) ;
0 commit comments