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