From a18607fccef744add3651d0c1415dd8366485135 Mon Sep 17 00:00:00 2001 From: Damien Date: Thu, 21 Nov 2024 15:39:24 +0100 Subject: [PATCH] net6.0/8.0 => net8.0/9.0 --- .github/workflows/vscode.yml | 6 +++--- TopModel.Core/TopModel.Core.csproj | 10 +++------- .../TopModel.Generator.Core.csproj | 6 +----- .../DbContextGenerator.cs | 6 +++--- .../TopModel.Generator.Csharp.csproj | 8 ++------ .../TopModel.Generator.Javascript.csproj | 6 +----- .../TopModel.Generator.Jpa.csproj | 6 +----- .../TopModel.Generator.Php.csproj | 6 +----- .../TopModel.Generator.Sql.csproj | 6 +----- .../TopModel.Generator.Translation.csproj | 6 +----- TopModel.Generator/TopModel.Generator.csproj | 8 ++------ .../TopModel.LanguageServer.csproj | 8 ++------ .../TopModel.ModelGenerator.csproj | 18 +++++++----------- TopModel.UI/TopModel.UI.csproj | 7 +------ TopModel.Utils/TopModel.Utils.csproj | 12 ++++-------- TopModel.VSCode/dotnet.md | 2 +- TopModel.VSCode/src/application.ts | 6 +++--- docs/getting-started/07_generation.md | 2 +- docs/readme.md | 2 +- docs/ui.md | 2 +- .../angular/topmodel.config.schema.json | 3 ++- .../focus/topmodel.config.schema.json | 3 ++- samples/model/angular.topmodel.lock | 2 +- samples/model/csharp.topmodel.lock | 4 ++-- samples/model/focus.topmodel.lock | 2 +- samples/model/jpa.topmodel.lock | 2 +- samples/model/pg.topmodel.lock | 2 +- samples/model/php.topmodel.lock | 2 +- samples/model/ssdt.topmodel.lock | 2 +- samples/model/translation.topmodel.lock | 2 +- 30 files changed, 53 insertions(+), 104 deletions(-) diff --git a/.github/workflows/vscode.yml b/.github/workflows/vscode.yml index 773ab763..9aba2bed 100644 --- a/.github/workflows/vscode.yml +++ b/.github/workflows/vscode.yml @@ -15,18 +15,18 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 18 + node-version: 20 - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - run: dotnet publish -f net8.0 name: Build LS working-directory: TopModel.LanguageServer - - run: dotnet publish -f net6.0 + - run: dotnet publish -f net9.0 name: Build LS working-directory: TopModel.LanguageServer diff --git a/TopModel.Core/TopModel.Core.csproj b/TopModel.Core/TopModel.Core.csproj index 1baf480c..08ebcfa5 100644 --- a/TopModel.Core/TopModel.Core.csproj +++ b/TopModel.Core/TopModel.Core.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -41,8 +37,8 @@ - - + + diff --git a/TopModel.Generator.Core/TopModel.Generator.Core.csproj b/TopModel.Generator.Core/TopModel.Generator.Core.csproj index 4e56fd60..e9ebc918 100644 --- a/TopModel.Generator.Core/TopModel.Generator.Core.csproj +++ b/TopModel.Generator.Core/TopModel.Generator.Core.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator.Csharp/DbContextGenerator.cs b/TopModel.Generator.Csharp/DbContextGenerator.cs index 792bd259..b5afdba2 100644 --- a/TopModel.Generator.Csharp/DbContextGenerator.cs +++ b/TopModel.Generator.Csharp/DbContextGenerator.cs @@ -50,7 +50,7 @@ protected virtual void HandleCommentsFile(string fileName, string tag, string db { using var cw = new CSharpWriter(fileName, _logger); - cw.WriteUsings(usings.ToArray()); + cw.WriteUsings([.. usings]); cw.WriteLine(); cw.WriteNamespace(contextNs); @@ -156,7 +156,7 @@ protected virtual void HandleMainFile(string fileName, string tag, string dbCont if (Config.CanClassUseEnums(classe, Classes, targetProp)) { hasPropConfig = true; - w.WriteLine(2, $"modelBuilder.Entity<{fp.Class}>().Property(p => p.{fp.NamePascal}).HasConversion<{Config.GetImplementation(fp.Domain)?.Type ?? string.Empty}>(){(fp.Domain.Length != null ? $".HasMaxLength({fp.Domain.Length})" : string.Empty)};"); + w.WriteLine(2, $"modelBuilder.Entity<{fp.Class}>().Property(p => p.{fp.NamePascal}).HasConversion<{Config.GetImplementation(fp.Domain)?.Type ?? string.Empty}>(){(fp.Domain?.Length != null ? $".HasMaxLength({fp.Domain.Length})" : string.Empty)};"); } if (fp.Domain?.Length != null && fp.Domain?.Scale != null) @@ -224,7 +224,7 @@ protected virtual void HandleMainFile(string fileName, string tag, string dbCont } var hasData = false; - foreach (var classe in classes.Distinct().Where(c => c.Values.Any()).OrderBy(c => c.NamePascal)) + foreach (var classe in classes.Distinct().Where(c => c.Values.Count > 0).OrderBy(c => c.NamePascal)) { hasData = true; w.WriteLine(2, $"modelBuilder.Entity<{classe.NamePascal}>().HasData("); diff --git a/TopModel.Generator.Csharp/TopModel.Generator.Csharp.csproj b/TopModel.Generator.Csharp/TopModel.Generator.Csharp.csproj index 5af6e91f..6d3b124f 100644 --- a/TopModel.Generator.Csharp/TopModel.Generator.Csharp.csproj +++ b/TopModel.Generator.Csharp/TopModel.Generator.Csharp.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -41,7 +37,7 @@ - + diff --git a/TopModel.Generator.Javascript/TopModel.Generator.Javascript.csproj b/TopModel.Generator.Javascript/TopModel.Generator.Javascript.csproj index 521d3160..bdd7761b 100644 --- a/TopModel.Generator.Javascript/TopModel.Generator.Javascript.csproj +++ b/TopModel.Generator.Javascript/TopModel.Generator.Javascript.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator.Jpa/TopModel.Generator.Jpa.csproj b/TopModel.Generator.Jpa/TopModel.Generator.Jpa.csproj index afec4305..cb30ae13 100644 --- a/TopModel.Generator.Jpa/TopModel.Generator.Jpa.csproj +++ b/TopModel.Generator.Jpa/TopModel.Generator.Jpa.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator.Php/TopModel.Generator.Php.csproj b/TopModel.Generator.Php/TopModel.Generator.Php.csproj index e5348634..056ea63d 100644 --- a/TopModel.Generator.Php/TopModel.Generator.Php.csproj +++ b/TopModel.Generator.Php/TopModel.Generator.Php.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -21,10 +21,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator.Sql/TopModel.Generator.Sql.csproj b/TopModel.Generator.Sql/TopModel.Generator.Sql.csproj index f0bbe4c1..7220b4c6 100644 --- a/TopModel.Generator.Sql/TopModel.Generator.Sql.csproj +++ b/TopModel.Generator.Sql/TopModel.Generator.Sql.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator.Translation/TopModel.Generator.Translation.csproj b/TopModel.Generator.Translation/TopModel.Generator.Translation.csproj index af88750c..cf8f3a64 100644 --- a/TopModel.Generator.Translation/TopModel.Generator.Translation.csproj +++ b/TopModel.Generator.Translation/TopModel.Generator.Translation.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -30,10 +30,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Generator/TopModel.Generator.csproj b/TopModel.Generator/TopModel.Generator.csproj index 51376c83..7a18f136 100644 --- a/TopModel.Generator/TopModel.Generator.csproj +++ b/TopModel.Generator/TopModel.Generator.csproj @@ -1,7 +1,7 @@  - net8.0;net6.0 + net8.0;net9.0 12 Exe enable @@ -29,10 +29,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -40,7 +36,7 @@ - + diff --git a/TopModel.LanguageServer/TopModel.LanguageServer.csproj b/TopModel.LanguageServer/TopModel.LanguageServer.csproj index 40b82e95..379fc4fd 100644 --- a/TopModel.LanguageServer/TopModel.LanguageServer.csproj +++ b/TopModel.LanguageServer/TopModel.LanguageServer.csproj @@ -2,7 +2,7 @@ Exe - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -21,10 +21,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -33,7 +29,7 @@ - + diff --git a/TopModel.ModelGenerator/TopModel.ModelGenerator.csproj b/TopModel.ModelGenerator/TopModel.ModelGenerator.csproj index 9a1221bb..2f56bd23 100644 --- a/TopModel.ModelGenerator/TopModel.ModelGenerator.csproj +++ b/TopModel.ModelGenerator/TopModel.ModelGenerator.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net8.0;net9.0 12 Exe enable @@ -25,10 +25,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -37,12 +33,12 @@ - - - - - - + + + + + + diff --git a/TopModel.UI/TopModel.UI.csproj b/TopModel.UI/TopModel.UI.csproj index cf4f2c21..96180c6a 100644 --- a/TopModel.UI/TopModel.UI.csproj +++ b/TopModel.UI/TopModel.UI.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -14,15 +14,10 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TopModel.Utils/TopModel.Utils.csproj b/TopModel.Utils/TopModel.Utils.csproj index de3759a7..6c47184d 100644 --- a/TopModel.Utils/TopModel.Utils.csproj +++ b/TopModel.Utils/TopModel.Utils.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 12 enable enable @@ -31,10 +31,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -42,9 +38,9 @@ - - - + + + diff --git a/TopModel.VSCode/dotnet.md b/TopModel.VSCode/dotnet.md index 7323d839..9fe704f7 100644 --- a/TopModel.VSCode/dotnet.md +++ b/TopModel.VSCode/dotnet.md @@ -1,5 +1,5 @@ # Installation de dotnet -`TopModel.Generator` est une application .NET 6, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). +`TopModel.Generator` est une application .NET 8 ou 9, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). Pour l'utiliser, il faut avoir le [SDK .NET](https://dotnet.microsoft.com/download) installé sur votre machine \ No newline at end of file diff --git a/TopModel.VSCode/src/application.ts b/TopModel.VSCode/src/application.ts index 455ce313..398fd34f 100644 --- a/TopModel.VSCode/src/application.ts +++ b/TopModel.VSCode/src/application.ts @@ -59,12 +59,12 @@ export class Application { const stdout = await execute("dotnet --list-runtimes"); const runtimeVersion = stdout.includes("Microsoft.NETCore.App 8.0") ? "net8.0" - : stdout.includes("Microsoft.NETCore.App 6.0") - ? "net6.0" + : stdout.includes("Microsoft.NETCore.App 9.0") + ? "net9.0" : undefined; if (!runtimeVersion) { - window.showErrorMessage("Aucun runtime .NET trouvé pour lancer l'extension TopModel (net6.0 ou net8.0)"); + window.showErrorMessage("Aucun runtime .NET trouvé pour lancer l'extension TopModel (net8.0 ou net9.0)"); return; } diff --git a/docs/getting-started/07_generation.md b/docs/getting-started/07_generation.md index 6b5e54a6..ba642bd3 100644 --- a/docs/getting-started/07_generation.md +++ b/docs/getting-started/07_generation.md @@ -4,7 +4,7 @@ La modélisation TopModel est le point d'entrée de son générateur `modgen`. L ## Installer `modgen` -`TopModel.Generator` est une application .NET 6, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). +`TopModel.Generator` est une application .NET 8 ou 9, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). Pour l'utiliser, il faut avoir le [SDK .NET](https://dotnet.microsoft.com/download) installé sur votre machine, puis lancer la commande diff --git a/docs/readme.md b/docs/readme.md index e4e1257a..26a22d2a 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -6,7 +6,7 @@ ### Pré-requis -`TopModel.Generator` est une application .NET 6, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). +`TopModel.Generator` est une application .NET 8 ou 9, packagée comme un [outil .NET](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools). Pour l'utiliser, il faut avoir le [SDK .NET](https://dotnet.microsoft.com/download) installé sur votre machine, puis lancer la commande diff --git a/docs/ui.md b/docs/ui.md index 2dd2b565..60b99350 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -2,7 +2,7 @@ **/!\ Expérimental /!\\** -**TopModel.UI** (TMUI) est un outil de visualisation d'un modèle TopModel. Il s'agit également d'une application .NET 6, mais qui n'est à ce jour pas publiée. Vous pouvez néanmoins l'utiliser en téléchargeant les sources et en utilisant la commande `dotnet run` sur le projet C#, en lui passant le fichier de config du générateur. +**TopModel.UI** (TMUI) est un outil de visualisation d'un modèle TopModel. Il s'agit également d'une application .NET 8 ou 9, mais qui n'est à ce jour pas publiée. Vous pouvez néanmoins l'utiliser en téléchargeant les sources et en utilisant la commande `dotnet run` sur le projet C#, en lui passant le fichier de config du générateur. Une fois l'application lancée, elle est accessible par défaut sous [https://localhost:5001](https://localhost:5001) (le lien apparaît dans la console et sera cliquable depuis VSCode, si jamais). diff --git a/samples/generators/angular/topmodel.config.schema.json b/samples/generators/angular/topmodel.config.schema.json index 8dc06ad7..6080561e 100644 --- a/samples/generators/angular/topmodel.config.schema.json +++ b/samples/generators/angular/topmodel.config.schema.json @@ -200,7 +200,8 @@ "default": "typed", "enum": [ "untyped", - "typed" + "typed", + "none" ] }, "extendedCompositions": { diff --git a/samples/generators/focus/topmodel.config.schema.json b/samples/generators/focus/topmodel.config.schema.json index 8dc06ad7..6080561e 100644 --- a/samples/generators/focus/topmodel.config.schema.json +++ b/samples/generators/focus/topmodel.config.schema.json @@ -200,7 +200,8 @@ "default": "typed", "enum": [ "untyped", - "typed" + "typed", + "none" ] }, "extendedCompositions": { diff --git a/samples/model/angular.topmodel.lock b/samples/model/angular.topmodel.lock index 6f637188..d8101746 100644 --- a/samples/model/angular.topmodel.lock +++ b/samples/model/angular.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Javascript: 813bd1d0b6e6a08aff8900e52ef483ae generatedFiles: diff --git a/samples/model/csharp.topmodel.lock b/samples/model/csharp.topmodel.lock index 4cecf819..629796b7 100644 --- a/samples/model/csharp.topmodel.lock +++ b/samples/model/csharp.topmodel.lock @@ -2,9 +2,9 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: - ../../../TopModel.Generator.Csharp: 121e8b5ce6a8be344945262bf8960580 + ../../../TopModel.Generator.Csharp: 1f47b333bf3d8c8acce3ee5d40956cc9 generatedFiles: - ../generators/csharp/src/Clients/CSharp.Clients.Db/generated/CSharpDbContext.comments.cs - ../generators/csharp/src/Clients/CSharp.Clients.Db/generated/CSharpDbContext.cs diff --git a/samples/model/focus.topmodel.lock b/samples/model/focus.topmodel.lock index 685db183..ab25e0f0 100644 --- a/samples/model/focus.topmodel.lock +++ b/samples/model/focus.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Javascript: 813bd1d0b6e6a08aff8900e52ef483ae generatedFiles: diff --git a/samples/model/jpa.topmodel.lock b/samples/model/jpa.topmodel.lock index d307af2e..a6e99daa 100644 --- a/samples/model/jpa.topmodel.lock +++ b/samples/model/jpa.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Jpa: b7b41bad6aa1f4963dda4549de26efcd generatedFiles: diff --git a/samples/model/pg.topmodel.lock b/samples/model/pg.topmodel.lock index 0cadab1c..f4ee53c7 100644 --- a/samples/model/pg.topmodel.lock +++ b/samples/model/pg.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Sql: 6c49105633a94d33dc5f26d6fece3a43 generatedFiles: diff --git a/samples/model/php.topmodel.lock b/samples/model/php.topmodel.lock index ec83f209..7b08b827 100644 --- a/samples/model/php.topmodel.lock +++ b/samples/model/php.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Php: 8029e36a5806c385b25b725c2e00ecdc generatedFiles: diff --git a/samples/model/ssdt.topmodel.lock b/samples/model/ssdt.topmodel.lock index 963823c9..cdb4f9f4 100644 --- a/samples/model/ssdt.topmodel.lock +++ b/samples/model/ssdt.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Sql: 6c49105633a94d33dc5f26d6fece3a43 generatedFiles: diff --git a/samples/model/translation.topmodel.lock b/samples/model/translation.topmodel.lock index acbc0cb0..64ceb118 100644 --- a/samples/model/translation.topmodel.lock +++ b/samples/model/translation.topmodel.lock @@ -2,7 +2,7 @@ # ATTENTION CE FICHIER EST GENERE AUTOMATIQUEMENT ! # -version: 2.1.2 +version: 2.1.3 custom: ../../../TopModel.Generator.Translation: 9f15a161c1cd09a554e17eb18f624495 generatedFiles: