|
58 | 58 | false)
|
59 | 59 | };
|
60 | 60 |
|
61 |
| -new DotNetToolRestore().WithShortName("Restoring tools").Run().EnsureSuccess(); |
| 61 | +new DotNetToolRestore().Run().EnsureSuccess(); |
62 | 62 |
|
63 | 63 | new DotNetClean()
|
64 | 64 | .WithProject(solutionFile)
|
|
173 | 173 | }
|
174 | 174 | }
|
175 | 175 |
|
176 |
| -var uninstallTool = new DotNetCustom("tool", "uninstall", toolPackageId, "-g") |
177 |
| - .WithShortName("Uninstalling tool"); |
| 176 | +var uninstallTool = new DotNetToolUninstall() |
| 177 | + .WithPackage(toolPackageId) |
| 178 | + .WithGlobal(true); |
178 | 179 |
|
179 | 180 | if (uninstallTool.Run(_ => { }).ExitCode != 0)
|
180 | 181 | {
|
|
191 | 192 | Environment.SetEnvironmentVariable("PATH", pathEnvVar);
|
192 | 193 | }
|
193 | 194 |
|
194 |
| -var installTool = new DotNetCustom("tool", "install", toolPackageId, "-g", "--version", packageVersion.ToString(), "--add-source", Path.Combine(outputDir, "CSharpInteractive.Tool")) |
195 |
| - .WithShortName("Installing tool"); |
| 195 | +await new DotNetBuild() |
| 196 | + .WithProject(Path.Combine("Samples", "MySampleLib")) |
| 197 | + .BuildAsync().EnsureSuccess(); |
| 198 | + |
| 199 | +var installTool = new DotNetToolInstall() |
| 200 | + .WithPackage(toolPackageId) |
| 201 | + .WithGlobal(true) |
| 202 | + .WithVersion(packageVersion.ToString()) |
| 203 | + .AddSources(Path.Combine(outputDir, "CSharpInteractive.Tool")); |
196 | 204 |
|
197 | 205 | installTool.Run(output =>
|
198 | 206 | {
|
199 | 207 | output.Handled = true;
|
200 | 208 | WriteLine(output.Line);
|
201 | 209 | }).EnsureSuccess(_ => true);
|
202 | 210 |
|
203 |
| -new DotNetCustom("csi", "/?").WithShortName("Checking tool").Run().EnsureSuccess(); |
| 211 | +new DotNetCsi().WithVersion(true).WithShortName("Checking csi tool").Run().EnsureSuccess(); |
204 | 212 |
|
205 |
| -var uninstallTemplates = new DotNetCustom("new", "uninstall", templatesPackageId) |
206 |
| - .WithShortName("Uninstalling template"); |
| 213 | +var uninstallTemplates = new DotNetNewUninstall() |
| 214 | + .WithPackage(templatesPackageId); |
207 | 215 |
|
208 | 216 | uninstallTemplates.Run(output =>
|
209 | 217 | {
|
210 | 218 | output.Handled = true;
|
211 | 219 | WriteLine(output.Line);
|
212 | 220 | }).EnsureSuccess(_ => true);
|
213 | 221 |
|
214 |
| -var installTemplates = new DotNetCustom("new", "install", $"{templatesPackageId}::{packageVersion.ToString()}", "--nuget-source", templateOutputDir) |
215 |
| - .WithShortName("Installing template"); |
| 222 | +var installTemplates = new DotNetNewInstall() |
| 223 | + .WithPackage($"{templatesPackageId}::{packageVersion.ToString()}") |
| 224 | + .AddSources(templateOutputDir); |
216 | 225 |
|
217 |
| -installTemplates.WithShortName(installTemplates.ShortName).Run().EnsureSuccess(); |
| 226 | +installTemplates.Run().EnsureSuccess(); |
218 | 227 | foreach (var framework in frameworks)
|
219 | 228 | {
|
220 | 229 | await CheckCompatibilityAsync(framework, packageVersion, defaultNuGetSource, outputDir);
|
221 | 230 | }
|
222 | 231 |
|
223 | 232 | if (!string.IsNullOrWhiteSpace(apiKey) && packageVersion.Release != "dev" && packageVersion.Release != "dev")
|
224 | 233 | {
|
225 |
| - var push = new DotNetNuGetPush().WithApiKey(apiKey).WithSources(defaultNuGetSource); |
| 234 | + var push = new DotNetNuGetPush().WithApiKey(apiKey).WithSource(defaultNuGetSource); |
226 | 235 | foreach (var package in packages.Where(i => i.Publish))
|
227 | 236 | {
|
228 | 237 | push.WithPackage(package.Package)
|
229 |
| - .WithShortName($"Pushing {Path.GetFileName(package.Package)}") |
230 | 238 | .Build().EnsureSuccess();
|
231 | 239 | }
|
232 | 240 | }
|
@@ -269,27 +277,28 @@ async Task CheckCompatibilityAsync(
|
269 | 277 | try
|
270 | 278 | {
|
271 | 279 | var sampleProjectDir = Path.Combine("Samples", "MySampleLib", "MySampleLib.Tests");
|
272 |
| - await new DotNetNew("build", $"--version={nuGetVersion}", "-T", framework, "--no-restore") |
| 280 | + await new DotNetNew() |
| 281 | + .WithTemplateName("build") |
| 282 | + .WithNoRestore(true) |
| 283 | + .WithArgs($"--version={nuGetVersion}", "-T", framework) |
273 | 284 | .WithWorkingDirectory(buildProjectDir)
|
274 |
| - .WithShortName($"Creating a new {sampleProjectName}") |
275 | 285 | .RunAsync().EnsureSuccess();
|
276 | 286 |
|
277 | 287 | await new DotNetBuild()
|
278 | 288 | .WithProject(buildProjectDir)
|
279 | 289 | .WithSources(nuGetSource, Path.Combine(output, "CSharpInteractive"))
|
280 |
| - .WithShortName($"Building the {sampleProjectName}") |
281 | 290 | .BuildAsync().EnsureSuccess();
|
282 | 291 |
|
283 | 292 | await new DotNetRun()
|
284 |
| - .WithProject(buildProjectDir) |
| 293 | + .WithWorkingDirectory(buildProjectDir) |
| 294 | + .WithNoRestore(true) |
285 | 295 | .WithNoBuild(true)
|
286 |
| - .WithWorkingDirectory(sampleProjectDir) |
287 |
| - .WithShortName($"Running a build for the {sampleProjectName}") |
| 296 | + .WithFramework(framework) |
288 | 297 | .RunAsync().EnsureSuccess();
|
289 | 298 |
|
290 |
| - await new DotNetCustom("csi", Path.Combine(buildProjectDir, "Program.csx")) |
| 299 | + await new DotNetCsi() |
| 300 | + .WithScript(Path.Combine(buildProjectDir, "Program.csx")) |
291 | 301 | .WithWorkingDirectory(sampleProjectDir)
|
292 |
| - .WithShortName($"Running a build as a C# script for the {sampleProjectName}") |
293 | 302 | .RunAsync().EnsureSuccess();
|
294 | 303 | }
|
295 | 304 | finally
|
|
0 commit comments