-
Notifications
You must be signed in to change notification settings - Fork 470
Support AGP with Kotlin Built-in #4295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
adam-enko
wants to merge
68
commits into
master
Choose a base branch
from
adam/support-agp-kotlin-builtin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
rename file to match function name Update test.
12c2bb1 to
4dd9e43
Compare
When using AGP 9, KGP is no longer required. AGP will be responsible for configuring Kotlin compilation. DGP needs to support Kotlin BuiltIn by extracting information from AGP instead of KGP. - Update KotlinAdapter and AndroidAdapter to handle AGP with Kotlin built-in. - Capture classpaths of variants from `AndroidComponentsExtension` instead of the Android extension. - Update captured AGP variant info to include classpaths. - Only apply KotlinAdapter and AndroidAdapter once per project (Remove the `exec()` function, only apply the plugin once using `KotlinAdapter.applyTo()`).
Preparation for testing AGP9. - Add min/max version to `@TestsAndroid` and `@TestsAndroidCompose` filter AGP versions. - Add SemVerRange to help with filtering. - Add AGP9 properties.
ALikhachev
reviewed
Nov 12, 2025
dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/AndroidAdapter.kt
Outdated
Show resolved
Hide resolved
If a project has `kotlin-multiplatform` and `com.android.kotlin.multiplatform.library` then AndroidAdapter shouldn't be necessary. `compilationClasspath` already contains android.jar and the classpath from Android's Components.
Filter out KGP versions, specifically because com.android.kotlin.multiplatform.library requires KGP 2.0.0+
minor tweak to make it easier to see where the comments refer to
# Conflicts: # dokka-integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/junit/TestedVersionsSource.kt # dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt # dokka-runners/dokka-gradle-plugin/src/main/kotlin/internal/findExtensionLenient.kt # dokka-runners/dokka-gradle-plugin/src/testFunctional/kotlin/MultiModuleFunctionalTest.kt
Member
Author
|
Converted to a draft because I'm going to split this PR into smaller pieces.
|
Tag tests that use Kotlin JVM plugin. (This will become more relevant when we add a test for AGP9 with Kotlin-built-in.)
Move the `@WithGradleProperties` defaults to the tags that require them. The test classes are simpler. (This will become more relevant when we need to test AGP9 with built-in-kotlin.)
…ort-agp-kotlin-builtin # Conflicts: # dokka-integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/junit/testTags.kt # dokka-integration-tests/gradle/src/test/kotlin/AndroidComposeIT.kt # dokka-integration-tests/gradle/src/test/kotlin/AndroidProjectIT.kt # dokka-integration-tests/gradle/src/test/kotlin/MultiplatformAndroidJvmProjectIT.kt
# Conflicts: # dokka-integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/junit/testTags.kt # dokka-integration-tests/gradle/src/test/kotlin/AndroidComposeIT.kt # dokka-integration-tests/gradle/src/test/kotlin/MultiplatformAndroidJvmProjectIT.kt
# Conflicts: # build.gradle.kts # dokka-integration-tests/gradle/projects/it-android-kotlin-mp-builtin/build.gradle.kts # dokka-integration-tests/gradle/projects/it-android-kotlin-mp-builtin/gradle.properties # dokka-integration-tests/gradle/src/test/kotlin/AndroidKotlinMultiplatformBuiltInTest.kt
- Instead of lower-level manual version selection, instead defined whether a test project supports Kotlin built-in - Remove SemVerRange
… is not necessary since 9.0.0-alpha03.
…enerated It could be a bit of a pain to maintain? But it's quick and easy, and if it prevents a bug where a version is accidentally filtered out it'd be worth it. (we could use test coverage support, but this is a quick and easy one)
# Conflicts: # dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/AndroidAdapter.kt # dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/JavaAdapter.kt # dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt # dokka-runners/dokka-gradle-plugin/src/main/kotlin/internal/PluginId.kt # dokka-runners/dokka-gradle-plugin/src/testFunctional/kotlin/MultiModuleFunctionalTest.kt
adam-enko
added a commit
that referenced
this pull request
Nov 24, 2025
Add support for testing AGP projects that use kotlin-built-in. I converted the existing `requiredAgpMajorVersions` check into a unit test. This will help verify that TestedVersionsSource doesn't accidentally filter out any of the tested versions. It could be a bit of a pain to maintain? But this test is quick and easy, and if it prevents a bug where a version is accidentally excluded, it'd be worth it. (We could use test coverage support on TeamCity? But I'm not sure how to add that, and it could be fragile or easy to ignore?) Currently there are no test-projects for kotlin-built-in. These will be added in #4295.
adam-enko
added a commit
that referenced
this pull request
Nov 24, 2025
ALikhachev
approved these changes
Nov 28, 2025
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.
When using AGP 9, KGP is no longer required. AGP will be responsible for configuring Kotlin compilation. DGP needs to support Kotlin Built-in by extracting information from AGP instead of KGP.
Fix #4256
Summary of changes
AndroidComponentsExtensioninstead of the Android extension.exec()function, only apply the plugin once usingKotlinAdapter.applyTo()).it-android-kotlin-jvm-builtin- AGP & kotlin-built-in (no KGP plugin).it-android-kotlin-mp-builtin- AGP & kotlin-multiplatform.Integration tests: support AGP 9 testing and version filtering
@TestsAndroidand@TestsAndroidComposefilter AGP versions.