Conversation
jbarr21
requested review from
Bencodes,
agluszak,
ahumesky and
restingbull
as code owners
August 28, 2026 21:29
Collaborator
|
@eugenezh -- this is the feature I'd like some feedback on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Kaptish: Fast Annotation Processing for Kotlin
Summary
This PR introduces kaptish, an experimental optimization for annotation processing that bypasses KAPT's expensive stub generation phase, resulting in 1.75-2x faster builds for projects using annotation processors
with Kotlin.
How it works
Traditional KAPT uses a 3-pass approach:
Kaptish simplifies this to:
This works because annotation processors primarily need type information (class names, method signatures, annotations), which is available in compiled bytecode.
Usage
Enable globally in toolchain:
define_kt_toolchain(
name = "kotlin_toolchain",
experimental_kaptish_enabled = True,
)
Opt-out per target:
kt_jvm_library(
name = "my_library",
srcs = ["MyClass.kt"],
plugins = ["//path/to:annotation_processor"],
tags = ["kaptish_disabled"], # Falls back to KAPT
)
Files changed
New files:
Modified files:
Test plan
bazel test //src/test/kotlin/io/bazel/kotlin:KotlinJvmKaptishAssertionTest
bazel test //src/test/kotlin/io/bazel/kotlin:assertion_tests
Limitations