Skip to content

Commit

Permalink
JPS Build: exclude :core:builtins, use prebuilt bootstrap version
Browse files Browse the repository at this point in the history
  • Loading branch information
snrostov committed Mar 28, 2019
1 parent fb3f289 commit 7b89b0a
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Expand Up @@ -312,6 +312,7 @@ allprojects {
jcenter()
maven(protobufRepo)
maven(intellijRepo)
maven(bootstrapKotlinRepo!!.replace("artifacts/content/maven/", "artifacts/content/internal/repo"))
}

configureJvmProject(javaHome!!, jvmTarget!!)
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/buildProperties.kt
Expand Up @@ -52,6 +52,9 @@ class KotlinBuildProperties(

val includeJava9: Boolean
get() = !isInJpsBuildIdeaSync

val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync
}

private const val extensionName = "kotlinBuildFlags"
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/dependencies.kt
Expand Up @@ -75,16 +75,17 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:

fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"

val Project.useBootstrapStdlib: Boolean
get() = kotlinBuildProperties.isInJpsBuildIdeaSync

fun Project.kotlinStdlib(suffix: String? = null): Any {
return if (useBootstrapStdlib)
return if (kotlinBuildProperties.useBootstrapStdlib)
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion)
else
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"))
}

fun Project.kotlinBuiltins(): Any =
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
else dependencies.project(":core:builtins")

fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
Expand Down
1 change: 0 additions & 1 deletion compiler/build.gradle.kts
Expand Up @@ -65,7 +65,6 @@ dependencies {
antLauncherJar(commonDep("org.apache.ant", "ant"))
antLauncherJar(files(toolsJar()))

// For JPS build
if (project.kotlinBuildProperties.isInJpsBuildIdeaSync) {
testRuntimeOnly(files("${rootProject.projectDir}/dist/kotlinc/lib/kotlin-reflect.jar"))
}
Expand Down
2 changes: 1 addition & 1 deletion include/kotlin-compiler/build.gradle.kts
Expand Up @@ -15,7 +15,7 @@ dependencies {
compile(project(module)) { isTransitive = false }
}

fatJarContents(project(":core:builtins"))
fatJarContents(kotlinBuiltins())
fatJarContents(commonDep("javax.inject"))
fatJarContents(commonDep("org.jline", "jline"))
fatJarContents(commonDep("org.fusesource.jansi", "jansi"))
Expand Down
4 changes: 0 additions & 4 deletions libraries/stdlib/jps-build/build.gradle.kts
Expand Up @@ -4,10 +4,6 @@ import java.util.regex.Pattern

description = "Stdlib configuration for JPS build (to be interpreted during IDEA project import)"

repositories {
maven(bootstrapKotlinRepo!!.replace("artifacts/content/maven/", "artifacts/content/internal/repo"))
}

val distLib by configurations.creating
val distCommon by configurations.creating
val distRoot by configurations.creating
Expand Down
Expand Up @@ -23,7 +23,7 @@ sourceSets {
}

dependencies {
compile(project(":core:builtins"))
compile(kotlinBuiltins())
}

publish()
Expand Down
2 changes: 1 addition & 1 deletion libraries/tools/kotlin-annotations-jvm/build.gradle
Expand Up @@ -20,7 +20,7 @@ sourceSets {
}

dependencies {
compile project(':core:builtins')
compile DependenciesKt.kotlinBuiltins(project)
}

artifacts {
Expand Down
2 changes: 1 addition & 1 deletion prepare/compiler/build.gradle.kts
Expand Up @@ -71,7 +71,7 @@ dependencies {

trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } }

fatJarContents(project(":core:builtins"))
fatJarContents(kotlinBuiltins())
fatJarContents(commonDep("javax.inject"))
fatJarContents(commonDep("org.jline", "jline"))
fatJarContents(commonDep("org.fusesource.jansi", "jansi"))
Expand Down
2 changes: 1 addition & 1 deletion prepare/compiler/build.gradle.kts.182
Expand Up @@ -71,7 +71,7 @@ dependencies {

trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } }

fatJarContents(project(":core:builtins"))
fatJarContents(kotlinBuiltins())
fatJarContents(commonDep("javax.inject"))
fatJarContents(commonDep("org.jline", "jline"))
fatJarContents(commonDep("org.fusesource.jansi", "jansi"))
Expand Down
2 changes: 1 addition & 1 deletion prepare/compiler/build.gradle.kts.as34
Expand Up @@ -71,7 +71,7 @@ dependencies {

trove4jJar(intellijDep()) { includeIntellijCoreJarDependencies(project) { it.startsWith("trove4j") } }

fatJarContents(project(":core:builtins"))
fatJarContents(kotlinBuiltins())
fatJarContents(commonDep("javax.inject"))
fatJarContents(commonDep("org.jline", "jline"))
fatJarContents(commonDep("org.fusesource.jansi", "jansi"))
Expand Down
2 changes: 1 addition & 1 deletion prepare/idea-plugin/build.gradle.kts
Expand Up @@ -78,7 +78,7 @@ val sideJars by configurations.creating

dependencies {
packedJars(protobufFull())
packedJars(project(":core:builtins"))
packedJars(kotlinBuiltins())
sideJars(project(":kotlin-script-runtime"))
sideJars(kotlinStdlib())
sideJars(kotlinStdlib("jdk7"))
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Expand Up @@ -73,7 +73,6 @@ include ":kotlin-build-common",
":core:descriptors.runtime",
":core:metadata",
":core:metadata.jvm",
":core:builtins",
":core:util.runtime",
":dependencies:android-sdk",
":idea:fir-view",
Expand Down Expand Up @@ -229,7 +228,8 @@ if (flags.inJpsBuildIdeaSync) {
include ":kotlin-idl2k"
project(':kotlin-idl2k').projectDir = file("$rootDir/libraries/tools/idl2k")

include ":kotlin-stdlib-common",
include ":core:builtins",
":kotlin-stdlib-common",
":kotlin-stdlib",
":kotlin-stdlib-js",
":kotlin-stdlib-jdk7",
Expand Down

0 comments on commit 7b89b0a

Please sign in to comment.