Skip to content
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

Partially migrate KSP off AGP's legacy Variant API #2312

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

scott-pollom
Copy link
Contributor

Use AGP's new addKspConfigurations() API when possible.

Bug: #2250
Test: AGP741IT and existing ProcessorClasspathConfigurationsTest

Use AGP's new addKspConfigurations() API when possible.

Bug: google#2250
Test: AGP741IT and existing ProcessorClasspathConfigurationsTest
@ting-yuan
Copy link
Collaborator

This seems to strongly depend on the implementation of AndroidComponentsExtension.addKspConfigurations. Are there any guarantees or documentation of what configurations it creates / uses, or slightly more: how does KSP's Gradle plugin and AGP work together? For example, it creates / uses KSP configuration like kspDebug / kspRelease / etc, and corresponding kspDebugProcessorClasspath / etc. Without a formal contract or at least tests in AGP it is quite vulnerable to future changes in both side.

@scott-pollom
Copy link
Contributor Author

There is a test on the AGP side here: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/integration-test/application/src/test/java/com/android/build/gradle/integration/application/ConfigurationPerSourceSetTest.kt;l=162

And there is a test on the KSP side in ProcessorClasspathConfigurationsTest.kt

AGP's API creates the same configurations previously created by KSP. The only difference is that it creates the ...KotlinProcessorClasspath configurations eagerly.

@ting-yuan ting-yuan merged commit b6b8461 into google:main Feb 4, 2025
3 checks passed
@ting-yuan ting-yuan added this to the 1.0.30 milestone Feb 5, 2025
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.

2 participants