Introduce jps-compatible-base plugin to create necessary configurations
To avoid generating static accessors (via kotlinDslAccessorsSnapshot), we need to create all necessary configurations during 'plugins' block evaluation.
This commit is contained in:
@@ -33,6 +33,10 @@ plugins {
|
||||
|
||||
gradlePlugin {
|
||||
(plugins) {
|
||||
"jps-compatible-base" {
|
||||
id = "jps-compatible-base"
|
||||
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatibleBasePlugin"
|
||||
}
|
||||
"jps-compatible" {
|
||||
id = "jps-compatible"
|
||||
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
|
||||
|
||||
@@ -107,10 +107,6 @@ object EmbeddedComponents {
|
||||
val CONFIGURATION_NAME = "embeddedComponents"
|
||||
}
|
||||
|
||||
fun Project.containsEmbeddedComponents() {
|
||||
configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
|
||||
}
|
||||
|
||||
fun AbstractCopyTask.fromEmbeddedComponents() {
|
||||
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
|
||||
if (this is ShadowJar) {
|
||||
|
||||
@@ -10,6 +10,12 @@ import shadow.org.jdom2.output.Format
|
||||
import shadow.org.jdom2.output.XMLOutputter
|
||||
import java.io.File
|
||||
|
||||
class JpsCompatibleBasePlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
class JpsCompatiblePlugin : Plugin<Project> {
|
||||
companion object {
|
||||
private const val JPS_LIBRARY_PATH = "jpsLibraryPath"
|
||||
@@ -64,6 +70,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
|
||||
}
|
||||
|
||||
override fun apply(project: Project) {
|
||||
project.plugins.apply(JpsCompatibleBasePlugin::class.java)
|
||||
// 'jpsTest' does not require the 'tests-jar' artifact
|
||||
project.configurations.create("jpsTest")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user