Continue switching projects to improved dsl: sourceSets and test running
This commit is contained in:
@@ -21,8 +21,10 @@ tasks.withType<Jar> {
|
||||
}
|
||||
}
|
||||
|
||||
configureKotlinProjectSources() // no sources
|
||||
configureKotlinProjectNoTests()
|
||||
sourceSets {
|
||||
"main" {}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
val jar: Jar by tasks
|
||||
|
||||
|
||||
@@ -43,19 +43,18 @@ dependencies {
|
||||
testScriptRuntimeJar(project(":kotlin-script-runtime", configuration = "mainJar"))
|
||||
}
|
||||
|
||||
configureKotlinProjectSources() // no sources
|
||||
configureKotlinProjectTests("libraries/tools/kotlin-compiler-client-embeddable-test/src", sourcesBaseDir = rootDir)
|
||||
sourceSets {
|
||||
"main" {}
|
||||
"test" {
|
||||
// TODO: move closer
|
||||
java.srcDir("../../libraries/tools/kotlin-compiler-client-embeddable-test/src")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
projectTest {
|
||||
dependsOnTaskIfExistsRec("dist", project = rootProject)
|
||||
workingDir = File(rootDir, "libraries/tools/kotlin-compiler-client-embeddable-test/src")
|
||||
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
|
||||
systemProperty("idea.is.unit.test", "true")
|
||||
systemProperty("compilerJar", testRuntimeCompilerJar.singleFile.canonicalPath)
|
||||
systemProperty("stdlibJar", testStdlibJar.singleFile.canonicalPath)
|
||||
systemProperty("scriptRuntimeJar", testScriptRuntimeJar.singleFile.canonicalPath)
|
||||
@@ -76,73 +75,3 @@ sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
publish()
|
||||
|
||||
// TODO: remove after finalizing publishing (now due to the problems with sam-with-receiver, the code is not fully navigable in the buildSrc)
|
||||
//tasks {
|
||||
// "uploadArchives"(Upload::class) {
|
||||
//
|
||||
// val preparePublication by rootProject.tasks
|
||||
// dependsOn(preparePublication)
|
||||
//
|
||||
// val username: String? by preparePublication.extra
|
||||
// val password: String? by preparePublication.extra
|
||||
//
|
||||
// repositories {
|
||||
// withConvention(MavenRepositoryHandlerConvention::class) {
|
||||
//
|
||||
// mavenDeployer {
|
||||
// withGroovyBuilder {
|
||||
// "repository"("url" to uri(preparePublication.extra["repoUrl"]))
|
||||
//
|
||||
// if (username != null && password != null) {
|
||||
// "authentication"("userName" to username, "password" to password)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// pom.project {
|
||||
// withGroovyBuilder {
|
||||
// "licenses" {
|
||||
// "license" {
|
||||
// "name"("The Apache Software License, Version 2.0")
|
||||
// "url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
// "distribution"("repo")
|
||||
// }
|
||||
// }
|
||||
// "name"("${project.group}:${project.name}")
|
||||
// "packaging"("jar")
|
||||
// // optionally artifactId can be defined here
|
||||
// "description"(project.description)
|
||||
// "url"("https://kotlinlang.org/")
|
||||
// "licenses" {
|
||||
// "license" {
|
||||
// "name"("The Apache License, Version 2.0")
|
||||
// "url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
// }
|
||||
// }
|
||||
// "scm" {
|
||||
// "url"("https://github.com/JetBrains/kotlin")
|
||||
// "connection"("scm:git:https://github.com/JetBrains/kotlin.git")
|
||||
// "developerConnection"("scm:git:https://github.com/JetBrains/kotlin.git")
|
||||
// }
|
||||
// "developers" {
|
||||
// "developer" {
|
||||
// "name"("Kotlin Team")
|
||||
// "organization"("JetBrains")
|
||||
// "organizationUrl"("https://www.jetbrains.com")
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pom.whenConfigured {
|
||||
// dependencies.clear()
|
||||
//// dependencies.removeIf {
|
||||
//// withGroovyBuilder {
|
||||
//// "scope"(*emptyArray()) == "test"
|
||||
//// }
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -15,6 +15,8 @@ tasks.withType<Jar> {
|
||||
from(fileTree("$rootDir/idea/formatter")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
||||
}
|
||||
|
||||
configureKotlinProjectSources() // no sources
|
||||
configureKotlinProjectNoTests()
|
||||
sourceSets {
|
||||
"main" {}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ tasks.withType<Jar> {
|
||||
from(fileTree("$rootDir/idea/ide-common")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
||||
}
|
||||
|
||||
configureKotlinProjectSources() // no sources
|
||||
configureKotlinProjectNoTests()
|
||||
sourceSets {
|
||||
"main" {}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,22 +18,22 @@ jar.apply {
|
||||
archiveName = "kotlin-mock-runtime-for-test.jar"
|
||||
}
|
||||
|
||||
configure<JavaPluginConvention> {
|
||||
sourceSets["main"].apply {
|
||||
(this as HasConvention).convention.getPlugin<KotlinSourceSet>().kotlin.apply {
|
||||
srcDir(File(rootDir, "core", "runtime.jvm", "src"))
|
||||
.include("kotlin/TypeAliases.kt",
|
||||
"kotlin/text/TypeAliases.kt")
|
||||
srcDir(File(rootDir, "libraries", "stdlib", "src"))
|
||||
.include("kotlin/collections/TypeAliases.kt",
|
||||
"kotlin/jvm/JvmVersion.kt",
|
||||
"kotlin/util/Standard.kt",
|
||||
"kotlin/internal/Annotations.kt")
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
"main" {
|
||||
java.apply {
|
||||
srcDir(File(rootDir, "core", "runtime.jvm", "src"))
|
||||
.include("kotlin/TypeAliases.kt",
|
||||
"kotlin/text/TypeAliases.kt")
|
||||
srcDir(File(rootDir, "libraries", "stdlib", "src"))
|
||||
.include("kotlin/collections/TypeAliases.kt",
|
||||
"kotlin/jvm/JvmVersion.kt",
|
||||
"kotlin/util/Standard.kt",
|
||||
"kotlin/internal/Annotations.kt")
|
||||
}
|
||||
}
|
||||
"test" {}
|
||||
}
|
||||
|
||||
configureKotlinProjectNoTests()
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
sourceCompatibility = "1.6"
|
||||
|
||||
Reference in New Issue
Block a user