Skip to content

Commit d224dec

Browse files
committed
Update to .NET 9 and improve project setup
- Updated GitHub Actions workflows to use `actions/setup-dotnet@v4` and target .NET 9.0. - Incremented default package version in `nuget-publish.yml` to `1.1.0`. - Updated README.md to reflect .NET 9 changes for Genocs CLI tool. - Simplified console messages in `Program.cs` by removing "Genocs" prefix. - Added a commented-out example in `Program.cs` for `WriteColorEx`. - Updated `genocs.cli.csproj` to target .NET 9.0 and updated description.
1 parent 5bda616 commit d224dec

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

.github/workflows/build_and_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v3
20+
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 8.0.x
22+
dotnet-version: 9.0.x
2323

2424
- name: Restore dependencies
2525
run: dotnet restore

.github/workflows/nuget-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
description: "Package Version"
1414

1515
# Default value if no value is explicitly provided
16-
default: "1.0.0"
16+
default: "1.1.0"
1717

1818
# Input has to be provided for the workflow to run
1919
required: true
@@ -28,9 +28,9 @@ jobs:
2828
uses: actions/checkout@v4
2929

3030
- name: Setup .NET
31-
uses: actions/setup-dotnet@v3
31+
uses: actions/setup-dotnet@v4
3232
with:
33-
dotnet-version: 8.0.x
33+
dotnet-version: 9.0.x
3434

3535
- name: Restore dependencies
3636
run: dotnet restore

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Here where you can find the Dotnet tools official Documentation:
5656

5757
## Supported runtime
5858

59-
Genocs cli can be used on .NET8 runtimes.
59+
Genocs cli can be used on .NET9 runtimes.
6060

6161
Please check the GitHub repository getting more info.
6262

@@ -95,11 +95,11 @@ dotnet pack -p:PackageVersion={semver} --output nupkgs
9595
dotnet pack --output nupkgs
9696

9797
# Run the tool to install the templates
98-
dotnet run -f net8.0 --project ./src/genocs.cli.csproj genocs -i
98+
dotnet run -f net9.0 --project ./src/genocs.cli.csproj genocs -i
9999

100100
# Run the tool to install the templates (some as above with cd command)
101101
cd ./src
102-
dotnet run -f net8.0 genocs -i
102+
dotnet run -f net9.0 genocs -i
103103

104104
# Install the tool from local folder to the global cache
105105
dotnet tool install --global --add-source ./nupkgs genocs.cli

src/Program.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ async Task BootstrapReactSolutionAsync(string projectName)
250250

