Refactor and clean preloader project

This commit is contained in:
Ilya Chernikov
2017-09-11 13:06:15 +02:00
parent 1d56730538
commit 513ab08edd
11 changed files with 27 additions and 23 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ apply { plugin("kotlin") }
dependencies { dependencies {
val compile by configurations val compile by configurations
compile(commonDep("org.apache.ant", "ant")) compile(commonDep("org.apache.ant", "ant"))
compile(project(":compiler:preloader")) compile(project(":kotlin-preloader"))
compile(project(":kotlin-stdlib")) compile(project(":kotlin-stdlib"))
buildVersion() buildVersion()
} }
+1 -1
View File
@@ -158,7 +158,7 @@ fun Project.allprojectsRecursive(body: Project.() -> Unit) {
allprojects { allprojects {
setBuildDir(File(commonBuildDir, project.name)) buildDir = File(commonBuildDir, project.name)
repositories { repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) { for (repo in (rootProject.extra["repos"] as List<String>)) {
+7 -4
View File
@@ -95,17 +95,20 @@ fun Project.ideaPlugin() = ideaPlugin {
} }
fun Project.dist(body: Copy.() -> Unit = {}) { fun Project.dist(body: Copy.() -> Unit) {
task<Copy>("dist") { task<Copy>("dist") {
tasks.findByName("assemble")?.let {
dependsOn(it)
}
body() body()
rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "") rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "")
into(rootProject.extra["distLibDir"].toString()) into(rootProject.extra["distLibDir"].toString())
} }
} }
fun Project.dist() = dist {
tasks.findByName("jar")?.let {
from(it)
}
}
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name) fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) { fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) {
+1 -1
View File
@@ -16,7 +16,7 @@ dependencies {
compile(project(":compiler:cli")) compile(project(":compiler:cli"))
compile(project(":compiler:light-classes")) compile(project(":compiler:light-classes"))
compile(project(":compiler:serialization")) compile(project(":compiler:serialization"))
compile(project(":compiler:preloader")) compile(project(":kotlin-preloader"))
compile(project(":compiler:daemon-common")) compile(project(":compiler:daemon-common"))
compile(project(":compiler:daemon-client")) compile(project(":compiler:daemon-client"))
compile(project(":js:js.serializer")) compile(project(":js:js.serializer"))
+1 -1
View File
@@ -5,7 +5,7 @@ dependencies {
val compile by configurations val compile by configurations
compile(project(":build-common")) compile(project(":build-common"))
compile(project(":compiler:cli-common")) compile(project(":compiler:cli-common"))
compile(project(":compiler:preloader")) compile(project(":kotlin-preloader"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:daemon-common")) compile(project(":compiler:daemon-common"))
compile(project(":compiler:daemon-client")) compile(project(":compiler:daemon-client"))
+11 -11
View File
@@ -1,5 +1,5 @@
import org.gradle.jvm.tasks.Jar description = "Kotlin Preloader"
apply { plugin("kotlin") } apply { plugin("kotlin") }
@@ -9,17 +9,17 @@ dependencies {
buildVersion() buildVersion()
} }
configureKotlinProjectSources("src", "instrumentation/src") sourceSets {
configureKotlinProjectNoTests() "main" {
java {
srcDirs( "src", "instrumentation/src")
}
}
"test" { none() }
}
val jar: Jar by tasks runtimeJar {
jar.apply {
setupRuntimeJar("Kotlin Preloader")
manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.preloading.Preloader") manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.preloading.Preloader")
archiveName = "kotlin-preloader.jar"
}
dist {
from(jar)
} }
dist()
+1 -1
View File
@@ -26,7 +26,7 @@ dependencies {
testCompile(project(":kotlin-runtime")) testCompile(project(":kotlin-runtime"))
testCompile(project(":kotlin-reflect")) testCompile(project(":kotlin-reflect"))
testCompile(projectTests(":compiler")) testCompile(projectTests(":compiler"))
testRuntime(project(":compiler:preloader")) testRuntime(project(":kotlin-preloader"))
testRuntime(ideaSdkCoreDeps("*.jar")) testRuntime(ideaSdkCoreDeps("*.jar"))
testRuntime(ideaSdkDeps("*.jar")) testRuntime(ideaSdkDeps("*.jar"))
} }
+1 -1
View File
@@ -18,7 +18,7 @@ dependencies {
compile(project(":compiler:daemon-common")) compile(project(":compiler:daemon-common"))
compile(project(":compiler:daemon-client")) compile(project(":compiler:daemon-client"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:preloader")) compile(project(":kotlin-preloader"))
compile(project(":idea:idea-jps-common")) compile(project(":idea:idea-jps-common"))
compile(ideaSdkDeps("jps-builders", "jps-builders-6", subdir = "jps")) compile(ideaSdkDeps("jps-builders", "jps-builders-6", subdir = "jps"))
buildVersion() buildVersion()
+1 -1
View File
@@ -12,7 +12,7 @@ val projectsToShadow = listOf(
":core", ":core",
":idea:idea-jps-common", ":idea:idea-jps-common",
":jps-plugin", ":jps-plugin",
":compiler:preloader", ":kotlin-preloader",
":compiler:util", ":compiler:util",
":core:util.runtime", ":core:util.runtime",
":plugins:android-extensions-jps") ":plugins:android-extensions-jps")
+1 -1
View File
@@ -42,7 +42,7 @@ val projectsToShadow = listOf(
":js:js.serializer", ":js:js.serializer",
":compiler:light-classes", ":compiler:light-classes",
":compiler:plugin-api", ":compiler:plugin-api",
":compiler:preloader", ":kotlin-preloader",
":compiler:resolution", ":compiler:resolution",
":compiler:serialization", ":compiler:serialization",
":compiler:util", ":compiler:util",
+1
View File
@@ -126,6 +126,7 @@ project(':kotlin-compiler').projectDir = "$rootDir/prepare/compiler" as File
project(':kotlin-compiler-embeddable').projectDir = "$rootDir/prepare/compiler-embeddable" as File project(':kotlin-compiler-embeddable').projectDir = "$rootDir/prepare/compiler-embeddable" as File
project(':kotlin-compiler-client-embeddable').projectDir = "$rootDir/prepare/compiler-client-embeddable" as File project(':kotlin-compiler-client-embeddable').projectDir = "$rootDir/prepare/compiler-client-embeddable" as File
project(':kotlin-daemon-client').projectDir = "$rootDir/prepare/daemon-client" as File project(':kotlin-daemon-client').projectDir = "$rootDir/prepare/daemon-client" as File
project(':kotlin-preloader').projectDir = "$rootDir/compiler/preloader" as File
project(':compiler:cli-common').projectDir = "$rootDir/compiler/cli/cli-common" as File project(':compiler:cli-common').projectDir = "$rootDir/compiler/cli/cli-common" as File
project(':compiler:cli-runner').projectDir = "$rootDir/compiler/cli/cli-runner" as File project(':compiler:cli-runner').projectDir = "$rootDir/compiler/cli/cli-runner" as File
project(':compiler:daemon-common').projectDir = "$rootDir/compiler/daemon/daemon-common" as File project(':compiler:daemon-common').projectDir = "$rootDir/compiler/daemon/daemon-common" as File