@@ -54,7 +54,9 @@ public class BuildContext : FrostingContext
54
54
public FilePath TemplatesTestsProjectFile { get ; }
55
55
public FilePathCollection AllPackableSrcProjects { get ; }
56
56
57
- public DotNetMSBuildSettings MsBuildSettings { get ; }
57
+ public DotNetMSBuildSettings MsBuildSettingsRestore { get ; }
58
+ public DotNetMSBuildSettings MsBuildSettingsBuild { get ; }
59
+ public DotNetMSBuildSettings MsBuildSettingsPack { get ; }
58
60
59
61
private IAppVeyorProvider AppVeyor => this . BuildSystem ( ) . AppVeyor ;
60
62
public bool IsRunningOnAppVeyor => AppVeyor . IsRunningOnAppVeyor ;
@@ -98,23 +100,31 @@ public BuildContext(ICakeContext context)
98
100
AllPackableSrcProjects = new FilePathCollection ( context . GetFiles ( RootDirectory . FullPath + "/src/**/*.csproj" )
99
101
. Where ( p => ! p . FullPath . Contains ( "Disassembler" ) ) ) ;
100
102
101
- MsBuildSettings = new DotNetMSBuildSettings ( ) ;
103
+ MsBuildSettingsRestore = new DotNetMSBuildSettings ( ) ;
104
+ MsBuildSettingsBuild = new DotNetMSBuildSettings ( ) ;
105
+ MsBuildSettingsPack = new DotNetMSBuildSettings ( ) ;
106
+
102
107
if ( IsCiBuild )
103
108
{
104
- MsBuildSettings . MaxCpuCount = 1 ;
105
- MsBuildSettings . WithProperty ( "UseSharedCompilation" , "false" ) ;
106
109
System . Environment . SetEnvironmentVariable ( "BDN_CI_BUILD" , "true" ) ;
110
+
111
+ MsBuildSettingsBuild . MaxCpuCount = 1 ;
112
+ MsBuildSettingsBuild . WithProperty ( "UseSharedCompilation" , "false" ) ;
107
113
}
108
114
109
115
if ( ! string . IsNullOrEmpty ( TargetVersion ) )
110
- MsBuildSettings . WithProperty ( "Version" , TargetVersion ) ;
116
+ {
117
+ MsBuildSettingsRestore . WithProperty ( "Version" , TargetVersion ) ;
118
+ MsBuildSettingsBuild . WithProperty ( "Version" , TargetVersion ) ;
119
+ MsBuildSettingsPack . WithProperty ( "Version" , TargetVersion ) ;
120
+ }
111
121
112
122
// NativeAOT build requires VS C++ tools to be added to $path via vcvars64.bat
113
123
// but once we do that, dotnet restore fails with:
114
124
// "Please specify a valid solution configuration using the Configuration and Platform properties"
115
125
if ( context . IsRunningOnWindows ( ) )
116
126
{
117
- MsBuildSettings . WithProperty ( "Platform" , "Any CPU" ) ;
127
+ MsBuildSettingsRestore . WithProperty ( "Platform" , "Any CPU" ) ;
118
128
}
119
129
}
120
130
@@ -316,7 +326,7 @@ public override void Run(BuildContext context)
316
326
context . DotNetRestore ( context . SolutionFile . FullPath ,
317
327
new DotNetRestoreSettings
318
328
{
319
- MSBuildSettings = context . MsBuildSettings
329
+ MSBuildSettings = context . MsBuildSettingsRestore
320
330
} ) ;
321
331
}
322
332
}
@@ -333,7 +343,7 @@ public override void Run(BuildContext context)
333
343
Configuration = context . BuildConfiguration ,
334
344
NoRestore = true ,
335
345
DiagnosticOutput = true ,
336
- MSBuildSettings = context . MsBuildSettings ,
346
+ MSBuildSettings = context . MsBuildSettingsBuild ,
337
347
Verbosity = DotNetVerbosity . Minimal
338
348
} ) ;
339
349
}
@@ -414,7 +424,7 @@ public override void Run(BuildContext context)
414
424
Configuration = context . BuildConfiguration ,
415
425
OutputDirectory = context . ArtifactsDirectory . FullPath ,
416
426
ArgumentCustomization = args => args . Append ( "--include-symbols" ) . Append ( "-p:SymbolPackageFormat=snupkg" ) ,
417
- MSBuildSettings = context . MsBuildSettings ,
427
+ MSBuildSettings = context . MsBuildSettingsPack ,
418
428
NoBuild = true ,
419
429
NoRestore = true
420
430
} ;
@@ -426,7 +436,7 @@ public override void Run(BuildContext context)
426
436
{
427
437
Configuration = context . BuildConfiguration ,
428
438
OutputDirectory = context . ArtifactsDirectory . FullPath ,
429
- MSBuildSettings = context . MsBuildSettings
439
+ MSBuildSettings = context . MsBuildSettingsPack
430
440
} ;
431
441
context . DotNetPack ( context . TemplatesTestsProjectFile . FullPath , settingsTemplate ) ;
432
442
}
0 commit comments