Skip to content

Commit

Permalink
build only
Browse files Browse the repository at this point in the history
  • Loading branch information
taori committed Aug 17, 2024
1 parent ee34b52 commit 76d1f8d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Amusoft.DotnetNew.Tests/CLI/DotnetNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static async Task<Scaffold> NewAsync(string template, string? arguments,
/// <exception cref="FileNotFoundException"></exception>
/// <exception cref="DirectoryNotFoundException"></exception>
/// <exception cref="ScaffoldingFailedException"></exception>
public static async Task BuildAsync(string fullPath, string? arguments, Verbosity verbosity, CancellationToken cancellationToken, bool restore = false)
public static async Task BuildAsync(string fullPath, string? arguments, Verbosity verbosity, CancellationToken cancellationToken, bool restore)
{
if (!File.Exists(fullPath) && !Directory.Exists(fullPath))
{
Expand Down
5 changes: 3 additions & 2 deletions src/Amusoft.DotnetNew.Tests/Scaffolding/Scaffold.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ public ValueTask DisposeAsync()
/// <param name="arguments">build arguments</param>
/// <param name="cancellationToken">cancellation token</param>
/// <param name="verbosity"></param>
public async Task BuildAsync(string relativePath, string? arguments, CancellationToken cancellationToken, Verbosity verbosity = default)
/// <param name="restore"></param>
public async Task BuildAsync(string relativePath, string? arguments, CancellationToken cancellationToken, Verbosity verbosity = default, bool restore = false)
{
await CLI.DotnetNew.BuildAsync(_tempPath.PathTranslator.GetAbsolutePath(relativePath).OriginalPath, arguments, verbosity, cancellationToken);
await CLI.DotnetNew.BuildAsync(_tempPath.PathTranslator.GetAbsolutePath(relativePath).OriginalPath, arguments, verbosity, cancellationToken, restore);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dotnet new dotnet-library-repo -o "{Scaffold}" -n "Project1" --GitProjectName "P

---Result---

success: restore "{Scaffold}/src/Project1.sln" -v m
success: build {Scaffold}/src/Project1.sln -v m

,
files: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dotnet new dotnet-library-repo -o "{Scaffold}" -n "Project2" --GitProjectName "P

---Result---

success: restore "{Scaffold}/src/Project2.sln" -v m
success: build {Scaffold}/src/Project2.sln -v m

,
files: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ private async Task ScaffoldRepo(string projectName, string gitUser, string autho
""";
var scaffold = await CLI.DotnetNew.NewAsync("dotnet-library-repo", args.Replace(Environment.NewLine, " "), CancellationToken.None);
var list = scaffold.GetRelativeDirectoryPaths().ToArray();
await scaffold.RestoreAsync($"src/{projectName}.sln", null, CancellationToken.None);
// await scaffold.BuildAsync($"src/{projectName}.sln", null, CancellationToken.None);
// await scaffold.RestoreAsync($"src/{projectName}.sln", null, CancellationToken.None);
await scaffold.BuildAsync($"src/{projectName}.sln", null, CancellationToken.None, restore: true);

await Verifier.Verify(new
{
Expand Down

0 comments on commit 76d1f8d

Please sign in to comment.