Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/skills/create-launcher-plugin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<Name>` and root
`LANCommander.Community.Launcher.<Name>`. Under `plugins\Launcher.<Name>`,
use `src\<root>\<root>.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\<root>\<root>.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
Expand Down
6 changes: 3 additions & 3 deletions .github/skills/create-server-plugin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pipeline. Follow [CONTRIBUTING.md](../../../CONTRIBUTING.md),
3. Use component key `Server.<Name>` and root
`LANCommander.Community.Server.<Name>` with exact casing. Put the entry
project below `plugins\Server.<Name>` (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.
Expand Down
4 changes: 2 additions & 2 deletions .github/skills/plugin-maintenance/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Contributing

Use `LANCommander.Community.<Server|Launcher>.<Name>` 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.<Server|Launcher>.<Name>.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:
Expand All @@ -18,6 +19,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
Expand Down
46 changes: 18 additions & 28 deletions eng/Test-Repository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -60,27 +45,32 @@ 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."
($projectName -cne $componentRoot -and -not $projectName.StartsWith("$componentRoot.", [StringComparison]::Ordinal))) {
throw "Project '$($project.FullName)' must use its registered component root."
}
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'."

$evaluation = & dotnet msbuild $project.FullName -nologo `
-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'."
}
}
if ($packageId -and $packageId -cne $projectName) {
throw "Project '$($project.FullName)' overrides PackageId '$packageId'; expected '$projectName'."
$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."
}
}

Expand Down
9 changes: 9 additions & 0 deletions plugins/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
<PropertyGroup>
<PluginDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)', 'version.txt'))</PluginDirectory>
<PluginVersion>$([System.IO.File]::ReadAllText('$(PluginDirectory)/version.txt').Trim())</PluginVersion>
<Version>$(PluginVersion)</Version>
<PackageVersion>$(PluginVersion)</PackageVersion>
</PropertyGroup>
</Project>
5 changes: 1 addition & 4 deletions plugins/Launcher.MQTT/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
<PropertyGroup>
<PluginVersion>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim())</PluginVersion>
<Version>$(PluginVersion)</Version>
<PackageVersion>$(PluginVersion)</PackageVersion>
<!-- Preserve audit warnings for host source/package dependencies without making them build blockers. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Launcher.MQTT.Core</RootNamespace>
<AssemblyName>LANCommander.Community.Launcher.MQTT.Core</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Launcher.MQTT.Transport</RootNamespace>
<AssemblyName>LANCommander.Community.Launcher.MQTT.Transport</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="MQTTnet" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Launcher.MQTT</RootNamespace>
<AssemblyName>LANCommander.Community.Launcher.MQTT</AssemblyName>
<PackageId>LANCommander.Community.Launcher.MQTT</PackageId>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>true</IsPackable>
<Description>Generic MQTT command and state integration for the LANCommander GUI Launcher, with Home Assistant discovery.</Description>
<RepositoryUrl>https://github.com/LANCommander/LANCommander.Community</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Launcher.MQTT.Core.Tests</RootNamespace>
<AssemblyName>LANCommander.Community.Launcher.MQTT.Core.Tests</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Launcher.MQTT.HostLoader.Tests</RootNamespace>
<AssemblyName>LANCommander.Community.Launcher.MQTT.HostLoader.Tests</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LANCommanderSourceRoot Condition="'$(LANCommanderSourceRoot)' == ''">$(LANCOMMANDER_SOURCE_ROOT)</LANCommanderSourceRoot>
Expand Down
8 changes: 0 additions & 8 deletions plugins/Server.Mcp/Directory.Build.props

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>true</IsPackable>
<RootNamespace>LANCommander.Community.Server.Mcp</RootNamespace>
<AssemblyName>LANCommander.Community.Server.Mcp</AssemblyName>
<PackageId>LANCommander.Community.Server.Mcp</PackageId>
<Authors>aaronpowell</Authors>
<Description>Administrator-only MCP catalog management for LANCommander servers.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.Mcp.Tests</RootNamespace>
<AssemblyName>LANCommander.Community.Server.Mcp.Tests</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
4 changes: 1 addition & 3 deletions plugins/Server.Quake3/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
<PropertyGroup>
<Version>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim())</Version>
<PackageVersion>$(Version)</PackageVersion>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.Quake3.Core</RootNamespace>
<AssemblyName>LANCommander.Community.Server.Quake3.Core</AssemblyName>
<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>LANCommander.Community.Server.Quake3.Host.Tests</AssemblyName>
<RootNamespace>LANCommander.Community.Server.Quake3.Host.Tests</RootNamespace>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.Quake3.Tests</RootNamespace>
<AssemblyName>LANCommander.Community.Server.Quake3.Tests</AssemblyName>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.Quake3</RootNamespace>
<AssemblyName>LANCommander.Community.Server.Quake3</AssemblyName>
<PackageId>LANCommander.Community.Server.Quake3</PackageId>
<IsPackable>true</IsPackable>
<Description>Quake 3 Server Manager for LANCommander.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
5 changes: 1 addition & 4 deletions plugins/Server.RecompCatalog/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\Directory.Build.props" />
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
<PropertyGroup>
<PluginVersion>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim())</PluginVersion>
<Version>$(PluginVersion)</Version>
<PackageVersion>$(PluginVersion)</PackageVersion>
<!-- Host compile-time dependencies are excluded from the plugin payload; retain their audit findings as warnings. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.RecompCatalog.Core</RootNamespace>
<AssemblyName>LANCommander.Community.Server.RecompCatalog.Core</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.RecompCatalog.Infrastructure</RootNamespace>
<AssemblyName>LANCommander.Community.Server.RecompCatalog.Infrastructure</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\LANCommander.Community.Server.RecompCatalog.Core\LANCommander.Community.Server.RecompCatalog.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.RecompCatalog.Providers</RootNamespace>
<AssemblyName>LANCommander.Community.Server.RecompCatalog.Providers</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\LANCommander.Community.Server.RecompCatalog.Core\LANCommander.Community.Server.RecompCatalog.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootNamespace>LANCommander.Community.Server.RecompCatalog.Tests</RootNamespace>
<AssemblyName>LANCommander.Community.Server.RecompCatalog.Tests</AssemblyName>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>LANCommander.Community.Server.RecompCatalog</RootNamespace>
<AssemblyName>LANCommander.Community.Server.RecompCatalog</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>true</IsPackable>
<PackageId>LANCommander.Community.Server.RecompCatalog</PackageId>
<Authors>Aaron Powell</Authors>
<Description>Independent Quiver-compatible recompilation catalog browser and game importer for LANCommander Server.</Description>
<PackageProjectUrl>https://github.com/LANCommander/LANCommander.Community/tree/main/plugins/Server.RecompCatalog</PackageProjectUrl>
Expand Down
Loading