Build: Centralize compiler dist build logic in :kotlin-compiler project
This commit is contained in:
@@ -37,5 +37,3 @@ publish()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
runtimeJar()
|
||||
dist()
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'pill-configurable'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
pill {
|
||||
@@ -25,14 +24,11 @@ dependencies {
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_16
|
||||
kotlinOptions.jvmTarget = 1.6
|
||||
|
||||
@@ -17,18 +17,12 @@ val jarBaseName = property("archivesBaseName") as String
|
||||
|
||||
val proguardLibraryJars by configurations.creating
|
||||
|
||||
val default by configurations
|
||||
val runtimeJar by configurations.creating
|
||||
|
||||
default.apply {
|
||||
extendsFrom(runtimeJar)
|
||||
}
|
||||
|
||||
val projectsDependencies = listOf(
|
||||
":kotlin-scripting-common",
|
||||
":kotlin-scripting-jvm",
|
||||
":kotlin-script-util",
|
||||
":kotlin-script-runtime")
|
||||
":kotlin-script-runtime"
|
||||
)
|
||||
|
||||
dependencies {
|
||||
projectsDependencies.forEach {
|
||||
@@ -95,17 +89,18 @@ val proguard by task<ProGuardTask> {
|
||||
libraryjars(mapOf("filter" to "!META-INF/versions/**"), proguardLibraryJars)
|
||||
}
|
||||
|
||||
val pack = if (shrink) proguard else packJar
|
||||
|
||||
runtimeJarArtifactBy(pack, pack.outputs.files.singleFile) {
|
||||
name = jarBaseName
|
||||
classifier = ""
|
||||
val resultJar = tasks.register<Jar>("resultJar") {
|
||||
val pack = if (shrink) proguard else packJar
|
||||
dependsOn(pack)
|
||||
setupPublicJar(jarBaseName)
|
||||
from {
|
||||
zipTree(pack.outputs.files.singleFile)
|
||||
}
|
||||
}
|
||||
|
||||
dist(
|
||||
targetName = "$name.jar",
|
||||
fromTask = pack
|
||||
)
|
||||
addArtifact("runtime", resultJar)
|
||||
addArtifact("archives", resultJar)
|
||||
|
||||
sourcesJar()
|
||||
|
||||
javadocJar()
|
||||
|
||||
@@ -60,8 +60,7 @@ tasks {
|
||||
}
|
||||
"test" {
|
||||
// These dependencies are needed because ForTestCompileRuntime loads jars from dist
|
||||
dependsOn(":kotlin-reflect:dist")
|
||||
dependsOn(":kotlin-script-runtime:dist")
|
||||
dependsOn(":dist")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,5 +16,3 @@ sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
dist()
|
||||
|
||||
@@ -4,7 +4,6 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'pill-configurable'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
pill {
|
||||
@@ -33,15 +32,12 @@ jar {
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
mainJar jar
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions.freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
@@ -49,5 +45,3 @@ compileKotlin {
|
||||
"-module-name", project.name
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user