-
Notifications
You must be signed in to change notification settings - Fork 0
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
asking for feedback #3
base: plugin-refactor
Are you sure you want to change the base?
Conversation
// kotlin extension has the compilation target that we need to look for to create configurations | ||
decorateKotlinExtension(project) | ||
} | ||
project.pluginManager.withPlugin("com.android.application") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check for project.plugins.withType(com.android.build.gradle.api.AndroidBasePlugin) { ...
in order to detect all plugin types AGP ships.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't use it here because my AGP dependency is compileOnly. That being said, i guess i can reflectively load the class as well.
} | ||
} | ||
} | ||
|
||
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean = true | ||
|
||
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to register generated:
- java sources
- class files
with AGP. See https://github.com/JetBrains/kotlin/blob/41c4693ebf4f394b58a66164ddc206ad82ce1096/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/Kapt3KotlinGradleSubplugin.kt#L475.
Kotlin sources do not need to registered asn they are anyhow picked up by kotlin compile task.
this is not a real PR, rather looking for feedback on how to implement KSP sub plugin to properly support android variants.