Refactoring - renaming projects, applying sourceSets DSL

This commit is contained in:
Ilya Chernikov
2017-09-11 14:21:44 +02:00
parent a6aaee3fe0
commit 96d5e0bb21
23 changed files with 84 additions and 93 deletions
+7 -11
View File
@@ -1,5 +1,5 @@
import org.gradle.jvm.tasks.Jar description = "Kotlin Ant Tools"
apply { plugin("kotlin") } apply { plugin("kotlin") }
@@ -11,19 +11,15 @@ dependencies {
buildVersion() buildVersion()
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar: Jar by tasks runtimeJar {
jar.apply {
setupRuntimeJar("Kotlin Ant Tools")
archiveName = "kotlin-ant.jar"
from("$projectDir/src") { include("**/*.xml") } from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar") manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar")
} }
dist { dist()
from(jar)
}
+3 -1
View File
@@ -51,10 +51,12 @@ dependencies {
val commonBuildDir = File(rootDir, "build") val commonBuildDir = File(rootDir, "build")
val distDir = "$rootDir/dist" val distDir = "$rootDir/dist"
val distLibDir = "$distDir/kotlinc/lib" val distKotlinHomeDir = "$distDir/kotlinc"
val distLibDir = "$distKotlinHomeDir/lib"
val ideaPluginDir = "$distDir/artifacts/Kotlin" val ideaPluginDir = "$distDir/artifacts/Kotlin"
extra["distDir"] = distDir extra["distDir"] = distDir
extra["distKotlinHomeDir"] = distKotlinHomeDir
extra["distLibDir"] = project.file(distLibDir) extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir) extra["libsDir"] = project.file(distLibDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir) extra["ideaPluginDir"] = project.file(ideaPluginDir)
+2 -2
View File
@@ -18,11 +18,11 @@ dependencies {
compile(project(":compiler:serialization")) compile(project(":compiler:serialization"))
compile(project(":kotlin-preloader")) compile(project(":kotlin-preloader"))
compile(project(":compiler:daemon-common")) compile(project(":compiler:daemon-common"))
compile(project(":compiler:daemon-client")) compile(project(":kotlin-daemon-client"))
compile(project(":js:js.serializer")) compile(project(":js:js.serializer"))
compile(project(":js:js.frontend")) compile(project(":js:js.frontend"))
compile(project(":js:js.translator")) compile(project(":js:js.translator"))
compile(project(":plugins:android-extensions-compiler")) compile(project(":android-extensions-compiler"))
compile(project(":kotlin-test:kotlin-test-jvm")) compile(project(":kotlin-test:kotlin-test-jvm"))
compile(commonDep("junit")) compile(commonDep("junit"))
compile(ideaSdkCoreDeps("intellij-core")) compile(ideaSdkCoreDeps("intellij-core"))
+2 -2
View File
@@ -32,8 +32,8 @@ dependencies {
testCompile(project(":kotlin-script-runtime")) testCompile(project(":kotlin-script-runtime"))
testCompile(project(":kotlin-runtime")) testCompile(project(":kotlin-runtime"))
testCompile(project(":kotlin-reflect")) testCompile(project(":kotlin-reflect"))
testCompile(project(":plugins:android-extensions-compiler")) testCompile(project(":android-extensions-compiler"))
testCompile(project(":ant")) testCompile(project(":kotlin-ant"))
otherCompilerModules.forEach { otherCompilerModules.forEach {
testCompile(project(it)) testCompile(project(it))
} }
+7 -10
View File
@@ -1,5 +1,5 @@
import org.gradle.jvm.tasks.Jar description = "Kotlin Runner"
apply { plugin("kotlin") } apply { plugin("kotlin") }
@@ -9,18 +9,15 @@ dependencies {
buildVersion() buildVersion()
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar: Jar by tasks runtimeJar {
jar.apply {
setupRuntimeJar("Kotlin Runner")
manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.runner.Main") manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.runner.Main")
manifest.attributes.put("Class-Path", "kotlin-runtime.jar") manifest.attributes.put("Class-Path", "kotlin-runtime.jar")
archiveName = "kotlin-runner.jar"
} }
dist { dist()
from(jar)
}
+1 -1
View File
@@ -8,7 +8,7 @@ dependencies {
compile(project(":kotlin-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(":kotlin-daemon-client"))
compile(project(":compiler:util")) compile(project(":compiler:util"))
} }
+8 -15
View File
@@ -1,5 +1,5 @@
import org.gradle.jvm.tasks.Jar description = "Kotlin Daemon Client"
apply { plugin("kotlin") } apply { plugin("kotlin") }
@@ -14,22 +14,15 @@ dependencies {
buildVersion() buildVersion()
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar: Jar by tasks runtimeJar {
jar.apply {
setupRuntimeJar("Kotlin Daemon Client")
from(zipTree(nativePlatformUberjar)) from(zipTree(nativePlatformUberjar))
archiveName = "kotlin-daemon-client.jar"
} }
sourcesJar()
val sourcesJar by task<Jar> { dist()
setupSourceJar("Kotlin Daemon Client")
archiveName = "kotlin-daemon-client-sources.jar"
}
dist {
from(jar)
}
+2 -2
View File
@@ -14,7 +14,7 @@ dependencies {
compile(project(":core")) compile(project(":core"))
compile(project(":compiler:backend")) compile(project(":compiler:backend"))
compile(project(":compiler:cli-common")) compile(project(":compiler:cli-common"))
compile(project(":compiler:daemon-client")) compile(project(":kotlin-daemon-client"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:frontend.script")) compile(project(":compiler:frontend.script"))
@@ -76,7 +76,7 @@ dependencies {
testRuntime(preloadedDeps("uast-common", "uast-java")) testRuntime(preloadedDeps("uast-common", "uast-java"))
// deps below are test runtime deps, but made test compile to split compilation and running to reduce mem req // deps below are test runtime deps, but made test compile to split compilation and running to reduce mem req
testCompile(project(":plugins:android-extensions-compiler")) testCompile(project(":android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-idea")) { isTransitive = false } testCompile(project(":plugins:android-extensions-idea")) { isTransitive = false }
testCompile(project(":plugins:allopen-ide")) { isTransitive = false } testCompile(project(":plugins:allopen-ide")) { isTransitive = false }
testCompile(project(":kotlin-allopen-compiler-plugin")) testCompile(project(":kotlin-allopen-compiler-plugin"))
+1 -1
View File
@@ -12,7 +12,7 @@ dependencies {
compile(project(":j2k")) compile(project(":j2k"))
compile(project(":idea:ide-common")) compile(project(":idea:ide-common"))
compile(project(":idea:idea-jps-common")) compile(project(":idea:idea-jps-common"))
compile(project(":plugins:android-extensions-compiler")) compile(project(":android-extensions-compiler"))
compile(ideaSdkCoreDeps("intellij-core", "util")) compile(ideaSdkCoreDeps("intellij-core", "util"))
compile(ideaSdkDeps("openapi", "idea")) compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle")) compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
+1 -1
View File
@@ -16,7 +16,7 @@ dependencies {
compile(project(":core")) compile(project(":core"))
compile(project(":compiler:compiler-runner")) compile(project(":compiler:compiler-runner"))
compile(project(":compiler:daemon-common")) compile(project(":compiler:daemon-common"))
compile(project(":compiler:daemon-client")) compile(project(":kotlin-daemon-client"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":kotlin-preloader")) compile(project(":kotlin-preloader"))
compile(project(":idea:idea-jps-common")) compile(project(":idea:idea-jps-common"))
@@ -16,7 +16,7 @@ dependencies {
testCompile project(path: ':examples:annotation-processor-example') testCompile project(path: ':examples:annotation-processor-example')
testCompile project(':kotlin-stdlib-jre8') testCompile project(':kotlin-stdlib-jre8')
testCompile project(':plugins:android-extensions-compiler') testCompile project(':android-extensions-compiler')
testCompile project(path: ':build-common', configuration: 'tests-jar') testCompile project(path: ':build-common', configuration: 'tests-jar')
testCompile 'org.jetbrains.kotlin:gradle-api:2.2' testCompile 'org.jetbrains.kotlin:gradle-api:2.2'
@@ -30,7 +30,7 @@ dependencies {
compile project(':kotlin-gradle-plugin-api') compile project(':kotlin-gradle-plugin-api')
compile project(':kotlin-stdlib') compile project(':kotlin-stdlib')
compile project(':plugins:android-extensions-compiler') compile project(':android-extensions-compiler')
// compile project(path: ':compiler', configuration: 'embeddableCompilerJar') // compile project(path: ':compiler', configuration: 'embeddableCompilerJar')
compile project(':build-common') compile project(':build-common')
compile project(':compiler:compiler-runner') compile project(':compiler:compiler-runner')
+4 -2
View File
@@ -13,8 +13,10 @@ dependencies {
runtime(project(":kotlin-stdlib")) runtime(project(":kotlin-stdlib"))
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar = runtimeJar { val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") } from(fileTree("$projectDir/src")) { include("META-INF/**") }
@@ -1,5 +1,5 @@
import org.gradle.jvm.tasks.Jar description = "Kotlin Android Extensions Compiler"
apply { plugin("kotlin") } apply { plugin("kotlin") }
@@ -18,16 +18,17 @@ configureKotlinProjectSources("android-extensions-compiler/src", "android-extens
configureKotlinProjectResourcesDefault(sourcesBaseDir = File(rootDir, "plugins", "android-extensions", "android-extensions-compiler", "src")) configureKotlinProjectResourcesDefault(sourcesBaseDir = File(rootDir, "plugins", "android-extensions", "android-extensions-compiler", "src"))
configureKotlinProjectNoTests() configureKotlinProjectNoTests()
val jar: Jar by tasks sourceSets {
jar.apply { "main" {
setupRuntimeJar("Kotlin Android Extensions Compiler") default()
java.srcDir("../android-extensions-runtime/src")
}
"test" { none() }
} }
dist { runtimeJar ()
from(jar)
}
ideaPlugin { dist()
from(jar)
} ideaPlugin()
@@ -14,7 +14,7 @@ dependencies {
compile(project(":compiler:light-classes")) compile(project(":compiler:light-classes"))
compile(project(":idea:idea-core")) compile(project(":idea:idea-core"))
compile(project(":idea")) compile(project(":idea"))
compile(project(":plugins:android-extensions-compiler")) compile(project(":android-extensions-compiler"))
compile(ideaPluginDeps("android", "sdk-tools", "sdk-common", plugin = "android")) compile(ideaPluginDeps("android", "sdk-tools", "sdk-common", plugin = "android"))
compile(ideaPluginDeps("Groovy", plugin = "Groovy")) compile(ideaPluginDeps("Groovy", plugin = "Groovy"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
@@ -5,7 +5,7 @@ dependencies {
val compile by configurations val compile by configurations
compile(project(":compiler:util")) compile(project(":compiler:util"))
compile(project(":jps-plugin")) compile(project(":jps-plugin"))
compile(project(":plugins:android-extensions-compiler")) compile(project(":android-extensions-compiler"))
compile(ideaPluginDeps("android-jps-plugin", plugin = "android", subdir = "lib/jps")) compile(ideaPluginDeps("android-jps-plugin", plugin = "android", subdir = "lib/jps"))
} }
+1 -1
View File
@@ -11,7 +11,7 @@ dependencies {
testCompile(project(":compiler:backend")) testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli")) testCompile(project(":compiler:cli"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(project(":plugins:android-extensions-compiler")) testCompile(project(":android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-idea")) testCompile(project(":plugins:android-extensions-idea"))
testCompile(project(":plugins:allopen-ide")) { isTransitive = false } testCompile(project(":plugins:allopen-ide")) { isTransitive = false }
testCompile(project(":kotlin-allopen-compiler-plugin")) testCompile(project(":kotlin-allopen-compiler-plugin"))
@@ -13,8 +13,10 @@ dependencies {
runtime(project(":kotlin-stdlib")) runtime(project(":kotlin-stdlib"))
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar = runtimeJar { val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") } from(fileTree("$projectDir/src")) { include("META-INF/**") }
@@ -22,23 +22,12 @@ dependencies {
testCompile(project(":compiler:cli-common")) testCompile(project(":compiler:cli-common"))
testCompile(project(":compiler:frontend.java")) testCompile(project(":compiler:frontend.java"))
testCompile(project(":compiler:daemon-common")) testCompile(project(":compiler:daemon-common"))
testCompile(project(":compiler:daemon-client")) testCompile(project(":kotlin-daemon-client"))
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectResources("src") { "main" { default() }
include("META-INF/**") "test" { default() }
}
configureKotlinProjectTestsDefault()
val jar = runtimeJar()
sourcesJar()
javadocJar()
publish()
dist {
from(jar)
} }
tasks.withType<Test> { tasks.withType<Test> {
@@ -46,6 +35,14 @@ tasks.withType<Test> {
workingDir = rootDir workingDir = rootDir
systemProperty("idea.is.unit.test", "true") systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true") environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
environment("KOTLIN_HOME", rootProject.extra["distKotlinHomeDir"])
ignoreFailures = true ignoreFailures = true
} }
runtimeJar()
sourcesJar()
javadocJar()
dist()
publish()
@@ -27,7 +27,7 @@ val archives by configurations
val projectsToInclude = listOf( val projectsToInclude = listOf(
":compiler:cli-common", ":compiler:cli-common",
":compiler:daemon-common", ":compiler:daemon-common",
":compiler:daemon-client") ":kotlin-daemon-client")
dependencies { dependencies {
val testCompile by configurations val testCompile by configurations
+6 -6
View File
@@ -14,18 +14,18 @@ dependencies {
buildVersion() buildVersion()
} }
configureKotlinProjectSourcesDefault() sourceSets {
configureKotlinProjectNoTests() "main" { default() }
"test" { none() }
}
val jar = runtimeJar { runtimeJar {
from(zipTree(nativePlatformUberjar)) from(zipTree(nativePlatformUberjar))
} }
sourcesJar() sourcesJar()
javadocJar() javadocJar()
dist { dist()
from(jar)
}
publish() publish()
+1 -1
View File
@@ -7,7 +7,7 @@ val projectsToShadow = listOf(
":build-common", ":build-common",
":compiler:cli-common", ":compiler:cli-common",
":compiler:compiler-runner", ":compiler:compiler-runner",
":compiler:daemon-client", ":kotlin-daemon-client",
":compiler:daemon-common", ":compiler:daemon-common",
":core", ":core",
":idea:idea-jps-common", ":idea:idea-jps-common",
+6 -5
View File
@@ -6,7 +6,7 @@ include ":build-common",
":compiler:daemon-common", ":compiler:daemon-common",
":kotlin-daemon-client", ":kotlin-daemon-client",
":kotlin-preloader", ":kotlin-preloader",
":compiler:cli-runner", ":kotlin-runner",
":compiler:container", ":compiler:container",
":compiler:resolution", ":compiler:resolution",
":compiler:serialization", ":compiler:serialization",
@@ -52,7 +52,7 @@ include ":build-common",
":eval4j", ":eval4j",
":j2k", ":j2k",
":plugins:lint", ":plugins:lint",
":plugins:android-extensions-compiler", ":android-extensions-compiler",
":plugins:android-extensions-idea", ":plugins:android-extensions-idea",
":plugins:android-extensions-jps", ":plugins:android-extensions-jps",
":kotlin-allopen-compiler-plugin", ":kotlin-allopen-compiler-plugin",
@@ -91,7 +91,7 @@ include ":build-common",
":kotlin-compiler-client-embeddable", ":kotlin-compiler-client-embeddable",
":kotlin-daemon-client", ":kotlin-daemon-client",
":kotlin-reflect", ":kotlin-reflect",
":ant", ":kotlin-ant",
":compiler:tests-java8", ":compiler:tests-java8",
":generators", ":generators",
":tools:binary-compatibility-validator", ":tools:binary-compatibility-validator",
@@ -128,14 +128,15 @@ project(':kotlin-compiler-client-embeddable').projectDir = "$rootDir/prepare/com
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(':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(':kotlin-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
project(':kotlin-daemon-client').projectDir = "$rootDir/compiler/daemon/daemon-client" as File project(':kotlin-daemon-client').projectDir = "$rootDir/compiler/daemon/daemon-client" as File
project(':kotlin-ant').projectDir = "$rootDir/ant" as File
project(':compiler:ir.tree').projectDir = "$rootDir/compiler/ir/ir.tree" as File project(':compiler:ir.tree').projectDir = "$rootDir/compiler/ir/ir.tree" as File
project(':compiler:ir.psi2ir').projectDir = "$rootDir/compiler/ir/ir.psi2ir" as File project(':compiler:ir.psi2ir').projectDir = "$rootDir/compiler/ir/ir.psi2ir" as File
project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as File project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as File
project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File
project(':plugins:android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File project(':android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File
project(':plugins:android-extensions-idea').projectDir = "$rootDir/plugins/android-extensions/android-extensions-idea" as File project(':plugins:android-extensions-idea').projectDir = "$rootDir/plugins/android-extensions/android-extensions-idea" as File
project(':plugins:android-extensions-jps').projectDir = "$rootDir/plugins/android-extensions/android-extensions-jps" as File project(':plugins:android-extensions-jps').projectDir = "$rootDir/plugins/android-extensions/android-extensions-jps" as File
project(':kotlin-allopen-compiler-plugin').projectDir = "$rootDir/plugins/allopen/allopen-cli" as File project(':kotlin-allopen-compiler-plugin').projectDir = "$rootDir/plugins/allopen/allopen-cli" as File