Files
kotlin-fork/libraries/tools/kotlin-serialization/build.gradle
T
Sergey Igushkin 1f5fa5eb7c Add back empty stub implementations of KotlinGradleSubplugin (KT-39809)
* If a KotlinGradleSubplugin implements
 KotlinCompilerPluginSupportPlugin, don't apply it as a legacy plugin

* Add the legacy KotlinGradleSubplugin implementations back so that
 when there's JAR hell with META-INF/services in the old artifacts
 pointing to the classes, loading the plugins with ServiceLoader (legacy
 implementation) from the new artifacts would not fail.

* There's a corner case for plugins not in kotlin-gradle-plugin
 If a newer and older version of such a subplugin is used with an older
 version of the Kotlin Gradle plugin, the latter will find the META-INF
 entries and will try to load the subplugins from the new version. With
 the original fix for KT-39809, this would result in silently ignored
 empty stub implementations.

 Given that the Kotlin Gradle plugin can now check if a subplugin
 supports the new API, it's OK to keep the old entries and make the
 stub implementations throw a build error when called, so that improper
 plugin versions are not ignored and are clearly reported.

 Note that this is only necessary for the subplugins not bundled in the
 kotlin-gradle-plugin module, as those will always be in sync with the
 Kotlin version.

Issue #KT-39809 Fixed
2020-06-30 12:51:51 +03:00

44 lines
1011 B
Groovy

apply plugin: 'kotlin'
apply plugin: 'jps-compatible'
configurePublishing(project)
pill {
variant = 'FULL'
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.fork = false
}
dependencies {
compileOnly project(':kotlin-gradle-plugin')
compile project(':kotlin-gradle-plugin-api')
compileOnly kotlinStdlib()
compileOnly project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar')
embedded(project(":kotlinx-serialization-compiler-plugin")) { transitive = false }
}
jar {
manifestAttributes(manifest, project)
}
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
configureSourcesJar()
configureJavadocJar()
pluginBundle {
plugins {
kotlinSerialization {
id = 'org.jetbrains.kotlin.plugin.serialization'
description = displayName = 'Kotlin compiler plugin for kotlinx.serialization library'
}
}
}
configurePluginMarkers(project)