From 0993d7b9a86910b842ab50bace19003c0778dc64 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Thu, 19 Nov 2026 11:36:53 +1100 Subject: [PATCH 1/2] build: share plugin defaults and independent version discovery Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CONTRIBUTING.md | 7 +++++++ eng/Test-Repository.ps1 | 13 +++++++++++++ plugins/Directory.Build.props | 9 +++++++++ plugins/Launcher.MQTT/Directory.Build.props | 5 +---- ...LANCommander.Community.Launcher.MQTT.Core.csproj | 3 --- ...mmander.Community.Launcher.MQTT.Transport.csproj | 3 --- .../LANCommander.Community.Launcher.MQTT.csproj | 3 --- ...mander.Community.Launcher.MQTT.Core.Tests.csproj | 3 --- ....Community.Launcher.MQTT.HostLoader.Tests.csproj | 3 --- plugins/Server.Mcp/Directory.Build.props | 8 -------- .../LANCommander.Community.Server.Mcp.csproj | 4 ---- .../LANCommander.Community.Server.Mcp.Tests.csproj | 4 ---- plugins/Server.Quake3/Directory.Build.props | 4 +--- plugins/Server.RecompCatalog/Directory.Build.props | 5 +---- ...ander.Community.Server.RecompCatalog.Core.csproj | 4 ---- ...unity.Server.RecompCatalog.Infrastructure.csproj | 4 ---- ....Community.Server.RecompCatalog.Providers.csproj | 4 ---- ...nder.Community.Server.RecompCatalog.Tests.csproj | 4 ---- ...NCommander.Community.Server.RecompCatalog.csproj | 4 ---- 19 files changed, 32 insertions(+), 62 deletions(-) create mode 100644 plugins/Directory.Build.props delete mode 100644 plugins/Server.Mcp/Directory.Build.props diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 967e4ab..87c7900 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,6 +18,13 @@ and explicit replacement instructions; never rewrite published versions. Keep Home Assistant discovery as the HA-specific integration layer; Launcher.MQTT's command/state protocol is usable by other MQTT clients too. +Shared compiler and package defaults live in the root `Directory.Build.props`. +`plugins/Directory.Build.props` imports them and reads the nearest component +`version.txt` for both entry and helper/test projects, keeping component versions +independent. Component-level props should contain only exceptions and import +the shared plugin props. Do not copy shared defaults into individual projects; +keep component-specific packaging and host runtime exclusions in their projects. + Before submitting changes, run the repository checks and the validation command(s) for affected components from the root [README](README.md#build-and-validate). See [Plugin releases](RELEASES.md) for versioning, packaging, and release diff --git a/eng/Test-Repository.ps1 b/eng/Test-Repository.ps1 index 4bde140..fb55a18 100644 --- a/eng/Test-Repository.ps1 +++ b/eng/Test-Repository.ps1 @@ -82,6 +82,19 @@ foreach ($project in $allProjects) { if ($packageId -and $packageId -cne $projectName) { throw "Project '$($project.FullName)' overrides PackageId '$packageId'; expected '$projectName'." } + + $evaluation = & dotnet msbuild $project.FullName -nologo ` + -getProperty:TargetFramework,ImplicitUsings,Nullable,TreatWarningsAsErrors,Version,PackageVersion,IsPackable + if ($LASTEXITCODE -ne 0) { throw "Could not evaluate build defaults for '$projectName'." } + $properties = ($evaluation -join "`n" | ConvertFrom-Json).Properties + $expectedVersion = Get-PluginVersion $component[0] + if ($properties.TargetFramework -cne 'net10.0' -or + $properties.ImplicitUsings -cne 'enable' -or $properties.Nullable -cne 'enable' -or + $properties.TreatWarningsAsErrors -cne 'true' -or + $properties.Version -cne $expectedVersion -or $properties.PackageVersion -cne $expectedVersion -or + $properties.IsPackable -cne ($projectName -ceq $componentRoot).ToString().ToLowerInvariant()) { + throw "Project '$projectName' lost shared defaults, component version, or packaging isolation." + } } $requiredFiles = @( diff --git a/plugins/Directory.Build.props b/plugins/Directory.Build.props new file mode 100644 index 0000000..e8575fa --- /dev/null +++ b/plugins/Directory.Build.props @@ -0,0 +1,9 @@ + + + + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'version.txt')) + $([System.IO.File]::ReadAllText('$(PluginDirectory)/version.txt').Trim()) + $(PluginVersion) + $(PluginVersion) + + diff --git a/plugins/Launcher.MQTT/Directory.Build.props b/plugins/Launcher.MQTT/Directory.Build.props index f889870..3cdbb86 100644 --- a/plugins/Launcher.MQTT/Directory.Build.props +++ b/plugins/Launcher.MQTT/Directory.Build.props @@ -1,9 +1,6 @@ - + - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim()) - $(PluginVersion) - $(PluginVersion) $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj index 819f99e..1fb6f86 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj @@ -2,8 +2,5 @@ LANCommander.Community.Launcher.MQTT.Core LANCommander.Community.Launcher.MQTT.Core - net10.0 - enable - enable diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj index faafc15..f7b4b20 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj @@ -2,9 +2,6 @@ LANCommander.Community.Launcher.MQTT.Transport LANCommander.Community.Launcher.MQTT.Transport - net10.0 - enable - enable diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj index 830b525..f614cde 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj @@ -3,9 +3,6 @@ LANCommander.Community.Launcher.MQTT LANCommander.Community.Launcher.MQTT LANCommander.Community.Launcher.MQTT - net10.0 - enable - enable true Generic MQTT command and state integration for the LANCommander GUI Launcher, with Home Assistant discovery. https://github.com/LANCommander/LANCommander.Community diff --git a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj index 52f4cb4..4b441c6 100644 --- a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj +++ b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj @@ -2,9 +2,6 @@ LANCommander.Community.Launcher.MQTT.Core.Tests LANCommander.Community.Launcher.MQTT.Core.Tests - net10.0 - enable - enable false true diff --git a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj index bc7a201..bd49d44 100644 --- a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj +++ b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj @@ -2,9 +2,6 @@ LANCommander.Community.Launcher.MQTT.HostLoader.Tests LANCommander.Community.Launcher.MQTT.HostLoader.Tests - net10.0 - enable - enable false true $(LANCOMMANDER_SOURCE_ROOT) diff --git a/plugins/Server.Mcp/Directory.Build.props b/plugins/Server.Mcp/Directory.Build.props deleted file mode 100644 index f8872cc..0000000 --- a/plugins/Server.Mcp/Directory.Build.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim()) - $(PluginVersion) - $(PluginVersion) - - diff --git a/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj b/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj index ee55c4a..403d4bf 100644 --- a/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj +++ b/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj @@ -1,9 +1,5 @@ - net10.0 - enable - enable - true true LANCommander.Community.Server.Mcp LANCommander.Community.Server.Mcp diff --git a/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj b/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj index afd73a3..f1ed273 100644 --- a/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj +++ b/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj @@ -2,10 +2,6 @@ LANCommander.Community.Server.Mcp.Tests LANCommander.Community.Server.Mcp.Tests - net10.0 - enable - enable - true false true diff --git a/plugins/Server.Quake3/Directory.Build.props b/plugins/Server.Quake3/Directory.Build.props index 2b5f207..0776725 100644 --- a/plugins/Server.Quake3/Directory.Build.props +++ b/plugins/Server.Quake3/Directory.Build.props @@ -1,8 +1,6 @@ - + - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim()) - $(Version) $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 diff --git a/plugins/Server.RecompCatalog/Directory.Build.props b/plugins/Server.RecompCatalog/Directory.Build.props index 7e02061..6026ef7 100644 --- a/plugins/Server.RecompCatalog/Directory.Build.props +++ b/plugins/Server.RecompCatalog/Directory.Build.props @@ -1,9 +1,6 @@ - + - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim()) - $(PluginVersion) - $(PluginVersion) $(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904 diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj index 4f1c611..02a1572 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj @@ -3,10 +3,6 @@ LANCommander.Community.Server.RecompCatalog.Core LANCommander.Community.Server.RecompCatalog.Core - net10.0 - enable - enable - true diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj index ebf29f5..c845493 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj @@ -3,10 +3,6 @@ LANCommander.Community.Server.RecompCatalog.Infrastructure LANCommander.Community.Server.RecompCatalog.Infrastructure - net10.0 - enable - enable - true diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj index cba3fc0..63600ae 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj @@ -3,10 +3,6 @@ LANCommander.Community.Server.RecompCatalog.Providers LANCommander.Community.Server.RecompCatalog.Providers - net10.0 - enable - enable - true diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj index 815c2dd..4bfdbef 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj @@ -3,11 +3,7 @@ LANCommander.Community.Server.RecompCatalog.Tests LANCommander.Community.Server.RecompCatalog.Tests - net10.0 - enable - enable false - true diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj index 7dc0c8f..e89d269 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj @@ -1,12 +1,8 @@ - net10.0 LANCommander.Community.Server.RecompCatalog LANCommander.Community.Server.RecompCatalog - enable - enable - true true LANCommander.Community.Server.RecompCatalog Aaron Powell From f2ece7108179101ae6ddeab2ea30994c43da62f6 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Fri, 20 Nov 2026 14:15:37 +1100 Subject: [PATCH 2/2] build: derive plugin identities from project filenames Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../skills/create-launcher-plugin/SKILL.md | 6 +-- .github/skills/create-server-plugin/SKILL.md | 6 +-- .github/skills/plugin-maintenance/SKILL.md | 4 +- CONTRIBUTING.md | 7 ++-- eng/Test-Repository.ps1 | 39 ++++--------------- ...mander.Community.Launcher.MQTT.Core.csproj | 4 -- ...r.Community.Launcher.MQTT.Transport.csproj | 4 -- ...ANCommander.Community.Launcher.MQTT.csproj | 3 -- ....Community.Launcher.MQTT.Core.Tests.csproj | 2 - ...nity.Launcher.MQTT.HostLoader.Tests.csproj | 2 - .../LANCommander.Community.Server.Mcp.csproj | 3 -- ...ommander.Community.Server.Mcp.Tests.csproj | 2 - ...mander.Community.Server.Quake3.Core.csproj | 2 - ....Community.Server.Quake3.Host.Tests.csproj | 2 - ...ander.Community.Server.Quake3.Tests.csproj | 2 - ...ANCommander.Community.Server.Quake3.csproj | 3 -- ...Community.Server.RecompCatalog.Core.csproj | 4 -- ...Server.RecompCatalog.Infrastructure.csproj | 4 -- ...nity.Server.RecompCatalog.Providers.csproj | 4 -- ...ommunity.Server.RecompCatalog.Tests.csproj | 2 - ...nder.Community.Server.RecompCatalog.csproj | 3 -- 21 files changed, 20 insertions(+), 88 deletions(-) diff --git a/.github/skills/create-launcher-plugin/SKILL.md b/.github/skills/create-launcher-plugin/SKILL.md index ffc7611..d3e8698 100644 --- a/.github/skills/create-launcher-plugin/SKILL.md +++ b/.github/skills/create-launcher-plugin/SKILL.md @@ -31,9 +31,9 @@ packaging/storage, not a requirement to add MQTT or Home Assistant. mutable checkout or fabricate NuGet adapters for missing contracts. 3. Choose key `Launcher.` and root `LANCommander.Community.Launcher.`. Under `plugins\Launcher.`, - use `src\\.csproj`; directory, project basename, explicit - `PackageId`, `AssemblyName`, `RootNamespace` all equal the root with exact - casing and **no `.Plugin` suffix**. Put host-independent logic and transports + use `src\\.csproj` with exact casing and **no `.Plugin` suffix**. + Let SDK defaults derive `PackageId`, `AssemblyName` and `RootNamespace` + from the filename. Put host-independent logic and transports in suffixed helper projects only when needed; keep helpers/tests non-packable. 4. Follow MQTT's component `Directory.Build.props` import/version-file pattern. Use central dependency versions, initial independent full SemVer, matching diff --git a/.github/skills/create-server-plugin/SKILL.md b/.github/skills/create-server-plugin/SKILL.md index 228c883..679654d 100644 --- a/.github/skills/create-server-plugin/SKILL.md +++ b/.github/skills/create-server-plugin/SKILL.md @@ -30,9 +30,9 @@ pipeline. Follow [CONTRIBUTING.md](../../../CONTRIBUTING.md), 3. Use component key `Server.` and root `LANCommander.Community.Server.` with exact casing. Put the entry project below `plugins\Server.` (a `src` directory is optional, as - existing components demonstrate). Its directory, `.csproj` basename, - explicit `PackageId`, `AssemblyName` and `RootNamespace` must all equal that - root: **no `.Plugin` suffix**. Helpers/tests append descriptive suffixes + existing components demonstrate). Name its directory and `.csproj` basename + after that root: **no `.Plugin` suffix**. Let SDK defaults derive `PackageId`, + `AssemblyName` and `RootNamespace` from the filename. Helpers/tests append descriptive suffixes to the same root and remain non-packable. 4. Add component `Directory.Build.props` importing the root defaults and reading `version.txt` for `Version`/`PackageVersion`, following Quake3. diff --git a/.github/skills/plugin-maintenance/SKILL.md b/.github/skills/plugin-maintenance/SKILL.md index 5bb139c..e68d170 100644 --- a/.github/skills/plugin-maintenance/SKILL.md +++ b/.github/skills/plugin-maintenance/SKILL.md @@ -17,8 +17,8 @@ support it. project, package, assembly and root namespace, with no `.Plugin` suffix. Helpers/tests append suffixes to that root and stay non-packable. Use exact `LANCommander` casing for source-owned names. -- Set each owned `AssemblyName` and `PackageId` to the exact current project - name with `LANCommander` casing; do not keep legacy pre-monorepo names as +- Use the exact project filename to derive `AssemblyName`, `RootNamespace` and + `PackageId` through SDK defaults; do not keep legacy pre-monorepo names as active build or package outputs. Preserve semantic plugin IDs, persisted/config keys, MQTT topics/client identity, and HA entity identifiers. If one of those persistent identities must change, require an explicit diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87c7900..6a055ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,9 @@ # Contributing -Use `LANCommander.Community..` for every installable -entry project, `PackageId`, `AssemblyName` and root namespace, with exact -`LANCommander` casing and no `.Plugin` suffix. Helpers/tests may append +Name each installable entry `.csproj` `LANCommander.Community...csproj`, +with exact `LANCommander` casing and no `.Plugin` suffix. Use the SDK defaults +for `AssemblyName`, `RootNamespace` and `PackageId` rather than repeating the +identity in project files or props. Helpers/tests may append `.Core`, `.Infrastructure`, `.Providers`, `.Transport` or `.Tests` (including more focused test suffixes) to that component root and must remain non-packable. Current component roots are: diff --git a/eng/Test-Repository.ps1 b/eng/Test-Repository.ps1 index fb55a18..69bdfb1 100644 --- a/eng/Test-Repository.ps1 +++ b/eng/Test-Repository.ps1 @@ -12,21 +12,6 @@ foreach ($plugin in $plugins) { } [xml] $pluginProjectXml = Get-Content -LiteralPath (Join-Path $repositoryRoot $plugin.project) -Raw - $assemblyName = $pluginProjectXml.Project.PropertyGroup.AssemblyName - $packageId = $pluginProjectXml.Project.PropertyGroup.PackageId - $rootNamespace = $pluginProjectXml.Project.PropertyGroup.RootNamespace - $projectName = [IO.Path]::GetFileNameWithoutExtension($plugin.project) - $componentName = "LANCommander.Community.$($plugin.key)" - if ($rootNamespace -cne $componentName) { - throw "$($plugin.key) entry project and root namespace must be '$componentName' (no .Plugin suffix)." - } - if ($plugin.assemblyName -cne $projectName -or $assemblyName -cne $projectName -or - $plugin.packageId -cne $projectName -or $packageId -cne $projectName) { - throw "$($plugin.key) assembly and package IDs must match its project name '$projectName'." - } - if ($rootNamespace -cne $plugin.rootNamespace -or $rootNamespace -notmatch '^LANCommander\.Community\.') { - throw "$($plugin.key) root namespace does not match the Community naming registry." - } $packageTypes = @(([string]$pluginProjectXml.Project.PropertyGroup.PackageType).Split(';', [StringSplitOptions]::RemoveEmptyEntries)) $expectedTypes = @($plugin.packageTypes) if (@(Compare-Object $expectedTypes $packageTypes).Count -gt 0) { @@ -60,33 +45,25 @@ foreach ($plugin in $plugins) { $allProjects = Get-ChildItem -LiteralPath (Join-Path $repositoryRoot 'plugins') -Filter '*.csproj' -File -Recurse foreach ($project in $allProjects) { - [xml] $projectXml = Get-Content -LiteralPath $project.FullName -Raw $projectName = [IO.Path]::GetFileNameWithoutExtension($project.Name) - $assemblyName = [string]$projectXml.Project.PropertyGroup.AssemblyName - $packageId = [string]$projectXml.Project.PropertyGroup.PackageId $relative = [IO.Path]::GetRelativePath((Join-Path $repositoryRoot 'plugins'), $project.FullName) $componentKey = ($relative -split '[/\\]')[0] $component = @($plugins | Where-Object key -CEQ $componentKey) $componentRoot = "LANCommander.Community.$componentKey" if ($component.Count -ne 1 -or - ($projectName -cne $componentRoot -and -not $projectName.StartsWith("$componentRoot.", [StringComparison]::Ordinal)) -or - [string]$projectXml.Project.PropertyGroup.RootNamespace -cne $projectName) { - throw "Project '$($project.FullName)' must use its registered component root and matching namespace." - } - if ($projectName -cne $componentRoot -and $projectXml.Project.PropertyGroup.IsPackable -eq 'true') { - throw "Helper/test project '$projectName' must not be packable." - } - if ($assemblyName -and $assemblyName -cne $projectName) { - throw "Project '$($project.FullName)' overrides AssemblyName '$assemblyName'; expected '$projectName'." - } - if ($packageId -and $packageId -cne $projectName) { - throw "Project '$($project.FullName)' overrides PackageId '$packageId'; expected '$projectName'." + ($projectName -cne $componentRoot -and -not $projectName.StartsWith("$componentRoot.", [StringComparison]::Ordinal))) { + throw "Project '$($project.FullName)' must use its registered component root." } $evaluation = & dotnet msbuild $project.FullName -nologo ` - -getProperty:TargetFramework,ImplicitUsings,Nullable,TreatWarningsAsErrors,Version,PackageVersion,IsPackable + -getProperty:AssemblyName,RootNamespace,PackageId,TargetFramework,ImplicitUsings,Nullable,TreatWarningsAsErrors,Version,PackageVersion,IsPackable if ($LASTEXITCODE -ne 0) { throw "Could not evaluate build defaults for '$projectName'." } $properties = ($evaluation -join "`n" | ConvertFrom-Json).Properties + foreach ($identity in @('AssemblyName', 'RootNamespace', 'PackageId')) { + if ($properties.$identity -cne $projectName) { + throw "Project '$($project.FullName)' evaluates $identity to '$($properties.$identity)'; expected '$projectName'." + } + } $expectedVersion = Get-PluginVersion $component[0] if ($properties.TargetFramework -cne 'net10.0' -or $properties.ImplicitUsings -cne 'enable' -or $properties.Nullable -cne 'enable' -or diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj index 1fb6f86..35e3d84 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Core/LANCommander.Community.Launcher.MQTT.Core.csproj @@ -1,6 +1,2 @@ - - LANCommander.Community.Launcher.MQTT.Core - LANCommander.Community.Launcher.MQTT.Core - diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj index f7b4b20..62868b1 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT.Transport/LANCommander.Community.Launcher.MQTT.Transport.csproj @@ -1,8 +1,4 @@ - - LANCommander.Community.Launcher.MQTT.Transport - LANCommander.Community.Launcher.MQTT.Transport - diff --git a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj index f614cde..fab21b4 100644 --- a/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj +++ b/plugins/Launcher.MQTT/src/LANCommander.Community.Launcher.MQTT/LANCommander.Community.Launcher.MQTT.csproj @@ -1,8 +1,5 @@ - LANCommander.Community.Launcher.MQTT - LANCommander.Community.Launcher.MQTT - LANCommander.Community.Launcher.MQTT true Generic MQTT command and state integration for the LANCommander GUI Launcher, with Home Assistant discovery. https://github.com/LANCommander/LANCommander.Community diff --git a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj index 4b441c6..7fff724 100644 --- a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj +++ b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.Core.Tests/LANCommander.Community.Launcher.MQTT.Core.Tests.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Launcher.MQTT.Core.Tests - LANCommander.Community.Launcher.MQTT.Core.Tests false true diff --git a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj index bd49d44..9f41a8d 100644 --- a/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj +++ b/plugins/Launcher.MQTT/tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests/LANCommander.Community.Launcher.MQTT.HostLoader.Tests.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Launcher.MQTT.HostLoader.Tests - LANCommander.Community.Launcher.MQTT.HostLoader.Tests false true $(LANCOMMANDER_SOURCE_ROOT) diff --git a/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj b/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj index 403d4bf..b9f57c5 100644 --- a/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj +++ b/plugins/Server.Mcp/src/LANCommander.Community.Server.Mcp/LANCommander.Community.Server.Mcp.csproj @@ -1,9 +1,6 @@ true - LANCommander.Community.Server.Mcp - LANCommander.Community.Server.Mcp - LANCommander.Community.Server.Mcp aaronpowell Administrator-only MCP catalog management for LANCommander servers. MIT diff --git a/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj b/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj index f1ed273..3e897cf 100644 --- a/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj +++ b/plugins/Server.Mcp/tests/LANCommander.Community.Server.Mcp.Tests/LANCommander.Community.Server.Mcp.Tests.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Server.Mcp.Tests - LANCommander.Community.Server.Mcp.Tests false true diff --git a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Core/LANCommander.Community.Server.Quake3.Core.csproj b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Core/LANCommander.Community.Server.Quake3.Core.csproj index 7f18b62..8a9b105 100644 --- a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Core/LANCommander.Community.Server.Quake3.Core.csproj +++ b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Core/LANCommander.Community.Server.Quake3.Core.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Server.Quake3.Core - LANCommander.Community.Server.Quake3.Core false diff --git a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Host.Tests/LANCommander.Community.Server.Quake3.Host.Tests.csproj b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Host.Tests/LANCommander.Community.Server.Quake3.Host.Tests.csproj index 6a619fe..713883a 100644 --- a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Host.Tests/LANCommander.Community.Server.Quake3.Host.Tests.csproj +++ b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Host.Tests/LANCommander.Community.Server.Quake3.Host.Tests.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Server.Quake3.Host.Tests - LANCommander.Community.Server.Quake3.Host.Tests true false diff --git a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Tests/LANCommander.Community.Server.Quake3.Tests.csproj b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Tests/LANCommander.Community.Server.Quake3.Tests.csproj index 99fcdfa..eb0d44e 100644 --- a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Tests/LANCommander.Community.Server.Quake3.Tests.csproj +++ b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3.Tests/LANCommander.Community.Server.Quake3.Tests.csproj @@ -1,7 +1,5 @@ - LANCommander.Community.Server.Quake3.Tests - LANCommander.Community.Server.Quake3.Tests false true diff --git a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3/LANCommander.Community.Server.Quake3.csproj b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3/LANCommander.Community.Server.Quake3.csproj index 2dff768..1180eaa 100644 --- a/plugins/Server.Quake3/LANCommander.Community.Server.Quake3/LANCommander.Community.Server.Quake3.csproj +++ b/plugins/Server.Quake3/LANCommander.Community.Server.Quake3/LANCommander.Community.Server.Quake3.csproj @@ -1,8 +1,5 @@ - LANCommander.Community.Server.Quake3 - LANCommander.Community.Server.Quake3 - LANCommander.Community.Server.Quake3 true Quake 3 Server Manager for LANCommander. README.md diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj index 02a1572..d640885 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Core/LANCommander.Community.Server.RecompCatalog.Core.csproj @@ -1,8 +1,4 @@ - - LANCommander.Community.Server.RecompCatalog.Core - LANCommander.Community.Server.RecompCatalog.Core - diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj index c845493..40f0765 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Infrastructure/LANCommander.Community.Server.RecompCatalog.Infrastructure.csproj @@ -1,9 +1,5 @@ - - LANCommander.Community.Server.RecompCatalog.Infrastructure - LANCommander.Community.Server.RecompCatalog.Infrastructure - diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj index 63600ae..49989dd 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Providers/LANCommander.Community.Server.RecompCatalog.Providers.csproj @@ -1,9 +1,5 @@ - - LANCommander.Community.Server.RecompCatalog.Providers - LANCommander.Community.Server.RecompCatalog.Providers - diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj index 4bfdbef..78eb700 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.Tests/LANCommander.Community.Server.RecompCatalog.Tests.csproj @@ -1,8 +1,6 @@ - LANCommander.Community.Server.RecompCatalog.Tests - LANCommander.Community.Server.RecompCatalog.Tests false diff --git a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj index e89d269..b6c9475 100644 --- a/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj +++ b/plugins/Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog/LANCommander.Community.Server.RecompCatalog.csproj @@ -1,10 +1,7 @@ - LANCommander.Community.Server.RecompCatalog - LANCommander.Community.Server.RecompCatalog true - LANCommander.Community.Server.RecompCatalog Aaron Powell Independent Quiver-compatible recompilation catalog browser and game importer for LANCommander Server. https://github.com/LANCommander/LANCommander.Community/tree/main/plugins/Server.RecompCatalog