Deactivated User
11/10/2021, 1:50 PMraulraja
11/10/2021, 2:29 PMraulraja
11/10/2021, 2:31 PMDeactivated User
11/10/2021, 3:56 PMjw
11/10/2021, 7:08 PMtargets.all {
compilations.all {
val pluginDependency = if (this is AbstractKotlinNativeCompilation) {
project(":zipline-kotlin-plugin-hosted")
} else {
project(":zipline-kotlin-plugin")
}
// Naming logic from <https://github.com/JetBrains/kotlin/blob/a0e6fb03f0288f0bff12be80c402d8a62b5b045a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt#L519-L520>
val pluginConfigurationName = PLUGIN_CLASSPATH_CONFIGURATION_NAME +
target.disambiguationClassifier.orEmpty().capitalize() +
compilationName.capitalize()
project.dependencies.add(pluginConfigurationName, pluginDependency)
}
}
(Apologies for the Gradle KTS 🤮 )
If you are only building for one platform it becomes even easier, like
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt
dependencies {
add(KotlinPluginKt.PLUGIN_CLASSPATH_CONFIGURATION_NAME, deps.compose.compiler)
}
Deactivated User
11/10/2021, 9:59 PMjw
11/11/2021, 2:57 AMWhat makes you believe that the plugin is complicated?The fact that it is itself a Kotlin compiler plugin with a whole API when you can already accomplish this using the Kotlin Gradle plugin's built-in configurations, the standard APIs, and leverage the same Gradle dependency resolution semantics by participating in that.