From 76a76a9fd9e6b910cfe6b05c2133ea0b134acdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Graus?= Date: Wed, 15 Mar 2023 17:00:46 +0100 Subject: [PATCH 1/5] Anpassen der publish Profile. Hebung der Nugets. --- .../CompiledHandlebars.Core.Cli.csproj | 10 +++++----- CompiledHandlebars.Cli2/Program.cs | 1 + .../PublishProfiles/FolderProfile.pubxml | 16 ---------------- .../Properties/PublishProfiles/linux.pubxml | 18 ++++++++++++++++++ .../Properties/PublishProfiles/windows.pubxml | 18 ++++++++++++++++++ .../Properties/launchSettings.json | 7 ++++++- CompiledHandlebars.sln | 16 ++++++++-------- Compiler/CompiledHandlebars.Compiler.csproj | 8 ++++---- 8 files changed, 60 insertions(+), 34 deletions(-) delete mode 100644 CompiledHandlebars.Cli2/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml create mode 100644 CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml diff --git a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj index 7de9b2f..11d993d 100644 --- a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj +++ b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj @@ -11,14 +11,14 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/CompiledHandlebars.Cli2/Program.cs b/CompiledHandlebars.Cli2/Program.cs index c81d99b..e579f1f 100644 --- a/CompiledHandlebars.Cli2/Program.cs +++ b/CompiledHandlebars.Cli2/Program.cs @@ -161,6 +161,7 @@ private static void CompileProject(CompilerOptions options) try { AnalyzerManager manager = new AnalyzerManager(); + IProjectAnalyzer analyzer = manager.GetProject(options.ProjectFile); workspace = analyzer.GetWorkspace(); project = workspace.CurrentSolution.Projects.ElementAt(0); diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/FolderProfile.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/FolderProfile.pubxml deleted file mode 100644 index 22dc206..0000000 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/FolderProfile.pubxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Debug - x64 - D:\hbc - FileSystem - netcoreapp3.1 - linux-x64 - false - True - - \ No newline at end of file diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml new file mode 100644 index 0000000..3387865 --- /dev/null +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml @@ -0,0 +1,18 @@ + + + + + Release + x64 + C:\D\hbc\linux + FileSystem + net7.0 + linux-x64 + false + false + + en + + \ No newline at end of file diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml new file mode 100644 index 0000000..42ab987 --- /dev/null +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml @@ -0,0 +1,18 @@ + + + + + Release + Any CPU + C:\D\hbc\windows + FileSystem + net7.0 + win-x64 + false + false + true + en + + \ No newline at end of file diff --git a/CompiledHandlebars.Cli2/Properties/launchSettings.json b/CompiledHandlebars.Cli2/Properties/launchSettings.json index 6d1a1c9..eec448e 100644 --- a/CompiledHandlebars.Cli2/Properties/launchSettings.json +++ b/CompiledHandlebars.Cli2/Properties/launchSettings.json @@ -2,7 +2,12 @@ "profiles": { "CompiledHandlebars.Cli2": { "commandName": "Project", - "commandLineArgs": "-c -d -f -eC:\\dev\\sw.git\\StiftungWarentest.Website\\node_modules -eC:\\dev\\sw.git\\StiftungWarentest.Website\\assets C:\\dev\\sw.git\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj" + "commandLineArgs": "-c -d -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\node_modules -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\assets C:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj" + }, + "WSL": { + "commandName": "WSL2", + "distributionName": "", + "commandLineArgs": "CompiledHandlebars.Core.Cli.dll -c -d -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/node_modules -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/assets /mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/StiftungWarentest.Website.csproj" } } } \ No newline at end of file diff --git a/CompiledHandlebars.sln b/CompiledHandlebars.sln index 43e3b8c..8ed7147 100644 --- a/CompiledHandlebars.sln +++ b/CompiledHandlebars.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30611.23 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CompiledHandlebars.Compiler", "Compiler\CompiledHandlebars.Compiler.csproj", "{55E767E0-44F0-4297-9A00-7211B424BE03}" EndProject @@ -19,14 +19,14 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|Any CPU.ActiveCfg = Debug|x64 + {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|Any CPU.Build.0 = Debug|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|x64.ActiveCfg = Debug|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|x64.Build.0 = Debug|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|x86.ActiveCfg = Debug|Any CPU {55E767E0-44F0-4297-9A00-7211B424BE03}.Debug|x86.Build.0 = Debug|Any CPU - {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|Any CPU.Build.0 = Release|Any CPU + {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|Any CPU.ActiveCfg = Release|x64 + {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|Any CPU.Build.0 = Release|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|x64.ActiveCfg = Release|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|x64.Build.0 = Release|x64 {55E767E0-44F0-4297-9A00-7211B424BE03}.Release|x86.ActiveCfg = Release|Any CPU @@ -39,8 +39,8 @@ Global {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Debug|x86.Build.0 = Debug|Any CPU {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|Any CPU.ActiveCfg = Release|Any CPU {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|Any CPU.Build.0 = Release|Any CPU - {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x64.ActiveCfg = Release|Any CPU - {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x64.Build.0 = Release|Any CPU + {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x64.ActiveCfg = Release|x64 + {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x64.Build.0 = Release|x64 {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x86.ActiveCfg = Release|Any CPU {A3B28E61-F74A-4156-BD99-0FD46E475EDF}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection diff --git a/Compiler/CompiledHandlebars.Compiler.csproj b/Compiler/CompiledHandlebars.Compiler.csproj index 5321713..e9f021c 100644 --- a/Compiler/CompiledHandlebars.Compiler.csproj +++ b/Compiler/CompiledHandlebars.Compiler.csproj @@ -28,13 +28,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 147c33f3294bc34d754cf7ec36cb2066e1a5ee3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Graus?= Date: Wed, 5 Apr 2023 16:16:37 +0200 Subject: [PATCH 2/5] =?UTF-8?q?pdbs=20f=C3=BCrs=20debuggen=20im=20wsl=20ak?= =?UTF-8?q?tiviert,=20l=C3=B6st=20auch=20gleich=20das=20analyse=20Problem?= =?UTF-8?q?=20beim=20Suchen=20der=20ModelTokens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CompiledHandlebars.Cli2/Program.cs | 29 ++++++++++++++++---- Compiler/CompiledHandlebars.Compiler.csproj | 6 ++++ Compiler/Introspection/RoslynIntrospector.cs | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CompiledHandlebars.Cli2/Program.cs b/CompiledHandlebars.Cli2/Program.cs index e579f1f..113ed87 100644 --- a/CompiledHandlebars.Cli2/Program.cs +++ b/CompiledHandlebars.Cli2/Program.cs @@ -10,6 +10,8 @@ using System.Linq; using Buildalyzer.Workspaces; using Buildalyzer; +using Buildalyzer.Environment; +using Microsoft.Extensions.Logging; namespace CompiledHandlebars.Core.Cli { @@ -149,6 +151,9 @@ private static void PrintUnknownExtension(string ext) private static void CompileProject(CompilerOptions options) { Console.WriteLine($"Loading project '{options.ProjectFile}'..."); + //string x = Console.ReadLine(); + Stopwatch sw = new Stopwatch(); + sw.Start(); var properties = new Dictionary() { { "AdditionalFileItemNames", "none" } }; @@ -158,19 +163,33 @@ private static void CompileProject(CompilerOptions options) List handlebarsFiles; if (options.NetCoreProject) { + StringWriter log = new StringWriter(); try { - AnalyzerManager manager = new AnalyzerManager(); + AnalyzerManagerOptions analyzerOptions = new AnalyzerManagerOptions + { + LogWriter = log + }; + AnalyzerManager manager = new AnalyzerManager(analyzerOptions); IProjectAnalyzer analyzer = manager.GetProject(options.ProjectFile); + workspace = analyzer.GetWorkspace(); + //ILogger logger = manager.LoggerFactory?.CreateLogger(); + //workspace = new AdhocWorkspace(); + //workspace.WorkspaceChanged += (sender, args) => logger?.LogDebug($"Workspace changed: {args.Kind.ToString()}{System.Environment.NewLine}"); + //workspace.WorkspaceFailed += (sender, args) => logger?.LogError($"Workspace failed: {args.Diagnostic}{System.Environment.NewLine}"); + //analyzer.Build(new EnvironmentOptions() { Restore = true }).FirstOrDefault().AddToWorkspace(workspace); + project = workspace.CurrentSolution.Projects.ElementAt(0); - Console.WriteLine("Ok!"); + sw.Stop(); + Console.WriteLine($"Ok! {sw.Elapsed}"); + Console.WriteLine($"Log: {log.ToString()}"); handlebarsFiles = new DirectoryInfo(Path.GetDirectoryName(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), options.ProjectFile)))).GetFiles("*.hbs", SearchOption.AllDirectories).Where(f => ShouldCompileFile(f.FullName, options)).Select(f => f.FullName).ToList(); } catch (Exception ex) { - Console.WriteLine($"Following errors occured: {Environment.NewLine}{ex}"); + Console.WriteLine($"Following errors occured: {Environment.NewLine}{ex} - {log.ToString()}"); throw; } } @@ -275,7 +294,7 @@ private static void CompileSolution(CompilerOptions options) if (handlebarsFiles.Count > 0) anyHbsFilesFound = true; } - + if (handlebarsFiles.Any()) { workspace = CompileHandlebarsFiles(project, workspace, handlebarsFiles, options); @@ -420,7 +439,7 @@ private static Workspace CompileHandlebarsFiles(Project project, Workspace works private static void PrintError(HandlebarsException error) { - Console.Error.WriteLine($"Compilation failed: {error.Message}"); + Console.Error.WriteLine($"*** Compilation failed: {error.Message}"); } /// diff --git a/Compiler/CompiledHandlebars.Compiler.csproj b/Compiler/CompiledHandlebars.Compiler.csproj index e9f021c..45d39f4 100644 --- a/Compiler/CompiledHandlebars.Compiler.csproj +++ b/Compiler/CompiledHandlebars.Compiler.csproj @@ -24,6 +24,12 @@ true true + + portable + + + portable + diff --git a/Compiler/Introspection/RoslynIntrospector.cs b/Compiler/Introspection/RoslynIntrospector.cs index 6f975fe..f39538c 100644 --- a/Compiler/Introspection/RoslynIntrospector.cs +++ b/Compiler/Introspection/RoslynIntrospector.cs @@ -68,7 +68,7 @@ private Compilation GetCompilationForProject(Project proj) Compilation comp; if (proj.TryGetCompilation(out comp)) return comp; - else return proj.GetCompilationAsync().Result; + else return proj.GetCompilationAsync().GetAwaiter().GetResult(); } public INamedTypeSymbol GetTypeSymbol(string fullTypeName) From d3a8f124c44b4f8a7a4ebcff5370f31ead04b512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Graus?= Date: Thu, 13 Apr 2023 13:15:38 +0200 Subject: [PATCH 3/5] doku --- CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml index 3387865..1b4d141 100644 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml @@ -12,7 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. linux-x64 false false - + en \ No newline at end of file From 94d650f81b5a4c90c02246228cd28946d0682bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Graus?= Date: Fri, 18 Oct 2024 18:43:22 +0200 Subject: [PATCH 4/5] .net8 --- .../CompiledHandlebars.Core.Cli.csproj | 18 ++--- CompiledHandlebars.Cli2/Program.cs | 77 ++++++++++++++++--- .../Properties/PublishProfiles/linux.pubxml | 2 +- .../Properties/PublishProfiles/windows.pubxml | 5 +- Compiler/CompiledHandlebars.Compiler.csproj | 8 +- 5 files changed, 84 insertions(+), 26 deletions(-) diff --git a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj index 11d993d..2723816 100644 --- a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj +++ b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj @@ -2,23 +2,23 @@ Exe - net7.0 + net8.0 AnyCPU;x64 CompiledHandlebars.Core.Cli.Program default - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/CompiledHandlebars.Cli2/Program.cs b/CompiledHandlebars.Cli2/Program.cs index 113ed87..f12cab9 100644 --- a/CompiledHandlebars.Cli2/Program.cs +++ b/CompiledHandlebars.Cli2/Program.cs @@ -127,6 +127,16 @@ public static int Main(string[] args) Console.WriteLine(outerEx); return -1; } + + if (_ExitCode == 0) + Console.WriteLine("Compilation successful!"); + else + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Error.WriteLine($"Compilation failed"); + Console.ResetColor(); + } + Console.WriteLine($"Exit-Code: {_ExitCode}"); return _ExitCode; } @@ -174,17 +184,50 @@ private static void CompileProject(CompilerOptions options) IProjectAnalyzer analyzer = manager.GetProject(options.ProjectFile); - workspace = analyzer.GetWorkspace(); - //ILogger logger = manager.LoggerFactory?.CreateLogger(); - //workspace = new AdhocWorkspace(); - //workspace.WorkspaceChanged += (sender, args) => logger?.LogDebug($"Workspace changed: {args.Kind.ToString()}{System.Environment.NewLine}"); - //workspace.WorkspaceFailed += (sender, args) => logger?.LogError($"Workspace failed: {args.Diagnostic}{System.Environment.NewLine}"); - //analyzer.Build(new EnvironmentOptions() { Restore = true }).FirstOrDefault().AddToWorkspace(workspace); + //workspace = analyzer.GetWorkspace(); + ILogger logger = manager.LoggerFactory?.CreateLogger(); + workspace = new AdhocWorkspace(); + workspace.WorkspaceChanged += (sender, args) => logger?.LogDebug($"Workspace changed: {args.Kind.ToString()}{System.Environment.NewLine}"); + workspace.WorkspaceFailed += (sender, args) => logger?.LogError($"Workspace failed: {args.Diagnostic}{System.Environment.NewLine}"); + IAnalyzerResult ar = analyzer.Build(new EnvironmentOptions() { Restore = true }).FirstOrDefault(); + ar.AddToWorkspace(workspace); + Console.WriteLine($"AR: {ar.References.Length}"); + //foreach (string s in ar.References) + //{ + // if (File.Exists(s)) + // { + // PortableExecutableReference ss = MetadataReference.CreateFromFile(s); + // if (ss != null) + // {// Console.WriteLine($"MeRef: {ss.FilePath}"); + // } + // else + // Console.WriteLine($"*no Ref: {s}"); + // } + // else + // Console.WriteLine($"*not exist: {s}"); + //} project = workspace.CurrentSolution.Projects.ElementAt(0); sw.Stop(); Console.WriteLine($"Ok! {sw.Elapsed}"); - Console.WriteLine($"Log: {log.ToString()}"); + //Console.WriteLine($"Log: {log}"); + //Console.WriteLine($"Project document count: {project.DocumentIds.Count}"); + //Console.WriteLine($"MetadataReferences count: {project.MetadataReferences.Count}"); + + ////test stiwa + //Document d1 = project.Documents.FirstOrDefault(i => i.Name == "IPageModel.cs"); + //Document d2 = project.Documents.FirstOrDefault(i => i.Name == "AdminController.cs"); + + //Console.WriteLine($"d1: {d1 != null}"); + //Console.WriteLine($"d2: {d2 != null}"); + + //Compilation c1 = project.GetCompilationAsync().GetAwaiter().GetResult(); + //INamedTypeSymbol symbol = c1.GetTypeByMetadataName("StiftungWarentest.Website.Models.Page.IPageModel"); + //Console.WriteLine($"symbol: {symbol != null}"); + + //MetadataReference a = project.MetadataReferences.FirstOrDefault(m => m.Display.Contains("StiftungWarentest.Website.Models.dll")); + //Console.WriteLine($"MetadataReference: {a != null}"); + handlebarsFiles = new DirectoryInfo(Path.GetDirectoryName(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), options.ProjectFile)))).GetFiles("*.hbs", SearchOption.AllDirectories).Where(f => ShouldCompileFile(f.FullName, options)).Select(f => f.FullName).ToList(); } catch (Exception ex) @@ -430,7 +473,9 @@ private static Workspace CompileHandlebarsFiles(Project project, Workspace works { foreach (var err in partialErrors) { - Console.Error.WriteLine(err); + Console.ForegroundColor = ConsoleColor.Red; + Console.Error.WriteLine($"*** {err}"); + Console.ResetColor(); } } } @@ -439,7 +484,9 @@ private static Workspace CompileHandlebarsFiles(Project project, Workspace works private static void PrintError(HandlebarsException error) { + Console.ForegroundColor = ConsoleColor.Red; Console.Error.WriteLine($"*** Compilation failed: {error.Message}"); + Console.ResetColor(); } /// @@ -460,8 +507,18 @@ private static Tuple> CompileHandlebars } else { - Console.WriteLine($"Compiling '{name}' ({@namespace})"); - return HbsCompiler.Compile(content, @namespace, name, containingProject); + Tuple> result = HbsCompiler.Compile(content, @namespace, name, containingProject); + bool hasError = !options.DryRun && (result?.Item2?.Any() ?? false); + if (hasError) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine($"*** Compiling '{name}' ({@namespace})"); + Console.ResetColor(); + } + else + Console.WriteLine($"Compiling '{name}' ({@namespace})"); + + return result; } } diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml index 1b4d141..8b8bb5e 100644 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 C:\D\hbc\linux FileSystem - net7.0 + net8.0 linux-x64 false false diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml index 42ab987..a009e77 100644 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml @@ -8,10 +8,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Any CPU C:\D\hbc\windows FileSystem - net7.0 + net8.0 win-x64 false - false + false + true en diff --git a/Compiler/CompiledHandlebars.Compiler.csproj b/Compiler/CompiledHandlebars.Compiler.csproj index 45d39f4..2ca0be6 100644 --- a/Compiler/CompiledHandlebars.Compiler.csproj +++ b/Compiler/CompiledHandlebars.Compiler.csproj @@ -34,13 +34,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From b72793b1a631799dc060f76dbff9255d57e00b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Graus?= Date: Fri, 16 Jan 2026 11:52:18 +0100 Subject: [PATCH 5/5] Hebung auf .net 10 --- .../CompiledHandlebars.Core.Cli.csproj | 22 +++++------ .../Properties/PublishProfiles/linux.pubxml | 2 +- .../Properties/PublishProfiles/windows.pubxml | 2 +- .../Properties/launchSettings.json | 11 +++++- Compiler/CompiledHandlebars.Compiler.csproj | 8 ++-- Compiler/NamespaceUtility.cs | 38 +++++++++---------- 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj index 2723816..19abc10 100644 --- a/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj +++ b/CompiledHandlebars.Cli2/CompiledHandlebars.Core.Cli.csproj @@ -2,26 +2,24 @@ Exe - net8.0 + net10.0 AnyCPU;x64 CompiledHandlebars.Core.Cli.Program default - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml index 8b8bb5e..fd6fe38 100644 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/linux.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 C:\D\hbc\linux FileSystem - net8.0 + net10.0 linux-x64 false false diff --git a/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml index a009e77..78dbabd 100644 --- a/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml +++ b/CompiledHandlebars.Cli2/Properties/PublishProfiles/windows.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Any CPU C:\D\hbc\windows FileSystem - net8.0 + net10.0 win-x64 false false diff --git a/CompiledHandlebars.Cli2/Properties/launchSettings.json b/CompiledHandlebars.Cli2/Properties/launchSettings.json index eec448e..f77010f 100644 --- a/CompiledHandlebars.Cli2/Properties/launchSettings.json +++ b/CompiledHandlebars.Cli2/Properties/launchSettings.json @@ -2,12 +2,19 @@ "profiles": { "CompiledHandlebars.Cli2": { "commandName": "Project", - "commandLineArgs": "-c -d -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\node_modules -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\assets C:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj" + // "commandLineArgsOld": "-c -d -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\node_modules -eC:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\assets C:\\dev\\Repos\\StiftungWarentest.Web\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj", + + // "commandLineArgs": "-c -d C:\\dev\\Repos\\Stiwa2\\website\\src\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj" + "commandLineArgs": "-c -d C:\\dev\\Repos\\Stiwa3\\mono\\website\\src\\StiftungWarentest.Website\\StiftungWarentest.Website.csproj" }, "WSL": { "commandName": "WSL2", "distributionName": "", - "commandLineArgs": "CompiledHandlebars.Core.Cli.dll -c -d -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/node_modules -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/assets /mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/StiftungWarentest.Website.csproj" + // "commandLineArgsOld": "CompiledHandlebars.Core.Cli.dll -c -d -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/ViewsRelaunch -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/Views/Module -e/mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/Views/Shared /mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/StiftungWarentest.Website.csproj", + // "commandLineArgsNew": "CompiledHandlebars.Core.Cli.dll -c -d -e/mnt/c/dev/Repos/Stiwa/Web/website/src/StiftungWarentest.Website/ViewsRelaunch -e/mnt/c/dev/Repos/Stiwa/Web/website/src/StiftungWarentest.Website/Views/Module -e/mnt/c/dev/Repos/Stiwa/Web/website/src/StiftungWarentest.Website/Views/Shared /mnt/c/dev/Repos/Stiwa/Web/website/src/StiftungWarentest.Website/StiftungWarentest.Website.csproj", + //"commandLineArgs": "CompiledHandlebars.Core.Cli.dll -c -d /mnt/c/dev/Repos/Stiwa2/website/src/StiftungWarentest.Website/StiftungWarentest.Website.csproj", + "commandLineArgs": "CompiledHandlebars.Core.Cli.dll -c -d /mnt/c/dev/Repos/Stiwa3/mono/website/src/StiftungWarentest.Website/StiftungWarentest.Website.csproj" + // "commandLineArgsAllOld": "CompiledHandlebars.Core.Cli.dll -c -d /mnt/c/dev/Repos/StiftungWarentest.Web/StiftungWarentest.Website/StiftungWarentest.Website.csproj" } } } \ No newline at end of file diff --git a/Compiler/CompiledHandlebars.Compiler.csproj b/Compiler/CompiledHandlebars.Compiler.csproj index 2ca0be6..c8a3f8d 100644 --- a/Compiler/CompiledHandlebars.Compiler.csproj +++ b/Compiler/CompiledHandlebars.Compiler.csproj @@ -34,13 +34,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/Compiler/NamespaceUtility.cs b/Compiler/NamespaceUtility.cs index 3dc469c..57d1076 100644 --- a/Compiler/NamespaceUtility.cs +++ b/Compiler/NamespaceUtility.cs @@ -2,29 +2,25 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Text; using System.Threading.Tasks; namespace CompiledHandlebars.Compiler { - public static class NamespaceUtility - { - - public static bool IsPartOf(string fullNamespace, string partNamespace) - { - var partParts = partNamespace.Split('.').Reverse().ToList(); - var fullParts = fullNamespace.Split('.').Reverse().ToList(); - Debug.Assert(partParts.Count <= fullParts.Count, "PartNamespace is longer than FullNamespace"); - if (partParts.Count > fullParts.Count) - return false; - for (int i = 0; i < partParts.Count; i++) - { - if (!partParts[i].Equals(fullParts[i])) - return false; - } - return true; - } - - - } + public static class NamespaceUtility + { + public static bool IsPartOf(string fullNamespace, string partNamespace) + { + List partParts = partNamespace.Split('.').AsEnumerable().Reverse().ToList(); + List fullParts = fullNamespace.Split('.').AsEnumerable().Reverse().ToList(); + Debug.Assert(partParts.Count <= fullParts.Count, "PartNamespace is longer than FullNamespace"); + if (partParts.Count > fullParts.Count) + return false; + for (int i = 0; i < partParts.Count; i++) + { + if (!partParts[i].Equals(fullParts[i])) + return false; + } + return true; + } + } }