Continue switching projects to improved dsl: sourceSets and test running

This commit is contained in:
Ilya Chernikov
2017-08-21 20:53:48 +02:00
parent 336e24b837
commit deda50dbbb
76 changed files with 372 additions and 614 deletions
+8 -18
View File
@@ -1,15 +1,7 @@
apply {
plugin("kotlin")
}
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":compiler:util"))
compile(project(":compiler:cli"))
compile(project(":compiler.tests-common"))
@@ -28,13 +20,11 @@ dependencies {
testCompile(ideaSdkDeps("jps-builders"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
tasks.withType<Test> {
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
systemProperty("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
sourceSets {
"main" { java.srcDirs() }
"test" { projectDefault() }
}
projectTest {
workingDir = rootDir
}
+7 -4
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
@@ -10,6 +9,10 @@ dependencies {
compile(project(":compiler:cli-common"))
}
configureKotlinProjectSources("backend-common/src", "ir/backend.common/src", sourcesBaseDir = File(rootDir, "compiler"))
configureKotlinProjectNoTests()
sourceSets {
"main" {
projectDefault()
java.srcDir("../ir/backend.common/src")
}
"test" {}
}
+7 -4
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:backend-common"))
compile(project(":compiler:frontend"))
@@ -12,7 +11,11 @@ dependencies {
compile(project(":compiler:serialization"))
}
configureKotlinProjectSources("backend/src", "ir/backend.jvm/src", sourcesBaseDir = File(rootDir, "compiler"))
configureKotlinProjectResourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" {
projectDefault()
java.srcDir("../ir/backend.jvm/src")
}
"test" {}
}
+12 -15
View File
@@ -39,28 +39,25 @@ dependencies {
buildVersion()
}
configureKotlinProjectSources(
"compiler/daemon/src",
"compiler/conditional-preprocessor/src",
sourcesBaseDir = rootDir)
configureKotlinProjectResources("idea/src", sourcesBaseDir = rootDir) {
include("META-INF/extensions/common.xml",
"META-INF/extensions/kotlin2jvm.xml",
"META-INF/extensions/kotlin2js.xml")
sourceSets {
"main" {
java.srcDirs("daemon/src",
"conditional-preprocessor/src")
resources.srcDir("../idea/src").apply {
include("META-INF/extensions/common.xml",
"META-INF/extensions/kotlin2jvm.xml",
"META-INF/extensions/kotlin2js.xml")
}
}
"test" { projectDefault() }
}
configureKotlinProjectTests("tests")
testsJar {}
tasks.withType<Test> {
projectTest {
dependsOnTaskIfExistsRec("dist", project = rootProject)
dependsOn(":prepare:mock-runtime-for-test:dist")
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1200m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
maxHeapSize = "1200m"
ignoreFailures = true
}
+9 -9
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:cli-common"))
compile(project(":compiler:frontend"))
@@ -22,11 +21,12 @@ dependencies {
compile(files("${System.getProperty("java.home")}/../lib/tools.jar"))
}
configureKotlinProjectSources("compiler/cli/src",
"plugins/annotation-collector/src",
"compiler/builtins-serializer/src",
"compiler/javac-wrapper/src",
sourcesBaseDir = rootDir)
configureKotlinProjectResourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" {
projectDefault()
java.srcDirs("../../plugins/annotation-collector/src",
"../builtins-serializer/src",
"../javac-wrapper/src")
}
"test" {}
}
+4 -3
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core:util.runtime"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
@@ -10,6 +9,8 @@ dependencies {
compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>)))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+1 -1
View File
@@ -11,7 +11,7 @@ dependencies {
sourceSets {
"main" { projectDefault() }
"test" { none() }
"test" {}
}
runtimeJar {
+4 -3
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":kotlin-build-common"))
compile(project(":compiler:cli-common"))
compile(project(":kotlin-preloader"))
@@ -12,6 +11,8 @@ dependencies {
compile(project(":compiler:util"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+5 -12
View File
@@ -2,11 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":core:util.runtime"))
compile(commonDep("javax.inject"))
compile(ideaSdkCoreDeps("intellij-core"))
@@ -15,17 +10,15 @@ dependencies {
testRuntime(ideaSdkCoreDeps("trove4j", "intellij-core"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
}
testsJar {}
tasks.withType<Test> {
projectTest {
dependsOnTaskIfExistsRec("dist", project = rootProject)
dependsOn(":prepare:mock-runtime-for-test:dist")
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
@@ -14,7 +14,7 @@ dependencies {
sourceSets {
"main" { projectDefault() }
"test" { none() }
"test" {}
}
runtimeJar {
@@ -2,13 +2,14 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(project(":compiler:util"))
compile(project(":compiler:cli-common"))
compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>)))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -4
View File
@@ -2,13 +2,13 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectResourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,13 +2,14 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":kotlin-reflect"))
compile(preloadedDeps("kotlinx-coroutines-core"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(project(":compiler:util"))
compile(project(":compiler:container"))
@@ -11,6 +10,8 @@ dependencies {
compile(commonDep("io.javaslang","javaslang"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
@@ -2,7 +2,6 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
@@ -14,7 +13,9 @@ dependencies {
testCompile(projectTests(":kotlin-build-common"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
}
testsJar()
+4 -3
View File
@@ -2,12 +2,13 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:ir.tree"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,13 +2,14 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:backend-common"))
compile(project(":compiler:ir.tree"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,11 +2,12 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,13 +2,14 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":compiler:backend"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,12 +2,13 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(ideaSdkCoreDeps("intellij-core"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+1 -1
View File
@@ -15,7 +15,7 @@ sourceSets {
srcDirs( "src", "instrumentation/src")
}
}
"test" { none() }
"test" {}
}
runtimeJar {
+4 -3
View File
@@ -2,11 +2,12 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":core"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+4 -3
View File
@@ -2,11 +2,12 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":core"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
sourceSets {
"main" { projectDefault() }
"test" {}
}
+5 -13
View File
@@ -3,11 +3,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":kotlin-test:kotlin-test-junit"))
@@ -31,8 +26,10 @@ dependencies {
testRuntime(ideaSdkDeps("*.jar"))
}
configureKotlinProjectSources()
configureKotlinProjectTestsDefault()
sourceSets {
"main" {}
"test" { projectDefault() }
}
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = rootProject.extra["JDK_18"]!!.toString()
@@ -41,16 +38,11 @@ tasks.withType<KotlinCompile> {
testsJar {}
tasks.withType<Test> {
projectTest {
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
dependsOnTaskIfExistsRec("dist", project = rootProject)
dependsOn(":prepare:mock-runtime-for-test:dist")
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1200m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
maxHeapSize = "1200m"
ignoreFailures = true
}
+7 -4
View File
@@ -2,13 +2,16 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":core"))
compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>)))
compile(ideaSdkDeps("jps-model.jar", subdir = "jps"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectResources("resources", sourcesBaseDir = rootDir)
configureKotlinProjectNoTests()
sourceSets {
"main" {
projectDefault()
resources.srcDir(File(rootDir, "resources")).apply { include("**") }
}
"test" {}
}