Skip to content

Introduce traits guarding dependencies that macros and -tool use - #468

Closed
ktoso wants to merge 2 commits into
swiftlang:mainfrom
ktoso:wip-dependency-traits
Closed

ktoso wants to merge 2 commits into
swiftlang:mainfrom
ktoso:wip-dependency-traits

Conversation

@ktoso

@ktoso ktoso commented Dec 1, 2025 •

Copy link
Copy Markdown
Collaborator

This is a specific approach intended to remove the need to split the swift-java repository into more repositories.

The intended goal is to allow libraries to depend on swift-java WITHOUT having to depend on:

  • swift-syntax (which @java... macros depend on)
  • any of the swift-java command line tool's dependencies

This design effectively means that a library just using the "no dependencies" pieces of swift-java would depend on it this way:

dependencies: [
    .package(
        ... swift-java ...
         // Disable all the dependencies SwiftJava Tool,
         // and macros are pulling otherwise
        traits: []
    ),
],

By "not enabling" the default traits, such library will NOT built swift-syntax and any of the other dependencies.

If another dependency, e.g. an application, also used SwiftJava and DID use the macros, these traits would become enabled -- as the developer intended -- however that is not a problem for the "middle" libraries, such as Skip which would not have to enable any of these traits nor care about the dependencies.

--

In addition to that, all dependencies of swift-java WILL promise to support Android shortly, as soon as we figure out some organizational things about them.

@ktoso
ktoso force-pushed the wip-dependency-traits branch from f4a5aa2 to a4547a1 Compare December 15, 2025 07:50
@ktoso
ktoso marked this pull request as ready for review December 16, 2025 13:58
@ktoso ktoso closed this Feb 27, 2026
@ktoso

ktoso commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator Author

We're not doing this for the time being and will spin up a new repo

@ktoso
ktoso deleted the wip-dependency-traits branch February 27, 2026 08:32
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