Reorganize builtins built and use in the projects
This commit is contained in:
@@ -47,10 +47,6 @@ fun Project.ideaPluginDeps(vararg artifactBaseNames: String, plugin: String, sub
|
||||
|
||||
fun Project.kotlinDep(artifactBaseName: String, version: String? = null): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:${version ?: bootstrapKotlinVersion}"
|
||||
|
||||
fun DependencyHandler.projectDep(name: String): Dependency = project(name, configuration = "default")
|
||||
fun DependencyHandler.projectDepIntransitive(name: String): Dependency =
|
||||
project(name, configuration = "default").apply { isTransitive = false }
|
||||
|
||||
fun DependencyHandler.projectDist(name: String): Dependency = project(name, configuration = "distJar").apply { isTransitive = false }
|
||||
fun DependencyHandler.projectTests(name: String): Dependency = project(name, configuration = "tests-jar").apply { isTransitive = false }
|
||||
fun DependencyHandler.projectRuntimeJar(name: String): Dependency = project(name, configuration = "runtimeJar")
|
||||
|
||||
@@ -8,6 +8,7 @@ dependencies {
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":compiler:cli-common"))
|
||||
compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>)))
|
||||
compile(project(":kotlin-stdlib"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -7,7 +7,7 @@ apply { plugin("kotlin") }
|
||||
jvmTarget = "1.6"
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:builtins"))
|
||||
compile(projectDist(":kotlin-stdlib"))
|
||||
compile(project("util.runtime"))
|
||||
compile(protobufLite())
|
||||
compile(commonDep("javax.inject"))
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import org.jetbrains.kotlin.serialization.builtins.BuiltInsSerializer
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import java.io.File
|
||||
|
||||
apply { plugin("kotlin") }
|
||||
|
||||
jvmTarget = "1.6"
|
||||
|
||||
val builtinsSrc = File(rootDir, "core", "builtins", "src")
|
||||
val builtinsNative = File(rootDir, "core", "builtins", "native")
|
||||
// TODO: rewrite dependent projects on using build results instead of the fixed location
|
||||
@@ -16,20 +10,6 @@ val builtinsSerialized = File(rootProject.extra["distDir"].toString(), "builtins
|
||||
|
||||
val builtins by configurations.creating
|
||||
|
||||
dependencies {
|
||||
compile(protobufLite())
|
||||
compile(files(builtinsSerialized))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
projectDefault()
|
||||
java.srcDir("../runtime.jvm/src")
|
||||
resources.srcDir(builtinsSerialized).apply { include("**") }
|
||||
}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
val serialize = task("serialize") {
|
||||
val outDir = builtinsSerialized
|
||||
val inDirs = arrayOf(builtinsSrc, builtinsNative)
|
||||
@@ -44,22 +24,6 @@ val serialize = task("serialize") {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
dependsOn(protobufLiteTask)
|
||||
dependsOn(serialize)
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
dependsOn(protobufLiteTask)
|
||||
dependsOn(serialize)
|
||||
}
|
||||
|
||||
val jar: Jar by tasks
|
||||
jar.apply {
|
||||
dependsOn(serialize)
|
||||
from(builtinsSerialized) { include("kotlin/**") }
|
||||
}
|
||||
|
||||
val builtinsJar by task<Jar> {
|
||||
dependsOn(serialize)
|
||||
from(builtinsSerialized) { include("kotlin/**") }
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
import org.gradle.api.tasks.compile.JavaCompile
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath("com.github.jengelman.gradle.plugins:shadow:1.2.3")
|
||||
classpath(ideaSdkDeps("asm-all"))
|
||||
}
|
||||
}
|
||||
|
||||
apply {
|
||||
plugin("kotlin")
|
||||
plugin("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:builtins"))
|
||||
compile(project(":core"))
|
||||
compile(protobufLite())
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
dependsOn(protobufLiteTask)
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
dependsOn(protobufLiteTask)
|
||||
}
|
||||
@@ -7,7 +7,6 @@ apply {
|
||||
jvmTarget = "1.6"
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:builtins"))
|
||||
compile(projectDist(":kotlin-stdlib"))
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ dependencies {
|
||||
|
||||
configurations {
|
||||
mainJar
|
||||
builtins
|
||||
}
|
||||
|
||||
task originalStdlibJar(type: Jar) {
|
||||
@@ -69,12 +70,20 @@ task distJar(type: Jar) {
|
||||
baseName = 'dist-kotlin-stdlib'
|
||||
version = null
|
||||
manifestAttributes(manifest, project, 'Main')
|
||||
dependsOn ":core:builtins:serialize"
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.annotations.output
|
||||
from sourceSets.builtins.output
|
||||
from sourceSets.main.output
|
||||
}
|
||||
|
||||
task builtinsJar(type: Jar) {
|
||||
baseName = "builtins"
|
||||
dependsOn ":core:builtins:serialize"
|
||||
from("${rootDir}/dist/builtins")
|
||||
from sourceSets.builtins.output
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
from "${rootDir}/core/builtins/native"
|
||||
from sourceSets.builtins.kotlin
|
||||
@@ -84,6 +93,7 @@ artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
mainJar jar
|
||||
builtins builtinsJar
|
||||
}
|
||||
|
||||
dist {
|
||||
|
||||
@@ -14,7 +14,6 @@ buildscript {
|
||||
}
|
||||
|
||||
val projectsToShadow = listOf(
|
||||
":core:builtins",
|
||||
":plugins:annotation-based-compiler-plugins-ide-support",
|
||||
":compiler:backend",
|
||||
":compiler:backend-common",
|
||||
@@ -56,6 +55,7 @@ val sideJars by configurations.creating
|
||||
dependencies {
|
||||
packedJars(commonDep("com.github.spullara.cli-parser", "cli-parser"))
|
||||
packedJars(preloadedDeps("protobuf-${rootProject.extra["versions.protobuf-java"]}"))
|
||||
packedJars(project(":kotlin-stdlib", configuration = "builtins"))
|
||||
sideJars(projectDist(":kotlin-script-runtime"))
|
||||
sideJars(commonDep("io.javaslang", "javaslang"))
|
||||
sideJars(commonDep("javax.inject"))
|
||||
|
||||
@@ -33,6 +33,7 @@ tasks.withType<JavaCompile> {
|
||||
}
|
||||
|
||||
val jar = runtimeJar {
|
||||
dependsOn(":core:builtins:serialize")
|
||||
from(fileTree("${rootProject.extra["distDir"]}/builtins")) { include("kotlin/**") }
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ include ":kotlin-build-common",
|
||||
":kotlin-jps-plugin",
|
||||
":core",
|
||||
":core:builtins",
|
||||
":core:reflection.jvm",
|
||||
":core:util.runtime",
|
||||
":custom-dependencies:protobuf-lite",
|
||||
":idea:idea-jps-common",
|
||||
|
||||
Reference in New Issue
Block a user