-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13bbe3b
commit bb869bd
Showing
17 changed files
with
99 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Install Template" type="DotNetProject" factoryName=".NET Project" folderName="Targets"> | ||
<option name="EXE_PATH" value="$PROJECT_DIR$/build/bin/Debug/net9.0/build.exe" /> | ||
<option name="PROGRAM_PARAMETERS" value="install" /> | ||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | ||
<option name="PASS_PARENT_ENVS" value="1" /> | ||
<option name="USE_EXTERNAL_CONSOLE" value="0" /> | ||
<option name="USE_MONO" value="0" /> | ||
<option name="RUNTIME_ARGUMENTS" value="" /> | ||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/build/build.csproj" /> | ||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" /> | ||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> | ||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" /> | ||
<option name="PROJECT_KIND" value="DotNetCore" /> | ||
<option name="PROJECT_TFM" value="net9.0" /> | ||
<method v="2"> | ||
<option name="Build" /> | ||
</method> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// ReSharper disable StringLiteralTypo | ||
// ReSharper disable ClassNeverInstantiated.Global | ||
|
||
namespace Build; | ||
|
||
internal class InstallTemplateTarget( | ||
Commands commands, | ||
[Tag(typeof(TemplateTarget))] ITarget<Package> templateTarget) | ||
: IInitializable, ITarget<Package> | ||
{ | ||
public Task InitializeAsync(CancellationToken cancellationToken) => commands.RegisterAsync( | ||
this, "Install template", "install", "i"); | ||
|
||
public async Task<Package> RunAsync(CancellationToken cancellationToken) | ||
{ | ||
var package = await templateTarget.RunAsync(cancellationToken); | ||
await new DotNetNewUninstall() | ||
.WithPackage(TemplateTarget.ProjectName) | ||
.RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); | ||
|
||
await new DotNetNewInstall() | ||
.WithPackage($"{TemplateTarget.ProjectName}::{package.Version}") | ||
.AddSources(Path.GetFullPath(Path.GetDirectoryName(package.Path) ?? ".")) | ||
.RunAsync(cancellationToken: cancellationToken).EnsureSuccess(); | ||
|
||
return package; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
namespace Build; | ||
|
||
using NuGet.Versioning; | ||
|
||
internal record Package( | ||
string Path, | ||
bool Deploy); | ||
bool Deploy, | ||
NuGetVersion Version); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/Pure.DI.Templates/Templates/Pure.DI.Template.ClassLibrary/GlobalUsings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
global using System; | ||
global using _PureDIProjectName_; | ||
global using Pure.DI; | ||
global using static Pure.DI.Lifetime; | ||
global using static Pure.DI.CompositionKind; | ||
global using static Pure.DI.Lifetime; | ||
global using static Pure.DI.Tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
src/Pure.DI.Templates/Templates/Pure.DI.Template.ConsoleApp/GlobalUsings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
global using _PureDIProjectName_; | ||
global using System; | ||
global using System; | ||
global using _PureDIProjectName_; | ||
global using Pure.DI; | ||
global using static Pure.DI.Lifetime; | ||
global using static Pure.DI.CompositionKind; | ||
global using static Pure.DI.Lifetime; | ||
global using static Pure.DI.Tag; |
17 changes: 4 additions & 13 deletions
17
src/Pure.DI.Templates/Templates/Pure.DI.Template.ConsoleApp/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.