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 {
|
gradlePlugin {
|
||||||
(plugins) {
|
(plugins) {
|
||||||
|
"jps-compatible-base" {
|
||||||
|
id = "jps-compatible-base"
|
||||||
|
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatibleBasePlugin"
|
||||||
|
}
|
||||||
"jps-compatible" {
|
"jps-compatible" {
|
||||||
id = "jps-compatible"
|
id = "jps-compatible"
|
||||||
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
|
implementationClass = "org.jetbrains.kotlin.pill.JpsCompatiblePlugin"
|
||||||
|
|||||||
@@ -107,10 +107,6 @@ object EmbeddedComponents {
|
|||||||
val CONFIGURATION_NAME = "embeddedComponents"
|
val CONFIGURATION_NAME = "embeddedComponents"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.containsEmbeddedComponents() {
|
|
||||||
configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun AbstractCopyTask.fromEmbeddedComponents() {
|
fun AbstractCopyTask.fromEmbeddedComponents() {
|
||||||
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
|
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
|
||||||
if (this is ShadowJar) {
|
if (this is ShadowJar) {
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ import shadow.org.jdom2.output.Format
|
|||||||
import shadow.org.jdom2.output.XMLOutputter
|
import shadow.org.jdom2.output.XMLOutputter
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
class JpsCompatibleBasePlugin : Plugin<Project> {
|
||||||
|
override fun apply(project: Project) {
|
||||||
|
project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class JpsCompatiblePlugin : Plugin<Project> {
|
class JpsCompatiblePlugin : Plugin<Project> {
|
||||||
companion object {
|
companion object {
|
||||||
private const val JPS_LIBRARY_PATH = "jpsLibraryPath"
|
private const val JPS_LIBRARY_PATH = "jpsLibraryPath"
|
||||||
@@ -64,6 +70,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun apply(project: Project) {
|
override fun apply(project: Project) {
|
||||||
|
project.plugins.apply(JpsCompatibleBasePlugin::class.java)
|
||||||
// 'jpsTest' does not require the 'tests-jar' artifact
|
// 'jpsTest' does not require the 'tests-jar' artifact
|
||||||
project.configurations.create("jpsTest")
|
project.configurations.create("jpsTest")
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ jvmTarget = "1.6"
|
|||||||
|
|
||||||
val nativePlatformVariants: List<String> by rootProject.extra
|
val nativePlatformVariants: List<String> by rootProject.extra
|
||||||
|
|
||||||
containsEmbeddedComponents()
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(project(":compiler:util"))
|
compileOnly(project(":compiler:util"))
|
||||||
compileOnly(project(":compiler:cli-common"))
|
compileOnly(project(":compiler:cli-common"))
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ plugins {
|
|||||||
|
|
||||||
val robolectricClasspath by configurations.creating
|
val robolectricClasspath by configurations.creating
|
||||||
|
|
||||||
containsEmbeddedComponents()
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(intellijCoreDep()) { includeJars("intellij-core") }
|
testCompile(intellijCoreDep()) { includeJars("intellij-core") }
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ plugins {
|
|||||||
id("jps-compatible")
|
id("jps-compatible")
|
||||||
}
|
}
|
||||||
|
|
||||||
containsEmbeddedComponents()
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||||
testRuntime(intellijDep())
|
testRuntime(intellijDep())
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ description = "Kotlin Android Lint"
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-base`
|
`java-base`
|
||||||
|
id("jps-compatible-base")
|
||||||
}
|
}
|
||||||
|
|
||||||
val projectsToShadow = listOf(
|
val projectsToShadow = listOf(
|
||||||
@@ -15,8 +16,6 @@ sourceSets {
|
|||||||
"test" {}
|
"test" {}
|
||||||
}
|
}
|
||||||
|
|
||||||
containsEmbeddedComponents()
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
projectsToShadow.forEach { p ->
|
projectsToShadow.forEach { p ->
|
||||||
embeddedComponents(project(p)) { isTransitive = false }
|
embeddedComponents(project(p)) { isTransitive = false }
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ description = "Kotlin JPS plugin"
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-base`
|
`java-base`
|
||||||
|
id("jps-compatible-base")
|
||||||
}
|
}
|
||||||
|
|
||||||
val projectsToShadow = listOf(
|
val projectsToShadow = listOf(
|
||||||
@@ -20,9 +21,6 @@ val projectsToShadow = listOf(
|
|||||||
":core:util.runtime",
|
":core:util.runtime",
|
||||||
":plugins:android-extensions-jps")
|
":plugins:android-extensions-jps")
|
||||||
|
|
||||||
|
|
||||||
containsEmbeddedComponents()
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
projectsToShadow.forEach {
|
projectsToShadow.forEach {
|
||||||
embeddedComponents(project(it)) { isTransitive = false }
|
embeddedComponents(project(it)) { isTransitive = false }
|
||||||
|
|||||||
Reference in New Issue
Block a user