Build: Centralize build logic for kotlin-plugin in :prepare:idea-plugin
This commit is contained in:
@@ -131,7 +131,7 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
|
|||||||
|
|
||||||
kotlinPluginJar.add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
|
kotlinPluginJar.add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
|
||||||
|
|
||||||
for (jarFile in sourcePath.project.configurations.getByName("packedJars").resolve()) {
|
for (jarFile in sourcePath.project.configurations.getByName("embedded").resolve()) {
|
||||||
kotlinPluginJar.add(ExtractedDirectory(jarFile))
|
kotlinPluginJar.add(ExtractedDirectory(jarFile))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,4 @@ sourcesJar()
|
|||||||
|
|
||||||
javadocJar()
|
javadocJar()
|
||||||
|
|
||||||
dist()
|
dist()
|
||||||
|
|
||||||
ideaPlugin()
|
|
||||||
@@ -20,12 +20,8 @@ sourceSets {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar = runtimeJar()
|
runtimeJar()
|
||||||
val sourcesJar = sourcesJar()
|
sourcesJar()
|
||||||
val javadocJar = javadocJar()
|
javadocJar()
|
||||||
|
|
||||||
dist()
|
dist()
|
||||||
|
|
||||||
ideaPlugin {
|
|
||||||
from(jar, sourcesJar)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,5 +21,3 @@ sourceSets {
|
|||||||
publish()
|
publish()
|
||||||
|
|
||||||
standardPublicJars()
|
standardPublicJars()
|
||||||
|
|
||||||
ideaPlugin()
|
|
||||||
|
|||||||
@@ -19,12 +19,8 @@ sourceSets {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar = runtimeJar()
|
runtimeJar()
|
||||||
val sourcesJar = sourcesJar()
|
sourcesJar()
|
||||||
val javadocJar = javadocJar()
|
javadocJar()
|
||||||
|
|
||||||
dist()
|
dist()
|
||||||
|
|
||||||
ideaPlugin {
|
|
||||||
from(jar, sourcesJar)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -45,6 +45,3 @@ publish()
|
|||||||
runtimeJar()
|
runtimeJar()
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
javadocJar()
|
javadocJar()
|
||||||
|
|
||||||
|
|
||||||
ideaPlugin()
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ sourceSets {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar = runtimeJar {}
|
runtimeJar()
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
javadocJar()
|
javadocJar()
|
||||||
testsJar {}
|
testsJar {}
|
||||||
@@ -34,10 +34,6 @@ dist {
|
|||||||
rename("kotlin-", "")
|
rename("kotlin-", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
ideaPlugin {
|
|
||||||
from(jar)
|
|
||||||
}
|
|
||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(":kotlin-stdlib:jvm-minimal-for-test:dist")
|
dependsOn(":kotlin-stdlib:jvm-minimal-for-test:dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
|
|||||||
@@ -35,14 +35,12 @@ tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
|||||||
|
|
||||||
publish()
|
publish()
|
||||||
|
|
||||||
val jar = runtimeJar {}
|
runtimeJar()
|
||||||
sourcesJar()
|
sourcesJar()
|
||||||
javadocJar()
|
javadocJar()
|
||||||
|
|
||||||
dist()
|
dist()
|
||||||
|
|
||||||
ideaPlugin()
|
|
||||||
|
|
||||||
projectTest {
|
projectTest {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ repositories {
|
|||||||
maven("https://jetbrains.bintray.com/markdown")
|
maven("https://jetbrains.bintray.com/markdown")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not rename, used in pill importer
|
// PILL: used in pill importer
|
||||||
val projectsToShadow by extra(listOf(
|
val projectsToShadow by extra(listOf(
|
||||||
":plugins:annotation-based-compiler-plugins-ide-support",
|
":plugins:annotation-based-compiler-plugins-ide-support",
|
||||||
":core:type-system",
|
":core:type-system",
|
||||||
@@ -95,33 +95,48 @@ val projectsToShadow by extra(listOf(
|
|||||||
emptyArray<String>()
|
emptyArray<String>()
|
||||||
))
|
))
|
||||||
|
|
||||||
// Do not rename, used in pill importer
|
val embedded by configurations.creating // PILL: used in pill importer
|
||||||
val packedJars by configurations.creating
|
|
||||||
|
|
||||||
val libraries by configurations.creating
|
val libraries by configurations.creating
|
||||||
|
val jpsPlugin by configurations.creating
|
||||||
|
|
||||||
|
configurations.all {
|
||||||
|
resolutionStrategy {
|
||||||
|
preferProjectModules()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
projectsToShadow.forEach {
|
projectsToShadow.forEach {
|
||||||
packedJars(project(it)) { isTransitive = false }
|
embedded(project(it)) { isTransitive = false }
|
||||||
}
|
}
|
||||||
packedJars(protobufFull())
|
embedded(protobufFull())
|
||||||
packedJars(kotlinBuiltins())
|
embedded(kotlinBuiltins())
|
||||||
|
|
||||||
libraries(project(":kotlin-script-runtime"))
|
|
||||||
libraries(kotlinStdlib("jdk8"))
|
|
||||||
libraries(project(":kotlin-reflect"))
|
|
||||||
libraries(project(":kotlin-compiler-client-embeddable"))
|
|
||||||
libraries(commonDep("io.javaslang", "javaslang"))
|
|
||||||
libraries(commonDep("javax.inject"))
|
libraries(commonDep("javax.inject"))
|
||||||
libraries(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8"))
|
libraries(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-jdk8"))
|
||||||
libraries(commonDep("org.jetbrains", "markdown"))
|
libraries(commonDep("org.jetbrains", "markdown"))
|
||||||
|
libraries(commonDep("io.javaslang", "javaslang"))
|
||||||
|
|
||||||
|
libraries(kotlinStdlib("jdk8"))
|
||||||
|
libraries(project(":kotlin-reflect"))
|
||||||
|
libraries(project(":kotlin-compiler-client-embeddable"))
|
||||||
|
libraries(project(":kotlin-daemon-client"))
|
||||||
|
libraries(project(":kotlin-sam-with-receiver-compiler-plugin"))
|
||||||
|
libraries(project(":kotlin-script-runtime"))
|
||||||
|
libraries(project(":kotlin-script-util"))
|
||||||
|
libraries(project(":kotlin-scripting-common"))
|
||||||
|
libraries(project(":kotlin-scripting-impl"))
|
||||||
|
libraries(project(":kotlin-scripting-intellij"))
|
||||||
|
libraries(project(":kotlin-scripting-jvm"))
|
||||||
|
|
||||||
|
jpsPlugin(project(":kotlin-jps-plugin"))
|
||||||
}
|
}
|
||||||
|
|
||||||
val jar = runtimeJar {
|
val jar = runtimeJar {
|
||||||
dependsOn(packedJars)
|
dependsOn(embedded)
|
||||||
from("$rootDir/resources/kotlinManifest.properties")
|
from("$rootDir/resources/kotlinManifest.properties")
|
||||||
from {
|
from {
|
||||||
packedJars.files.map(::zipTree)
|
embedded.files.map(::zipTree)
|
||||||
}
|
}
|
||||||
|
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
@@ -132,4 +147,7 @@ ideaPlugin {
|
|||||||
dependsOn(":dist")
|
dependsOn(":dist")
|
||||||
from(jar)
|
from(jar)
|
||||||
from(libraries)
|
from(libraries)
|
||||||
|
from(jpsPlugin) {
|
||||||
|
into("jps")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
|
|
||||||
description = "Kotlin JPS plugin"
|
description = "Kotlin JPS plugin"
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-base`
|
java
|
||||||
id("pill-configurable")
|
id("pill-configurable")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,14 +24,13 @@ dependencies {
|
|||||||
projectsToShadow.forEach {
|
projectsToShadow.forEach {
|
||||||
embeddedComponents(project(it)) { isTransitive = false }
|
embeddedComponents(project(it)) { isTransitive = false }
|
||||||
}
|
}
|
||||||
|
|
||||||
embeddedComponents(projectRuntimeJar(":kotlin-daemon-client"))
|
embeddedComponents(projectRuntimeJar(":kotlin-daemon-client"))
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeJar<ShadowJar>(task<ShadowJar>("jar")) {
|
runtimeJar {
|
||||||
manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.runner.Main")
|
manifest.attributes["Main-Class"] = "org.jetbrains.kotlin.runner.Main"
|
||||||
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar")
|
manifest.attributes["Class-Path"] = "kotlin-stdlib.jar"
|
||||||
from(files("$rootDir/resources/kotlinManifest.properties"))
|
from(files("$rootDir/resources/kotlinManifest.properties"))
|
||||||
fromEmbeddedComponents()
|
fromEmbeddedComponents()
|
||||||
}
|
}
|
||||||
|
|
||||||
ideaPlugin("lib/jps")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user