From cb6502c8a5fc6808dfbb81f67422c2b8634e4aa9 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 14 Aug 2026 15:19:02 +0200 Subject: [PATCH] =?UTF-8?q?feat(platform):=20Campaign=20LA=20LA0=20?= =?UTF-8?q?=E2=80=94=20extract=20ApplicationPathSet=20to=20AcDream.Platfor?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The launcher (LA3/LA4) needs the XDG/Windows path contract (ApplicationPathSet/IApplicationPathEnvironment) without pulling in any gameplay assembly. Move it out of AcDream.Runtime into a new BCL-only AcDream.Platform project so the launcher-side Launcher.Core project can reference it directly per the campaign plan (docs/plans/2026-08-14-launcher-campaign.md, LA0). Namespace renamed AcDream.Runtime.Platform -> AcDream.Platform; code is otherwise byte-identical (no logic changes). AcDream.Runtime now carries a ProjectReference to AcDream.Platform and re-exports it transitively, so App and Headless keep resolving the type without a direct reference and K0's Headless single-ProjectReference guard (HeadlessAssemblyReferencesOnlyTheRuntimeProject) stands unchanged. The sibling Runtime dependency-boundary guard (RuntimeProjectDeclaresOnlyApprovedProjectDependencies) does assert Runtime's own project-reference set, so it needed a deliberate, documented addition of AcDream.Platform to its expected list. Moved tests/AcDream.Runtime.Tests/Platform/ApplicationPathSetTests.cs to a new tests/AcDream.Platform.Tests/ project (namespace AcDream.Platform.Tests) referencing only AcDream.Platform. Registered both new projects in AcDream.slnx. Co-Authored-By: Claude Fable 5 --- AcDream.slnx | 2 ++ .../Platform/GraphicalHostPlatformServices.cs | 2 +- .../GraphicalLegacyConfigurationMigrator.cs | 2 +- src/AcDream.App/Program.cs | 2 +- src/AcDream.App/Rendering/GameWindow.cs | 2 +- .../Platform/HeadlessPathSet.cs | 2 +- .../Platform/HeadlessPlatformEnvironment.cs | 2 +- src/AcDream.Platform/AcDream.Platform.csproj | 9 ++++++++ .../ApplicationPathSet.cs | 2 +- src/AcDream.Runtime/AcDream.Runtime.csproj | 1 + ...aphicalLegacyConfigurationMigratorTests.cs | 2 +- .../AcDream.Platform.Tests.csproj | 22 +++++++++++++++++++ .../ApplicationPathSetTests.cs | 4 ++-- .../RuntimeDependencyBoundaryTests.cs | 5 +++++ 14 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/AcDream.Platform/AcDream.Platform.csproj rename src/{AcDream.Runtime/Platform => AcDream.Platform}/ApplicationPathSet.cs (99%) create mode 100644 tests/AcDream.Platform.Tests/AcDream.Platform.Tests.csproj rename tests/{AcDream.Runtime.Tests/Platform => AcDream.Platform.Tests}/ApplicationPathSetTests.cs (98%) diff --git a/AcDream.slnx b/AcDream.slnx index d28db1d2..fa90475d 100644 --- a/AcDream.slnx +++ b/AcDream.slnx @@ -7,6 +7,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/src/AcDream.App/Platform/GraphicalHostPlatformServices.cs b/src/AcDream.App/Platform/GraphicalHostPlatformServices.cs index ca466c6d..42d9d373 100644 --- a/src/AcDream.App/Platform/GraphicalHostPlatformServices.cs +++ b/src/AcDream.App/Platform/GraphicalHostPlatformServices.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; using AcDream.App.Rendering; -using AcDream.Runtime.Platform; +using AcDream.Platform; namespace AcDream.App.Platform; diff --git a/src/AcDream.App/Platform/GraphicalLegacyConfigurationMigrator.cs b/src/AcDream.App/Platform/GraphicalLegacyConfigurationMigrator.cs index 8a7e2fd9..b858cb50 100644 --- a/src/AcDream.App/Platform/GraphicalLegacyConfigurationMigrator.cs +++ b/src/AcDream.App/Platform/GraphicalLegacyConfigurationMigrator.cs @@ -1,4 +1,4 @@ -using AcDream.Runtime.Platform; +using AcDream.Platform; namespace AcDream.App.Platform; diff --git a/src/AcDream.App/Program.cs b/src/AcDream.App/Program.cs index 7380feb1..3d46ce90 100644 --- a/src/AcDream.App/Program.cs +++ b/src/AcDream.App/Program.cs @@ -3,7 +3,7 @@ using AcDream.App.Plugins; using AcDream.App.Platform; using AcDream.App.Rendering; using AcDream.Core.Plugins; -using AcDream.Runtime.Platform; +using AcDream.Platform; using Serilog; GraphicalHostPlatformServices graphicalPlatform = diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 8b0839a1..74a61be4 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -8,8 +8,8 @@ using AcDream.App.Settings; using AcDream.App.Platform; using AcDream.App.World; using AcDream.Content; +using AcDream.Platform; using AcDream.Runtime; -using AcDream.Runtime.Platform; using AcDream.Runtime.Entities; using AcDream.Runtime.Gameplay; using AcDream.Runtime.Session; diff --git a/src/AcDream.Headless/Platform/HeadlessPathSet.cs b/src/AcDream.Headless/Platform/HeadlessPathSet.cs index 24059dae..bdbe1866 100644 --- a/src/AcDream.Headless/Platform/HeadlessPathSet.cs +++ b/src/AcDream.Headless/Platform/HeadlessPathSet.cs @@ -1,5 +1,5 @@ using AcDream.Headless.Configuration; -using AcDream.Runtime.Platform; +using AcDream.Platform; namespace AcDream.Headless.Platform; diff --git a/src/AcDream.Headless/Platform/HeadlessPlatformEnvironment.cs b/src/AcDream.Headless/Platform/HeadlessPlatformEnvironment.cs index 220f0571..27cced4a 100644 --- a/src/AcDream.Headless/Platform/HeadlessPlatformEnvironment.cs +++ b/src/AcDream.Headless/Platform/HeadlessPlatformEnvironment.cs @@ -1,4 +1,4 @@ -using AcDream.Runtime.Platform; +using AcDream.Platform; namespace AcDream.Headless.Platform; diff --git a/src/AcDream.Platform/AcDream.Platform.csproj b/src/AcDream.Platform/AcDream.Platform.csproj new file mode 100644 index 00000000..10225ce5 --- /dev/null +++ b/src/AcDream.Platform/AcDream.Platform.csproj @@ -0,0 +1,9 @@ + + + net10.0 + enable + enable + latest + true + + diff --git a/src/AcDream.Runtime/Platform/ApplicationPathSet.cs b/src/AcDream.Platform/ApplicationPathSet.cs similarity index 99% rename from src/AcDream.Runtime/Platform/ApplicationPathSet.cs rename to src/AcDream.Platform/ApplicationPathSet.cs index 6e4ee3d1..a6743ad1 100644 --- a/src/AcDream.Runtime/Platform/ApplicationPathSet.cs +++ b/src/AcDream.Platform/ApplicationPathSet.cs @@ -1,4 +1,4 @@ -namespace AcDream.Runtime.Platform; +namespace AcDream.Platform; /// /// BCL-only view of the process environment used to resolve portable diff --git a/src/AcDream.Runtime/AcDream.Runtime.csproj b/src/AcDream.Runtime/AcDream.Runtime.csproj index b1bc35a5..422184a6 100644 --- a/src/AcDream.Runtime/AcDream.Runtime.csproj +++ b/src/AcDream.Runtime/AcDream.Runtime.csproj @@ -19,6 +19,7 @@ + diff --git a/tests/AcDream.App.Tests/Platform/GraphicalLegacyConfigurationMigratorTests.cs b/tests/AcDream.App.Tests/Platform/GraphicalLegacyConfigurationMigratorTests.cs index 1cccf33c..5889bfd2 100644 --- a/tests/AcDream.App.Tests/Platform/GraphicalLegacyConfigurationMigratorTests.cs +++ b/tests/AcDream.App.Tests/Platform/GraphicalLegacyConfigurationMigratorTests.cs @@ -1,5 +1,5 @@ using AcDream.App.Platform; -using AcDream.Runtime.Platform; +using AcDream.Platform; namespace AcDream.App.Tests.Platform; diff --git a/tests/AcDream.Platform.Tests/AcDream.Platform.Tests.csproj b/tests/AcDream.Platform.Tests/AcDream.Platform.Tests.csproj new file mode 100644 index 00000000..4a538c5b --- /dev/null +++ b/tests/AcDream.Platform.Tests/AcDream.Platform.Tests.csproj @@ -0,0 +1,22 @@ + + + net10.0 + enable + enable + false + latest + true + + + + + + + + + + + + + + diff --git a/tests/AcDream.Runtime.Tests/Platform/ApplicationPathSetTests.cs b/tests/AcDream.Platform.Tests/ApplicationPathSetTests.cs similarity index 98% rename from tests/AcDream.Runtime.Tests/Platform/ApplicationPathSetTests.cs rename to tests/AcDream.Platform.Tests/ApplicationPathSetTests.cs index bbc595c3..7b16a89d 100644 --- a/tests/AcDream.Runtime.Tests/Platform/ApplicationPathSetTests.cs +++ b/tests/AcDream.Platform.Tests/ApplicationPathSetTests.cs @@ -1,6 +1,6 @@ -using AcDream.Runtime.Platform; +using AcDream.Platform; -namespace AcDream.Runtime.Tests.Platform; +namespace AcDream.Platform.Tests; public sealed class ApplicationPathSetTests { diff --git a/tests/AcDream.Runtime.Tests/RuntimeDependencyBoundaryTests.cs b/tests/AcDream.Runtime.Tests/RuntimeDependencyBoundaryTests.cs index 262eb607..d1c65ae6 100644 --- a/tests/AcDream.Runtime.Tests/RuntimeDependencyBoundaryTests.cs +++ b/tests/AcDream.Runtime.Tests/RuntimeDependencyBoundaryTests.cs @@ -72,6 +72,11 @@ public sealed class RuntimeDependencyBoundaryTests "AcDream.Content", "AcDream.Core", "AcDream.Core.Net", + // Campaign LA LA0: AcDream.Platform is the new BCL-only + // ApplicationPathSet home; Runtime re-exports it + // transitively so App/Headless keep reaching it without a + // direct reference. + "AcDream.Platform", "AcDream.Plugin.Abstractions", } .Select(projectName => Path.Combine(