From 8c20e23ea616a4fb449daa3f114c11ffbcb2bf65 Mon Sep 17 00:00:00 2001 From: Loretta Date: Tue, 19 May 2026 17:41:06 +0200 Subject: [PATCH] Add SGenOnly build config and centralize build settings Introduced a new "SGenOnly" build configuration across the solution, updating Directory.Build.props, AyCode.Core.targets, and the .sln file for full support. Centralized TargetFramework and build properties in AyCode.Core.targets, removing redundancy from project files. Updated code to recognize SGEN_ONLY at compile time. Added new Bash commands for file conversion and cleanup. No functional code changes outside build and configuration logic. --- .claude/settings.local.json | 7 +- AyCode.Benchmark/AyCode.Benchmark.csproj | 7 +- AyCode.Benchmark/BdnSummaryAdapter.cs | 2 + .../AyCode.Core.Serializers.Console.csproj | 5 +- .../Configuration.cs | 2 + ...de.Core.Serializers.SourceGenerator.csproj | Bin 1024 -> 574 bytes AyCode.Core.sln | 131 ++++++++++++++++++ AyCode.Core.targets | 12 +- AyCode.Core/AyCode.Core.csproj | 5 - Directory.Build.props | 8 ++ 10 files changed, 163 insertions(+), 16 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index a19f281..6acd6b6 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -111,7 +111,12 @@ "Bash(xargs -I {} stat -c '%y %s %n' {})", "Bash(xargs -I {} stat -c '%y %n' {})", "Bash(find \"H:/Applications\" -maxdepth 4 -name \"*.sln\" -o -name \"*.slnx\" -o -name \"*.slnf\" 2>/dev/null | head -20)", - "Bash(rm -rf \"H:/Applications/Mango/Source/FruitBankHybridApp/FruitBank.Common/obj\"; dotnet build \"H:/Applications/Mango/Source/FruitBankHybridApp/FruitBank.Common/FruitBank.Common.csproj\" -c Debug -p:EmitCompilerGeneratedFiles=true 2>&1 | tail -15)" + "Bash(rm -rf \"H:/Applications/Mango/Source/FruitBankHybridApp/FruitBank.Common/obj\"; dotnet build \"H:/Applications/Mango/Source/FruitBankHybridApp/FruitBank.Common/FruitBank.Common.csproj\" -c Debug -p:EmitCompilerGeneratedFiles=true 2>&1 | tail -15)", + "Bash(xxd)", + "Bash(iconv -f UTF-16LE -t UTF-8 \"AyCode.Core.Serializers.SourceGenerator.csproj\")", + "Bash(mv \"AyCode.Core.Serializers.SourceGenerator.csproj.utf8\" \"AyCode.Core.Serializers.SourceGenerator.csproj\")", + "Bash(rm -rf .vs/AyCode.Core/v17 .vs/AyCode.Core/v16 .vs/ProjectEvaluation .vs/CopilotSnapshots)", + "Bash(find .vs -maxdepth 2 -type d)" ] } } diff --git a/AyCode.Benchmark/AyCode.Benchmark.csproj b/AyCode.Benchmark/AyCode.Benchmark.csproj index 8976b96..b2d52f5 100644 --- a/AyCode.Benchmark/AyCode.Benchmark.csproj +++ b/AyCode.Benchmark/AyCode.Benchmark.csproj @@ -1,12 +1,11 @@  - net9.0 - Exe - enable - enable + Exe + + diff --git a/AyCode.Benchmark/BdnSummaryAdapter.cs b/AyCode.Benchmark/BdnSummaryAdapter.cs index 746a970..2396492 100644 --- a/AyCode.Benchmark/BdnSummaryAdapter.cs +++ b/AyCode.Benchmark/BdnSummaryAdapter.cs @@ -52,6 +52,8 @@ public static class BdnSummaryAdapter { #if DEBUG const string buildConfig = "Debug"; +#elif SGEN_ONLY + const string buildConfig = "SGenOnly"; #else const string buildConfig = "Release"; #endif diff --git a/AyCode.Core.Serializers.Console/AyCode.Core.Serializers.Console.csproj b/AyCode.Core.Serializers.Console/AyCode.Core.Serializers.Console.csproj index 4f446a9..c25ae70 100644 --- a/AyCode.Core.Serializers.Console/AyCode.Core.Serializers.Console.csproj +++ b/AyCode.Core.Serializers.Console/AyCode.Core.Serializers.Console.csproj @@ -14,12 +14,11 @@ Exe - net9.0 - enable - enable AyCode.Core.Serializers.Console.Program + + - - net9.0 + + net10.0 enable enable - Debug;Release;Product bin\$(_ProjectName) + + + $(DefineConstants);SGEN_ONLY + true + portable + true + \ No newline at end of file diff --git a/AyCode.Core/AyCode.Core.csproj b/AyCode.Core/AyCode.Core.csproj index e375b4f..033c180 100644 --- a/AyCode.Core/AyCode.Core.csproj +++ b/AyCode.Core/AyCode.Core.csproj @@ -1,9 +1,4 @@ - - - net10.0 - - diff --git a/Directory.Build.props b/Directory.Build.props index 451cee4..e862e62 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,5 +11,13 @@ $(TestResultsDirectory) + + + Debug;Release;Product;SGenOnly \ No newline at end of file