@@ -65,22 +65,29 @@ public BuildResult RestoreThenBuild()
65
65
if ( BuildPartition . IsCustomBuildConfiguration )
66
66
return Build ( ) . ToBuildResult ( GenerateResult ) ;
67
67
68
- var restoreResult = Restore ( ) ;
69
- if ( ! restoreResult . IsSuccess )
70
- return BuildResult . Failure ( GenerateResult , restoreResult . AllInformation ) ;
71
-
72
68
// On our CI, Integration tests take too much time, because each benchmark run rebuilds BenchmarkDotNet itself.
73
69
// To reduce the total duration of the CI workflows, we build all the projects without dependencies
74
70
if ( BuildPartition . ForcedNoDependenciesForIntegrationTests )
75
71
{
72
+ var restoreResult = DotNetCliCommandExecutor . Execute ( WithArguments (
73
+ GetRestoreCommand ( GenerateResult . ArtifactsPaths , BuildPartition , $ "{ Arguments } --no-dependencies", "restore-no-deps" , excludeOutput : true ) ) ) ;
74
+ if ( ! restoreResult . IsSuccess )
75
+ return BuildResult . Failure ( GenerateResult , restoreResult . AllInformation ) ;
76
+
76
77
return DotNetCliCommandExecutor . Execute ( WithArguments (
77
78
GetBuildCommand ( GenerateResult . ArtifactsPaths , BuildPartition , $ "{ Arguments } --no-restore --no-dependencies", "build-no-restore-no-deps" , excludeOutput : true ) ) )
78
79
. ToBuildResult ( GenerateResult ) ;
79
80
}
81
+ else
82
+ {
83
+ var restoreResult = Restore ( ) ;
84
+ if ( ! restoreResult . IsSuccess )
85
+ return BuildResult . Failure ( GenerateResult , restoreResult . AllInformation ) ;
80
86
81
- // We no longer retry with --no-dependencies, because it fails with --output set at the same time,
82
- // and the artifactsPaths.BinariesDirectoryPath is set before we try to build, so we cannot overwrite it.
83
- return BuildNoRestore ( ) . ToBuildResult ( GenerateResult ) ;
87
+ // We no longer retry with --no-dependencies, because it fails with --output set at the same time,
88
+ // and the artifactsPaths.BinariesDirectoryPath is set before we try to build, so we cannot overwrite it.
89
+ return BuildNoRestore ( ) . ToBuildResult ( GenerateResult ) ;
90
+ }
84
91
}
85
92
86
93
[ PublicAPI ]
@@ -144,14 +151,15 @@ public DotNetCliCommandResult PublishNoRestore()
144
151
internal static IEnumerable < string > GetAddPackagesCommands ( BuildPartition buildPartition )
145
152
=> GetNuGetAddPackageCommands ( buildPartition . RepresentativeBenchmarkCase , buildPartition . Resolver ) ;
146
153
147
- internal static string GetRestoreCommand ( ArtifactsPaths artifactsPaths , BuildPartition buildPartition , string extraArguments = null , string binLogSuffix = null )
154
+ internal static string GetRestoreCommand ( ArtifactsPaths artifactsPaths , BuildPartition buildPartition , string extraArguments = null , string binLogSuffix = null , bool excludeOutput = false )
148
155
=> new StringBuilder ( )
149
156
. AppendArgument ( "restore" )
150
157
. AppendArgument ( string . IsNullOrEmpty ( artifactsPaths . PackagesDirectoryName ) ? string . Empty : $ "--packages \" { artifactsPaths . PackagesDirectoryName } \" ")
151
158
. AppendArgument ( GetCustomMsBuildArguments ( buildPartition . RepresentativeBenchmarkCase , buildPartition . Resolver ) )
152
159
. AppendArgument ( extraArguments )
153
160
. AppendArgument ( GetMandatoryMsBuildSettings ( buildPartition . BuildConfiguration ) )
154
161
. AppendArgument ( GetMsBuildBinLogArgument ( buildPartition , binLogSuffix ) )
162
+ . MaybeAppendOutputPaths ( artifactsPaths , excludeOutput )
155
163
. ToString ( ) ;
156
164
157
165
internal static string GetBuildCommand ( ArtifactsPaths artifactsPaths , BuildPartition buildPartition , string extraArguments = null , string binLogSuffix = null , bool excludeOutput = false )
0 commit comments