Skip to content

Add picocli-codegen-ksp module — KSP-based GraalVM native-image confi…#2515

Open
infinityat0 wants to merge 2 commits into
remkop:mainfrom
infinityat0:feature/ksp-support
Open

Add picocli-codegen-ksp module — KSP-based GraalVM native-image confi…#2515
infinityat0 wants to merge 2 commits into
remkop:mainfrom
infinityat0:feature/ksp-support

Conversation

@infinityat0
Copy link
Copy Markdown

…g generator (#1564)

Introduces a new picocli-codegen-ksp Gradle submodule that provides a Kotlin Symbol Processing (KSP) equivalent of the existing KAPT/APT-based NativeImageConfigGeneratorProcessor.

The processor scans picocli-annotated classes (@command, @option, @parameters, @mixin, @Arggroup, @SPEC, @unmatched, @ParentCommand) at compile time and emits:

  • reflect-config.json (classes, fields, methods for GraalVM reflection)
  • resource-config.json (resource bundles and patterns)
  • proxy-config.json (dynamic proxies for @command interfaces)

Supports the same KSP options as the APT processor: project, verbose, disable.reflect.config, disable.resource.config, disable.proxy.config, other.resource.bundles, other.resource.patterns, other.proxy.interfaces.

Users add it as a ksp(...) dependency rather than kapt(...):
ksp("info.picocli:picocli-codegen-ksp:")

Also fixes the Spring repository declaration in build.gradle to scope it to Spring group IDs only, avoiding unnecessary resolution attempts for non-Spring artifacts.

…g generator (remkop#1564)

Introduces a new `picocli-codegen-ksp` Gradle submodule that provides a
Kotlin Symbol Processing (KSP) equivalent of the existing KAPT/APT-based
`NativeImageConfigGeneratorProcessor`.

The processor scans picocli-annotated classes (@command, @option,
@parameters, @mixin, @Arggroup, @SPEC, @unmatched, @ParentCommand) at
compile time and emits:
  - reflect-config.json  (classes, fields, methods for GraalVM reflection)
  - resource-config.json (resource bundles and patterns)
  - proxy-config.json    (dynamic proxies for @command interfaces)

Supports the same KSP options as the APT processor: `project`, `verbose`,
`disable.reflect.config`, `disable.resource.config`, `disable.proxy.config`,
`other.resource.bundles`, `other.resource.patterns`, `other.proxy.interfaces`.

Users add it as a `ksp(...)` dependency rather than `kapt(...)`:
  ksp("info.picocli:picocli-codegen-ksp:<version>")

Also fixes the Spring repository declaration in build.gradle to scope it
to Spring group IDs only, avoiding unnecessary resolution attempts for
non-Spring artifacts.
@infinityat0 infinityat0 marked this pull request as ready for review May 8, 2026 17:59
@remkop remkop added this to the 4.8 milestone May 10, 2026
@remkop remkop added theme: codegen An issue or change related to the picocli-codegen module theme: annotation-proc An issue or change related to the annotation processor lang: kotlin Kotlin-related labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: kotlin Kotlin-related theme: annotation-proc An issue or change related to the annotation processor theme: codegen An issue or change related to the picocli-codegen module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants