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
+16 -36
View File
@@ -2,14 +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
testRuntime(ideaSdkDeps("*.jar"))
compile(project(":kotlin-stdlib"))
compile(project(":core"))
compile(project(":compiler:backend"))
@@ -64,6 +56,8 @@ dependencies {
testCompileOnly(ideaSdkDeps("groovy-all", "velocity", "gson", "jsr305"))
testRuntime(ideaSdkDeps("*.jar"))
testRuntime(ideaPluginDeps("resources_en", plugin = "junit"))
testRuntime(ideaPluginDeps("jcommander", "resources_en", plugin = "testng"))
testRuntime(ideaPluginDeps("resources_en", plugin = "properties"))
@@ -90,41 +84,27 @@ dependencies {
(rootProject.extra["compilerModules"] as Array<String>).forEach {
testCompile(project(it))
}
buildVersion()
}
configureKotlinProjectSources("src",
"idea-maven/src",
"idea-gradle/src",
"idea-completion/src",
"idea-live-templates/src",
"idea-repl/src")
configure<JavaPluginConvention> {
sourceSets["main"].apply {
resources {
srcDir(File(projectDir, "resources"))
.include("**")
srcDir(File(projectDir, "src"))
.include("META-INF/**",
"**/*.properties")
}
sourceSets {
"main" {
projectDefault()
java.srcDirs("idea-maven/src",
"idea-gradle/src",
"idea-completion/src",
"idea-live-templates/src",
"idea-repl/src")
}
"test" {
java.srcDirs("tests",
"idea-maven/test",
"idea-completion/tests")
}
}
configureKotlinProjectTests("tests",
"idea-maven/test",
"idea-completion/tests")
tasks.withType<Test> {
projectTest {
dependsOnTaskIfExistsRec("dist", project = rootProject)
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1200m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
maxHeapSize = "1200m"
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
testsJar {}