251251
async Task BootstrapBlazorCleanSolutionAsync(string projectName)
252252
{
253-
Console.WriteLine($"Bootstrapping Genocs: Blazor Clean WebAssembly Solution at '{projectName}' ...");
253+
Console.WriteLine($"Bootstrapping Blazor Clean WebAssembly Solution at '{projectName}' ...");
254254
var psi = new ProcessStartInfo
255255
{
256256
FileName = "dotnet",
@@ -259,13 +259,13 @@ async Task BootstrapBlazorCleanSolutionAsync(string projectName)
259259

260260
using var proc = Process.Start(psi)!;
261261
await proc.WaitForExitAsync();
262-
WriteSuccessMessage($"Genocs: Blazor Clean WebAssembly Solution '{projectName}' successfully created.");
262+
WriteSuccessMessage($"Blazor Clean WebAssembly Solution '{projectName}' successfully created.");
263263
Console.WriteLine("Refer to documentation at https://genocs-blog.netlify.app/");
264264
}
265265

266266
async Task BootstrapBlazorWasmSolutionAsync(string projectName)
267267
{
268-
Console.WriteLine($"Bootstrapping Genocs: Blazor WebAssembly Solution at '{projectName}' ...");
268+
Console.WriteLine($"Bootstrapping Blazor WebAssembly Solution at '{projectName}' ...");
269269
var psi = new ProcessStartInfo
270270
{
271271
FileName = "dotnet",
@@ -274,49 +274,49 @@ async Task BootstrapBlazorWasmSolutionAsync(string projectName)
274274

275275
using var proc = Process.Start(psi)!;
276276
await proc.WaitForExitAsync();
277-
WriteSuccessMessage($"Genocs: Blazor WebAssembly Solution '{projectName}' successfully created.");
277+
WriteSuccessMessage($"Blazor WebAssembly Solution '{projectName}' successfully created.");
278278
Console.WriteLine("Refer to documentation at https://genocs-blog.netlify.app/");
279279
}
280280

281281
async Task BootstrapCleanWebApiSolutionAsync(string projectName)
282282
{
283-
Console.WriteLine($"Bootstrapping Genocs Microservice (Clean Architecture - Onion) solution at '{projectName}' ...");
283+
Console.WriteLine($"Bootstrapping Microservice (Clean Architecture - Onion) solution at '{projectName}' ...");
284284
var psi = new ProcessStartInfo
285285
{
286286
FileName = "dotnet",
287287
Arguments = $"new cleanarchitecture -n {projectName} -o {projectName} -v=q"
288288
};
289289
using var proc = Process.Start(psi)!;
290290
await proc.WaitForExitAsync();
291-
WriteSuccessMessage($"Genocs Microservice (Clean Architecture - Onion) solution '{projectName}' successfully created.");
291+
WriteSuccessMessage($"Microservice (Clean Architecture - Onion) Solution '{projectName}' successfully created.");
292292
Console.WriteLine("Refer to documentation at https://genocs-blog.netlify.app/");
293293
}
294294

295295
async Task BootstrapLibraWebApiSolution(string projectName)
296296
{
297-
Console.WriteLine($"Bootstrapping Genocs Microservice (with Genocs library) solution at '{projectName}' ...");
297+
Console.WriteLine($"Bootstrapping Microservice (with Genocs library) Solution at '{projectName}' ...");
298298
var psi = new ProcessStartInfo
299299
{
300300
FileName = "dotnet",
301301
Arguments = $"new gnx-librawebapi -n {projectName} -o {projectName} -v=q"
302302
};
303303
using var proc = Process.Start(psi)!;
304304
await proc.WaitForExitAsync();
305-
WriteSuccessMessage($"Genocs Genocs Microservice (with Genocs Library) solution '{projectName}' successfully created.");
305+
WriteSuccessMessage($"Microservice (with Genocs Library) solution '{projectName}' successfully created.");
306306
Console.WriteLine("Refer to documentation at https://genocs-blog.netlify.app/");
307307
}
308308

309309
async Task BootstrapMicroWebApiSolution(string projectName)
310310
{
311-
Console.WriteLine($"Bootstrapping Genocs Microservice (with Multitenancy) solution at '{projectName}' ...");
311+
Console.WriteLine($"Bootstrapping Microservice (with Multitenancy) solution at '{projectName}' ...");
312312
var psi = new ProcessStartInfo
313313
{
314314
FileName = "dotnet",
315315
Arguments = $"new gnx-microservice -n {projectName} -o {projectName} -v=q"
316316
};
317317
using var proc = Process.Start(psi)!;
318318
await proc.WaitForExitAsync();
319-
WriteSuccessMessage($"Genocs Genocs Microservice (with Multitenancy) solution '{projectName}' successfully created.");
319+
WriteSuccessMessage($"Microservice (with Multitenancy) Solution '{projectName}' successfully created.");
320320
Console.WriteLine("Refer to documentation at https://genocs-blog.netlify.app/");
321321
}
322322

@@ -359,4 +359,5 @@ static void WriteColorEx(string str, params (string SubString, ConsoleColor Colo
359359
Console.WriteLine("or with:");
360360
WriteColorConsole(" genocs [blazor|webapi|worker|cleanapi|angular|react] [n|new] <ServiceName>", ConsoleColor.Cyan);
361361
Console.WriteLine("\nPlease refer to https://genocs-blog.netlify.app/");
362+
362363
// WriteColorEx("This is my message with new color with red", ("{message}", ConsoleColor.Red), ("{with}", ConsoleColor.Blue));

src/genocs.cli.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<TargetFrameworks>net9.0</TargetFrameworks>
66
<PackageId>Genocs.CLI</PackageId>
77
<RootNamespace>Genocs.CLI</RootNamespace>
88
<AssemblyName>Genocs.CLI</AssemblyName>
99
<Title>Genocs CLI Tool.</Title>
10-
<Description>The Genocs CLI Tool to run .NET8 templates.</Description>
10+
<Description>The Genocs CLI Tool to run .NET9 templates.</Description>
1111
<PackAsTool>true</PackAsTool>
1212
<ToolCommandName>genocs</ToolCommandName>
1313
<PackageVersion>1.0.0</PackageVersion>

0 commit comments

Comments
 (0)