Skip to content

fix: report a bare platform SDK as shipping an app, not a library [patch] - #133

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/nice-davinci-2z1z4d
Sep 14, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/nice-davinci-2z1z4d

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #131

What was wrong

ShippedVariants.FromProject mapped only the ConsoleApp, App and Tool suffixes to a non-library variant and explicitly ignored Windows, Linux, macOS and Ios, per the remark that "a platform SDK says which platform a project targets rather than what kind of thing it is".

That is true as far as it goes, but those four SDKs also set OutputType themselves — which is exactly what SdkReferencePatterns documents, and why both DotNetService.IsExecutableProject and Winget.ProjectDetector.IsExecutableProject treat a bare <Sdk Name="ktsu.Sdk.Windows" /> as a real executable. ShippedVariants never got the matching update, so a project declaring only ktsu.Sdk + a platform SDK was still reported as lib.

For such a repository, ReleaseService built and attached Windows RID-zip binaries to the GitHub release while the same repository's row in the generated org README showed a lib badge: the public profile page and the release it links to disagreed about what the repository ships.

The change

  • A platform suffix now contributes ShippedVariant.App when no kind suffix is present on the same project. A kind suffix still wins when there is one, so a console app built for Windows stays cli and does not also claim app.
  • The four platform names move into SdkReferencePatterns beside the executable pattern they already feed, and the executable pattern is composed from them, so the list is stated once rather than in two files that have drifted apart before.

Android is deliberately left out: it is in global.json's SDK set but has never been in SdkReferencePatterns.ExecutableSuffixes, so adding it here would make this classifier disagree with DotNetService in the opposite direction. That is worth its own issue rather than a silent widening here.

Tests

FromProject_WithAPlatformSdk_ReportsOnlyTheLibrary asserted the old behaviour and is replaced by three tests, following the per-suffix shape #126 used for IsExecutableProject:

Test Covers
FromProject_WithOnlyAPlatformSdk_ReportsAnApp one case per platform suffix — the acceptance criterion
FromProject_WithAPlatformSdkBesideAKindSdk_ReportsOnlyTheKind one case per suffix — guards against a Windows cli growing a second badge
FromProject_WithAPlatformSdkOnTheProjectAttribute_StillReportsAnApp the <Project Sdk="…/version"> reference form

Verified by reverting only the two source files and re-running: the 5 new app-expectation cases fail (Assert.AreEqual("app", …) against lib) and pass again with the fix restored. The guardrail cases pass either way, as intended.

Full suite: 649/649 passing. The Sonar-analyzer build (-p:CustomBeforeMicrosoftCommonProps=.sonarlint/sonar-local.props) reports the same 7 pre-existing findings as main, none in the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vz6UYzJkBM6pdKKSPUz5vL


Generated by Claude Code

…tch]

ShippedVariants.FromProject mapped only the ConsoleApp, App and Tool suffixes
to a non-library variant and ignored Windows/Linux/macOS/Ios, on the grounds
that a platform SDK says which platform a project targets rather than what kind
of thing it is. But those four SDKs set OutputType themselves, which is why
DotNetService.IsExecutableProject and Winget.ProjectDetector.IsExecutableProject
both treat a bare <Sdk Name="ktsu.Sdk.Windows" /> as a real executable.

So a repository whose only executable marker was a platform SDK had RID zips
built and attached to its GitHub release while its row in the generated org
README showed a lib badge: the public profile page and the release it links to
disagreed about what the repository ships.

A platform suffix now contributes App when no kind suffix is present, and is
still ignored when one is, so a Windows console app stays a cli rather than
claiming both. The suffix list moves into SdkReferencePatterns beside the
executable pattern it already feeds, so the names are stated once.

Fixes #131

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vz6UYzJkBM6pdKKSPUz5vL
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 6cad264 into main Sep 14, 2026
13 checks passed
@matt-edmondson
matt-edmondson deleted the claude/nice-davinci-2z1z4d branch September 14, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile "Ships" column reports platform-only executables (ktsu.Sdk.Windows/Linux/macOS/Ios) as libraries

1 participant