@@ -159,7 +159,8 @@ internal static IEnumerable<string> GetAddPackagesCommands(BuildPartition buildP
159
159
160
160
internal static string GetRestoreCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null, bool excludeOutput = false)
161
161
=> new StringBuilder()
162
- .AppendArgument($"restore {csProjPath}")
162
+ .AppendArgument("restore")
163
+ .AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
163
164
.AppendArgument(string.IsNullOrEmpty(artifactsPaths.PackagesDirectoryName) ? string.Empty : $"--packages \"{artifactsPaths.PackagesDirectoryName}\"")
164
165
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
165
166
.AppendArgument(extraArguments)
@@ -170,7 +171,9 @@ internal static string GetRestoreCommand(ArtifactsPaths artifactsPaths, BuildPar
170
171
171
172
internal static string GetBuildCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null, bool excludeOutput = false)
172
173
=> new StringBuilder()
173
- .AppendArgument($"build {csProjPath} -c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
174
+ .AppendArgument("build")
175
+ .AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
176
+ .AppendArgument($"-c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
174
177
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
175
178
.AppendArgument(extraArguments)
176
179
.AppendArgument(GetMandatoryMsBuildSettings(buildPartition.BuildConfiguration))
@@ -181,7 +184,9 @@ internal static string GetBuildCommand(ArtifactsPaths artifactsPaths, BuildParti
181
184
182
185
internal static string GetPublishCommand(ArtifactsPaths artifactsPaths, BuildPartition buildPartition, string csProjPath, string? extraArguments = null, string? binLogSuffix = null)
183
186
=> new StringBuilder()
184
- .AppendArgument($"publish {csProjPath} -c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
187
+ .AppendArgument("publish")
188
+ .AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
189
+ .AppendArgument($"-c {buildPartition.BuildConfiguration}") // we don't need to specify TFM, our auto-generated project contains always single one
185
190
.AppendArgument(GetCustomMsBuildArguments(buildPartition.RepresentativeBenchmarkCase, buildPartition.Resolver))
186
191
.AppendArgument(extraArguments)
187
192
.AppendArgument(GetMandatoryMsBuildSettings(buildPartition.BuildConfiguration))
@@ -235,9 +240,11 @@ private static string GetMandatoryMsBuildSettings(string buildConfiguration)
235
240
236
241
private static string BuildAddPackageCommand(NuGetReference reference, string csProjPath)
237
242
{
238
- var commandBuilder = new StringBuilder();
239
- commandBuilder.AppendArgument($"add {csProjPath} package");
240
- commandBuilder.AppendArgument(reference.PackageName);
243
+ var commandBuilder = new StringBuilder()
244
+ .AppendArgument("add")
245
+ .AppendArgument(string.IsNullOrEmpty(csProjPath) ? string.Empty : $"\"{csProjPath}\"")
246
+ .AppendArgument("package")
247
+ .AppendArgument(reference.PackageName);
241
248
if (!string.IsNullOrWhiteSpace(reference.PackageVersion))
242
249
{
243
250
commandBuilder.AppendArgument("-v");
0 commit comments