Skip to content

Commit

Permalink
Use DotNet command template
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Oct 18, 2024
1 parent 880be06 commit c0b0173
Show file tree
Hide file tree
Showing 8 changed files with 1,180 additions and 280 deletions.
11 changes: 7 additions & 4 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ async Task CheckCompatibilityAsync(
try
{
var sampleProjectDir = Path.Combine("Samples", "MySampleLib", "MySampleLib.Tests");
await new DotNetNew("build", $"--version={nuGetVersion}", "-T", framework, "--no-restore")
await new DotNetNew()
.WithTemplateName("build")
.WithNoRestore(true)
.WithArgs($"--version={nuGetVersion}", "-T", framework)
.WithWorkingDirectory(buildProjectDir)
.WithShortName($"Creating a new {sampleProjectName}")
.RunAsync().EnsureSuccess();
Expand All @@ -289,10 +292,10 @@ async Task CheckCompatibilityAsync(
.BuildAsync().EnsureSuccess();

await new DotNetRun()
.WithProject(buildProjectDir)
.WithWorkingDirectory(buildProjectDir)
.WithNoRestore(true)
.WithNoBuild(true)
.WithFramework("net8.0")
.WithWorkingDirectory(sampleProjectDir)
.WithFramework(framework)
.WithShortName($"Running a build for the {sampleProjectName}")
.RunAsync().EnsureSuccess();

Expand Down
340 changes: 340 additions & 0 deletions CSharpInteractive.HostApi/CommandLines.cs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions CSharpInteractive.HostApi/CommandLines.tt
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ namespace HostApi;
"DotNetNuConfigSet",
"DotNetNuConfigUnset",
"DotNetNuConfigPaths",
"DotNetPackageSearch",
"DotNetPack",
"DotNetPublish",
"DotNetRestore",
"DotNetRun",
"DotNetSdkCheck",
"DotNetSlnList",
"DotNetSlnAdd",
"DotNetSlnRemove",
"DotNetTest",
"DotNetToolRestore",
"VSTest",
Expand Down
643 changes: 626 additions & 17 deletions CSharpInteractive.HostApi/DotNetCommands.cs

Large diffs are not rendered by default.

199 changes: 185 additions & 14 deletions CSharpInteractive.HostApi/DotNetCommands.tt

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions CSharpInteractive.HostApi/DotNetPackageSearchResultFormat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace HostApi;

/// <summary>
/// Search result format.
/// </summary>
public enum DotNetPackageSearchResultFormat
{
/// <summary>
/// Table
/// </summary>
Table,

/// <summary>
/// Json
/// </summary>
Json
}
129 changes: 0 additions & 129 deletions CSharpInteractive.HostApi/DotNetPublish.cs

This file was deleted.

116 changes: 0 additions & 116 deletions CSharpInteractive.HostApi/DotNetRestore.cs

This file was deleted.

0 comments on commit c0b0173

Please sign in to comment.