Skip to content

Commit 6ee21bb

Browse files
committed
if we fail to do the full build, we try with --no-dependencies
1 parent 5c519fb commit 6ee21bb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommand.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ public BuildResult RestoreThenBuild()
5757
if (!restoreResult.IsSuccess)
5858
return BuildResult.Failure(GenerateResult, restoreResult.AllInformation);
5959

60-
var buildResult = BuildNoRestore().ToBuildResult(GenerateResult);
60+
var buildResult = BuildNoRestore();
61+
62+
if (!buildResult.IsSuccess) // if we fail to do the full build, we try with --no-dependencies
63+
buildResult = BuildNoRestoreNoDependencies();
6164

62-
return buildResult;
65+
return buildResult.ToBuildResult(GenerateResult);
6366
}
6467

6568
[PublicAPI]
@@ -106,7 +109,10 @@ public DotNetCliCommandResult Restore()
106109
public DotNetCliCommandResult BuildNoRestore()
107110
=> DotNetCliCommandExecutor.Execute(WithArguments(
108111
GetBuildCommand(BuildPartition, $"{Arguments} --no-restore")));
109-
112+
113+
public DotNetCliCommandResult BuildNoRestoreNoDependencies()
114+
=> DotNetCliCommandExecutor.Execute(WithArguments(
115+
GetBuildCommand(BuildPartition, $"{Arguments} --no-restore --no-dependencies")));
110116

111117
public DotNetCliCommandResult PublishNoBuildAndNoRestore()
112118
=> DotNetCliCommandExecutor.Execute(WithArguments(

0 commit comments

Comments
 (0)