Skip to content

Add an executable target type - #37

Merged
mackoj merged 1 commit into
mainfrom
feat/executable-targets
Nov 14, 2026
Merged

mackoj merged 1 commit into
mainfrom
feat/executable-targets

Conversation

@mackoj

@mackoj mackoj commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

A target with type: executable now renders as .executableTarget and gets an .executable(name:targets:) product instead of a .library. Its imports resolve like any other target's.

Why: Telaio is moving its packages to one generated manifest, and its telaio command-line tool is an executable target that depends on a generated library (TelaioCLI). That can't be written in the header: SwiftPM loads the manifest before the plugin runs, so a hand-written target there can't name a target the generator hasn't added yet.

  • TargetType.executable (default folder Sources) and ParsedPackage.isExecutable
  • Products: .executable, named by productName when set; libraryType doesn't apply
  • Exported files skip executables, like tests
  • README: the type list and the product note

Tests

xcrun swift test: 29 tests pass, including two new ones (the .executableTarget block, the .executable product).

A target with `type: executable` renders as `.executableTarget`, its imports
resolved like any other target, and gets an `.executable` product instead of a
`.library`. A command-line tool can now live in a generated package without a
hand-written target in the header, which can't name a generated target: SwiftPM
loads the manifest before the plugin runs.
@mackoj
mackoj merged commit cd60eb4 into main Nov 14, 2026
1 check passed
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.

1 participant