Build: Centralize compiler dist build logic in :kotlin-compiler project
This commit is contained in:
@@ -3,7 +3,6 @@ description = 'Kotlin Common Standard Library'
|
||||
apply plugin: 'kotlin-platform-common'
|
||||
apply plugin: 'pill-configurable'
|
||||
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
def commonSrcDir = "../src"
|
||||
@@ -109,15 +108,4 @@ artifacts {
|
||||
|
||||
javadocJar()
|
||||
|
||||
// TODO: call the "dist" task instead, once we need to publish kotlin-stdlib-common.jar with the compiler distribution
|
||||
task distCommon(type: Copy) {
|
||||
from(jar)
|
||||
from(sourcesJar)
|
||||
into "$distDir/common"
|
||||
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
||||
}
|
||||
|
||||
dist.dependsOn distCommon
|
||||
|
||||
|
||||
classes.setDependsOn(classes.dependsOn.findAll { it != "compileJava" })
|
||||
|
||||
@@ -4,7 +4,6 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'pill-configurable'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
ext.javaHome = JDK_17
|
||||
|
||||
@@ -67,16 +66,13 @@ task modularJar(type: Jar) {
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_17
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ apply plugin: 'kotlin'
|
||||
apply plugin: 'pill-configurable'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
ext.javaHome = JDK_18
|
||||
ext.jvmTarget = "1.8"
|
||||
@@ -61,15 +60,13 @@ task modularJar(type: Jar) {
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_18
|
||||
kotlinOptions.jvmTarget = 1.8
|
||||
|
||||
@@ -161,13 +161,6 @@ if (project.findProperty("kotlin.stdlib.js.ir.publish")?.toBoolean() == true) {
|
||||
configurePublishing(project)
|
||||
}
|
||||
|
||||
if (project.findProperty("kotlin.stdlib.js.ir.dist")?.toBoolean() == true) {
|
||||
configureDist(project)
|
||||
dist {
|
||||
from (jar, sourcesJar)
|
||||
}
|
||||
}
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = '8.9.4' // The default 6.9.1 has buggy hyperbolic functions implementation
|
||||
|
||||
@@ -7,9 +7,14 @@ description = 'Kotlin Standard Library for JS'
|
||||
apply plugin: 'kotlin-platform-js'
|
||||
apply plugin: 'idea'
|
||||
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
configurations {
|
||||
sources
|
||||
commonSources
|
||||
distSources
|
||||
distJs
|
||||
}
|
||||
|
||||
def builtinsSrcDir = "${buildDir}/builtin-sources"
|
||||
def builtinsSrcDir2 = "${buildDir}/builtin-sources-for-builtins"
|
||||
@@ -77,9 +82,6 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
commonSources
|
||||
}
|
||||
dependencies {
|
||||
expectedBy project(":kotlin-stdlib-common")
|
||||
commonSources project(path: ":kotlin-stdlib-common", configuration: "sources")
|
||||
@@ -331,9 +333,8 @@ task sourcesJar(type: Jar, dependsOn: compileJs) {
|
||||
|
||||
task distSourcesJar(type: Jar) {
|
||||
dependsOn(sourcesJar, configurations.commonSources)
|
||||
baseName = 'dist-kotlin-stdlib-js'
|
||||
version = null
|
||||
classifier = 'sources'
|
||||
destinationDirectory = file("$buildDir/lib/dist")
|
||||
archiveClassifier = 'sources'
|
||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||
from zipTree(sourcesJar.outputs.files.singleFile)
|
||||
|
||||
@@ -354,23 +355,16 @@ artifacts {
|
||||
runtime mergedJar
|
||||
archives mergedJar
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
distSources distSourcesJar
|
||||
|
||||
compileJs.outputs.files.forEach { artifact ->
|
||||
distJs(artifact) { builtBy(compileJs) }
|
||||
}
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
task distJs(type: Copy) {
|
||||
from(compileJs)
|
||||
into "$distDir/js"
|
||||
}
|
||||
|
||||
dist {
|
||||
dependsOn distJs
|
||||
[mergedJar, distSourcesJar].forEach {
|
||||
rename("dist-", "")
|
||||
from(it)
|
||||
}
|
||||
}
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = '8.9.4' // The default 6.9.1 has buggy hyperbolic functions implementation
|
||||
|
||||
@@ -12,6 +12,11 @@ javaHome = rootProject.extra["JDK_16"] as String
|
||||
|
||||
val builtins by configurations.creating
|
||||
|
||||
val runtime by configurations
|
||||
val runtimeJar by configurations.creating {
|
||||
runtime.extendsFrom(this)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":kotlin-stdlib"))
|
||||
builtins(project(":core:builtins"))
|
||||
@@ -61,14 +66,11 @@ tasks.withType<KotlinCompile> {
|
||||
}
|
||||
|
||||
val jar = runtimeJar {
|
||||
archiveFileName.set("kotlin-stdlib-minimal-for-test.jar")
|
||||
dependsOn(builtins)
|
||||
from(provider { zipTree(builtins.singleFile) }) { include("kotlin/**") }
|
||||
}
|
||||
|
||||
val distDir: String by rootProject.extra
|
||||
|
||||
dist(targetName = "kotlin-stdlib-minimal-for-test.jar", targetDir = File(distDir), fromTask = jar)
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("internal") {
|
||||
|
||||
@@ -6,9 +6,12 @@ apply plugin: 'pill-configurable'
|
||||
archivesBaseName = 'kotlin-stdlib'
|
||||
|
||||
configureJvm6Project(project)
|
||||
configureDist(project)
|
||||
configurePublishing(project)
|
||||
|
||||
configurations {
|
||||
distSources
|
||||
}
|
||||
|
||||
pill {
|
||||
importAsLibrary = true
|
||||
}
|
||||
@@ -105,10 +108,10 @@ sourcesJar {
|
||||
|
||||
task distSourcesJar(type: Jar) {
|
||||
dependsOn(sourcesJar, configurations.commonSources)
|
||||
baseName = 'dist-kotlin-stdlib'
|
||||
version = null
|
||||
destinationDirectory = file("$buildDir/lib/dist")
|
||||
classifier = 'sources'
|
||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||
|
||||
from zipTree(sourcesJar.outputs.files.singleFile)
|
||||
|
||||
from(zipTree(configurations.commonSources.singleFile)) {
|
||||
@@ -118,12 +121,6 @@ task distSourcesJar(type: Jar) {
|
||||
}
|
||||
}
|
||||
|
||||
task distMavenSources(type: Copy) {
|
||||
from(sourcesJar)
|
||||
into "$distDir/maven"
|
||||
rename "-${java.util.regex.Pattern.quote(version)}", ''
|
||||
}
|
||||
|
||||
task modularJar(type: Jar) {
|
||||
dependsOn(jar)
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
@@ -138,25 +135,13 @@ task modularJar(type: Jar) {
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
distSources distSourcesJar
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
javadocJar()
|
||||
|
||||
dist {
|
||||
dependsOn distMavenSources
|
||||
|
||||
[jar, distSourcesJar].forEach {
|
||||
from(it) {
|
||||
rename('dist-', '')
|
||||
}
|
||||
}
|
||||
|
||||
from (configurations.compile) {
|
||||
include 'annotations*.jar'
|
||||
}
|
||||
}
|
||||
|
||||
task dexMethodCount(type: DexMethodCount) {
|
||||
from jar
|
||||
ownPackages = ['kotlin']
|
||||
|
||||
Reference in New Issue
Block a user