Skip to content

Kapt support#6854

Open
re-thc wants to merge 4 commits intocom-lihaoyi:mainfrom
re-thc:kapt
Open

Kapt support#6854
re-thc wants to merge 4 commits intocom-lihaoyi:mainfrom
re-thc:kapt

Conversation

@re-thc
Copy link
Contributor

@re-thc re-thc commented Feb 19, 2026

Kapt is a Kotlin compiler plugin and/or Kotlin plugin for "old" Java and pre-ksp use cases. It's slower and in "maintenance" mode but still available.

It's needed to port existing Java code (still relying on annotation processors) and many things still don't have Ksp support.

Not to mention Ksp 2 still has some hard bugs that aren't fixed yet (so it's not strictly worse).

@re-thc re-thc changed the title Kapt Kapt support Feb 19, 2026
@re-thc
Copy link
Contributor Author

re-thc commented Feb 19, 2026

The CI failure doesn't look related to this PR? Please confirm.

@lihaoyi
Copy link
Member

lihaoyi commented Feb 19, 2026

@vaslabs can you help review this

* KAPT compiler plugin dependency.
*/
def kaptPluginMvnDeps: T[Seq[Dep]] = Task {
Seq(mvn"org.jetbrains.kotlin:kotlin-annotation-processing-embeddable:${kaptVersion()}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a non embeddable dependency to choose if the user overrides?

  override def kotlinUseEmbeddableCompiler: Task[Boolean] = Task { true }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

allKotlincOptions(),
Seq(
"-P",
s"plugin:org.jetbrains.kotlin.kapt3:aptMode=$aptMode",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could these be in apClasspathOpts ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@vaslabs
Copy link
Contributor

vaslabs commented Feb 19, 2026

lgtm on first glance, put comments on some minor nits

@souvlakias if you can also have a look at this

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.

3 participants

Comments