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