Fix tests in the new build infrastructure

This commit is contained in:
Ilya Chernikov
2017-08-24 17:11:23 +03:00
parent a61facf3d1
commit d039d191f2
48 changed files with 383 additions and 228 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ apply { plugin("kotlin") }
dependencies { dependencies {
compile(commonDep("org.apache.ant", "ant")) compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader")) compile(project(":kotlin-preloader"))
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
+2 -2
View File
@@ -13,8 +13,8 @@ dependencies {
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(protobufFull()) testCompile(protobufFull())
testRuntime(project(":kotlin-stdlib")) testRuntime(projectDist(":kotlin-stdlib"))
testRuntime(project(":kotlin-reflect")) testRuntime(projectDist(":kotlin-reflect"))
} }
sourceSets { sourceSets {
+4 -1
View File
@@ -13,7 +13,10 @@ inline fun <reified T : Task> Project.task(noinline configuration: T.() -> Unit)
fun AbstractTask.dependsOnTaskIfExists(task: String) { fun AbstractTask.dependsOnTaskIfExists(task: String) {
project.tasks.firstOrNull { it.name == task }?.let { dependsOn(it) } val thisTask = this
project.afterEvaluate {
project.tasks.firstOrNull { it.name == task }?.let { thisTask.dependsOn(it) }
}
} }
fun AbstractTask.dependsOnTaskIfExistsRec(task: String, project: Project? = null) { fun AbstractTask.dependsOnTaskIfExistsRec(task: String, project: Project? = null) {
+19 -10
View File
@@ -8,10 +8,11 @@ import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.Dependency
import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPluginConvention import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.javadoc.Javadoc import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar import org.gradle.jvm.tasks.Jar
import java.io.File
fun Project.testsJar(body: Jar.() -> Unit = {}): Jar { fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"]) val testsJarCfg = configurations.getOrCreate("tests-jar").extendsFrom(configurations["testCompile"])
@@ -93,7 +94,7 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
} }
} }
fun Project.ideaPlugin(subdir: String = "lib", body: Copy.() -> Unit) { fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit) {
task<Copy>("idea-plugin") { task<Copy>("idea-plugin") {
body() body()
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path) into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
@@ -105,19 +106,27 @@ fun Project.ideaPlugin(subdir: String = "lib") = ideaPlugin(subdir) {
fromRuntimeJarIfExists(this) fromRuntimeJarIfExists(this)
} }
fun Project.dist(targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}): AbstractCopyTask {
val distJarCfg = configurations.getOrCreate("distJar")
val distLibDir: File by rootProject.extra
val distJarName = targetName ?: (the<BasePluginConvention>().archivesBaseName + ".jar")
fun Project.dist(body: Copy.() -> Unit) { return task<Copy>("dist") {
task<Copy>("dist") {
body() body()
rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "") when {
into(rootProject.extra["distLibDir"].toString()) fromTask != null -> from(fromTask)
else -> project.fromRuntimeJarIfExists(this)
}
rename(".*", distJarName)
// rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "")
into(targetDir ?: distLibDir)
project.addArtifact(distJarCfg, this, File(targetDir ?: distLibDir, distJarName))
} }
} }
fun Project.dist() = dist {
fromRuntimeJarIfExists(this)
}
private fun<T: AbstractCopyTask> Project.fromRuntimeJarIfExists(task: T) { private fun<T: AbstractCopyTask> Project.fromRuntimeJarIfExists(task: T) {
if (extra.has("runtimeJarTask")) { if (extra.has("runtimeJarTask")) {
task.from(extra["runtimeJarTask"] as Task) task.from(extra["runtimeJarTask"] as Task)
+1
View File
@@ -51,6 +51,7 @@ fun DependencyHandler.projectDep(name: String): Dependency = project(name, confi
fun DependencyHandler.projectDepIntransitive(name: String): Dependency = fun DependencyHandler.projectDepIntransitive(name: String): Dependency =
project(name, configuration = "default").apply { isTransitive = false } project(name, configuration = "default").apply { isTransitive = false }
fun DependencyHandler.projectDist(name: String): Dependency = project(name, configuration = "distJar").apply { isTransitive = false }
fun DependencyHandler.projectTests(name: String): Dependency = project(name, configuration = "tests-jar").apply { isTransitive = false } fun DependencyHandler.projectTests(name: String): Dependency = project(name, configuration = "tests-jar").apply { isTransitive = false }
fun DependencyHandler.projectRuntimeJar(name: String): Dependency = project(name, configuration = "runtimeJar") fun DependencyHandler.projectRuntimeJar(name: String): Dependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): Dependency = project(name, configuration = "archives") fun DependencyHandler.projectArchives(name: String): Dependency = project(name, configuration = "archives")
+1 -1
View File
@@ -23,7 +23,7 @@ dependencies {
compile(project(":js:js.translator")) compile(project(":js:js.translator"))
compile(project(":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:junit"))
compile(ideaSdkCoreDeps("intellij-core")) compile(ideaSdkCoreDeps("intellij-core"))
compile(ideaSdkDeps("openapi", "idea", "idea_rt")) compile(ideaSdkDeps("openapi", "idea", "idea_rt"))
compile(preloadedDeps("dx", subdir = "android-5.0/lib")) compile(preloadedDeps("dx", subdir = "android-5.0/lib"))
+39 -34
View File
@@ -9,34 +9,55 @@ jvmTarget = "1.6"
val compilerModules: Array<String> by rootProject.extra val compilerModules: Array<String> by rootProject.extra
val otherCompilerModules = compilerModules.filter { it != path } val otherCompilerModules = compilerModules.filter { it != path }
val depDistProjects = listOf(
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm")
// TODO: it seems incomplete, find and add missing dependencies
val testDistProjects = listOf(
"", // for root project
":prepare:mock-runtime-for-test",
":kotlin-compiler",
":kotlin-runtime",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-js",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-js",
":kotlin-daemon-client",
":android-extensions-compiler",
":kotlin-ant")
dependencies { dependencies {
testCompile(commonDep("junit:junit")) depDistProjects.forEach {
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(it))
testCompile(project(":kotlin-test:kotlin-test-junit"))
testCompile(project(":compiler.tests-common"))
testCompileOnly(project(":compiler:ir.ir2cfg"))
testCompileOnly(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
testCompile(ideaSdkDeps("openapi", "idea", "util", "asm-all", "commons-httpclient-3.1-patched"))
// deps below are test runtime deps, but made test compile to split compilation and running to reduce mem req
testCompile(project(":kotlin-stdlib"))
testCompile(project(":kotlin-script-runtime"))
testCompile(project(":kotlin-runtime"))
testCompile(project(":kotlin-reflect"))
testCompile(project(":android-extensions-compiler"))
testCompile(project(":kotlin-ant"))
otherCompilerModules.forEach {
testCompile(project(it))
} }
testCompile(commonDep("junit:junit"))
testCompileOnly(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompileOnly(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(project(":compiler.tests-common"))
testCompile(project(":compiler:ir.ir2cfg"))
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
otherCompilerModules.forEach {
testCompileOnly(project(it))
}
testCompile(ideaSdkDeps("openapi", "idea", "util", "asm-all", "commons-httpclient-3.1-patched"))
testRuntime(ideaSdkCoreDeps("*.jar")) testRuntime(ideaSdkCoreDeps("*.jar"))
testRuntime(ideaSdkDeps("*.jar")) testRuntime(ideaSdkDeps("*.jar"))
// testRuntime(project(":kotlin-compiler", configuration = "default"))
} }
sourceSets { sourceSets {
"main" {} "main" {}
"test" { "test" {
projectDefault() projectDefault()
java.srcDir("tests-ir-jvm/tests") // not yet ready
// java.srcDir("tests-ir-jvm/tests")
} }
} }
@@ -52,22 +73,6 @@ jar.apply {
testsJar {} testsJar {}
// TODO: it seems incomlete, find and add missing dependencies
val testDistProjects = listOf(
":prepare:mock-runtime-for-test",
":kotlin-compiler",
":kotlin-runtime",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-js",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-js",
":kotlin-daemon-client")
projectTest { projectTest {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray()) dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir workingDir = rootDir
+1 -1
View File
@@ -6,7 +6,7 @@ apply { plugin("kotlin") }
jvmTarget = "1.6" jvmTarget = "1.6"
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
+2 -1
View File
@@ -7,8 +7,9 @@ dependencies {
compile(project(":core:util.runtime")) compile(project(":core:util.runtime"))
compile(commonDep("javax.inject")) compile(commonDep("javax.inject"))
compile(ideaSdkCoreDeps("intellij-core")) compile(ideaSdkCoreDeps("intellij-core"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testRuntime(ideaSdkCoreDeps("trove4j", "intellij-core")) testRuntime(ideaSdkCoreDeps("trove4j", "intellij-core"))
} }
+1 -1
View File
@@ -6,7 +6,7 @@ jvmTarget = "1.6"
dependencies { dependencies {
compile(project(":compiler:util")) compile(project(":compiler:util"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
compile(project(":kotlin-reflect")) compile(projectDist(":kotlin-reflect"))
compile(preloadedDeps("kotlinx-coroutines-core")) compile(preloadedDeps("kotlinx-coroutines-core"))
} }
+1 -1
View File
@@ -8,7 +8,7 @@ dependencies {
compile(project(":compiler:util")) compile(project(":compiler:util"))
compile(project(":compiler:container")) compile(project(":compiler:container"))
compile(project(":compiler:resolution")) compile(project(":compiler:resolution"))
compile(project(":kotlin-script-runtime")) compile(projectDist(":kotlin-script-runtime"))
compile(commonDep("io.javaslang","javaslang")) compile(commonDep("io.javaslang","javaslang"))
} }
@@ -10,8 +10,9 @@ dependencies {
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:cli")) compile(project(":compiler:cli"))
compile(project(":kotlin-build-common")) compile(project(":kotlin-build-common"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-stdlib")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(projectDist(":kotlin-stdlib"))
testCompile(projectTests(":kotlin-build-common")) testCompile(projectTests(":kotlin-build-common"))
} }
@@ -344,9 +344,9 @@ public class KotlinTestUtils {
@NotNull @NotNull
public static String getHomeDirectory() { public static String getHomeDirectory() {
File resourceRoot = PathUtil.getResourcePathForClass(KotlinTestUtils.class); String userDir = System.getProperty("user.dir");
// TODO: very fragile logic, consider more robust home dir detection File dir = new File(userDir == null ? "." : userDir);
return FileUtil.toSystemIndependentName(resourceRoot.getParentFile().getParentFile().getParentFile().getParent()); return FileUtil.toCanonicalPath(dir.getAbsolutePath());
} }
public static File findMockJdkRtJar() { public static File findMockJdkRtJar() {
+7 -7
View File
@@ -4,8 +4,8 @@ apply { plugin("kotlin") }
dependencies { dependencies {
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(project(":core")) testCompile(project(":core"))
testCompile(project(":compiler:util")) testCompile(project(":compiler:util"))
@@ -16,12 +16,12 @@ dependencies {
testCompile(project(":compiler:serialization")) testCompile(project(":compiler:serialization"))
testCompile(ideaSdkDeps("openapi", "idea", "util", "asm-all")) testCompile(ideaSdkDeps("openapi", "idea", "util", "asm-all"))
// 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(":kotlin-stdlib")) testCompile(projectDist(":kotlin-stdlib"))
testCompile(project(":kotlin-script-runtime")) testCompile(projectDist(":kotlin-script-runtime"))
testCompile(project(":kotlin-runtime")) testCompile(projectDist(":kotlin-runtime"))
testCompile(project(":kotlin-reflect")) testCompile(projectDist(":kotlin-reflect"))
testCompile(projectTests(":compiler")) testCompile(projectTests(":compiler"))
testRuntime(project(":kotlin-preloader")) testRuntime(projectDist(":kotlin-preloader"))
testRuntime(ideaSdkCoreDeps("*.jar")) testRuntime(ideaSdkCoreDeps("*.jar"))
testRuntime(ideaSdkDeps("*.jar")) testRuntime(ideaSdkDeps("*.jar"))
} }
@@ -206,6 +206,10 @@ class TestMessageCollector : MessageCollector {
} }
override fun hasErrors(): Boolean = messages.any { it.severity == CompilerMessageSeverity.EXCEPTION || it.severity == CompilerMessageSeverity.ERROR } override fun hasErrors(): Boolean = messages.any { it.severity == CompilerMessageSeverity.EXCEPTION || it.severity == CompilerMessageSeverity.ERROR }
override fun toString(): String {
return messages.joinToString("\n") { "${it.severity}: ${it.message}${it.location?.let{" at $it"} ?: ""}" }
}
} }
fun TestMessageCollector.assertHasMessage(msg: String, desiredSeverity: CompilerMessageSeverity? = null) { fun TestMessageCollector.assertHasMessage(msg: String, desiredSeverity: CompilerMessageSeverity? = null) {
@@ -61,8 +61,9 @@ import kotlin.script.templates.standard.ScriptTemplateWithArgs
class ScriptTemplateTest { class ScriptTemplateTest {
@Test @Test
fun testScriptWithParam() { fun testScriptWithParam() {
val aClass = compileScript("fib.kts", ScriptWithIntParam::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithIntParam::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -71,8 +72,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithClassParameter() { fun testScriptWithClassParameter() {
val aClass = compileScript("fib_cp.kts", ScriptWithClassParam::class, null, runIsolated = false) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib_cp.kts", ScriptWithClassParam::class, null, runIsolated = false, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(TestParamClass::class.java).newInstance(TestParamClass(4)) aClass!!.getConstructor(TestParamClass::class.java).newInstance(TestParamClass(4))
} }
@@ -81,8 +83,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithBaseClassWithParam() { fun testScriptWithBaseClassWithParam() {
val aClass = compileScript("fib_dsl.kts", ScriptWithBaseClass::class, null, runIsolated = false) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib_dsl.kts", ScriptWithBaseClass::class, null, runIsolated = false, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE, Integer.TYPE).newInstance(4, 1) aClass!!.getConstructor(Integer.TYPE, Integer.TYPE).newInstance(4, 1)
} }
@@ -93,8 +96,9 @@ class ScriptTemplateTest {
fun testScriptWithDependsAnn() { fun testScriptWithDependsAnn() {
Assert.assertNull(compileScript("fib_ext_ann.kts", ScriptWithIntParamAndDummyResolver::class, null, includeKotlinRuntime = false)) Assert.assertNull(compileScript("fib_ext_ann.kts", ScriptWithIntParamAndDummyResolver::class, null, includeKotlinRuntime = false))
val aClass = compileScript("fib_ext_ann.kts", ScriptWithIntParam::class, null, includeKotlinRuntime = false) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib_ext_ann.kts", ScriptWithIntParam::class, null, includeKotlinRuntime = false, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -112,8 +116,9 @@ class ScriptTemplateTest {
System.setErr(savedErr) System.setErr(savedErr)
} }
val aClass = compileScript("fib_ext_ann2.kts", ScriptWithIntParam::class, null, includeKotlinRuntime = false) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib_ext_ann2.kts", ScriptWithIntParam::class, null, includeKotlinRuntime = false, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -122,8 +127,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithoutParams() { fun testScriptWithoutParams() {
val aClass = compileScript("without_params.kts", ScriptWithoutParams::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("without_params.kts", ScriptWithoutParams::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -132,8 +138,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithOverriddenParam() { fun testScriptWithOverriddenParam() {
val aClass = compileScript("overridden_parameter.kts", ScriptBaseClassWithOverriddenProperty::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("overridden_parameter.kts", ScriptBaseClassWithOverriddenProperty::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -142,8 +149,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithArrayParam() { fun testScriptWithArrayParam() {
val aClass = compileScript("array_parameter.kts", ScriptWithArrayParam::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("array_parameter.kts", ScriptWithArrayParam::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf("one", "two")) aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf("one", "two"))
}.let { }.let {
@@ -153,8 +161,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithNullableParam() { fun testScriptWithNullableParam() {
val aClass = compileScript("nullable_parameter.kts", ScriptWithNullableParam::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("nullable_parameter.kts", ScriptWithNullableParam::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Int::class.javaObjectType).newInstance(null) aClass!!.getConstructor(Int::class.javaObjectType).newInstance(null)
}.let { }.let {
@@ -164,8 +173,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptVarianceParams() { fun testScriptVarianceParams() {
val aClass = compileScript("variance_parameters.kts", ScriptVarianceParams::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("variance_parameters.kts", ScriptVarianceParams::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Array<in Number>::class.java, Array<out Number>::class.java).newInstance(arrayOf("one"), arrayOf(1, 2)) aClass!!.getConstructor(Array<in Number>::class.java, Array<out Number>::class.java).newInstance(arrayOf("one"), arrayOf(1, 2))
}.let { }.let {
@@ -175,8 +185,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithNullableProjection() { fun testScriptWithNullableProjection() {
val aClass = compileScript("nullable_projection.kts", ScriptWithNullableProjection::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("nullable_projection.kts", ScriptWithNullableProjection::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf<String?>(null)) aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf<String?>(null))
}.let { }.let {
@@ -186,8 +197,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithArray2DParam() { fun testScriptWithArray2DParam() {
val aClass = compileScript("array2d_param.kts", ScriptWithArray2DParam::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("array2d_param.kts", ScriptWithArray2DParam::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Array<Array<in String>>::class.java).newInstance(arrayOf(arrayOf("one"), arrayOf("two"))) aClass!!.getConstructor(Array<Array<in String>>::class.java).newInstance(arrayOf(arrayOf("one"), arrayOf("two")))
}.let { }.let {
@@ -197,8 +209,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithStandardTemplate() { fun testScriptWithStandardTemplate() {
val aClass = compileScript("fib_std.kts", ScriptTemplateWithArgs::class, runIsolated = false) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib_std.kts", ScriptTemplateWithArgs::class, runIsolated = false, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf("4", "other")) aClass!!.getConstructor(Array<String>::class.java).newInstance(arrayOf("4", "other"))
}.let { }.let {
@@ -208,8 +221,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithPackage() { fun testScriptWithPackage() {
val aClass = compileScript("fib.pkg.kts", ScriptWithIntParam::class) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.pkg.kts", ScriptWithIntParam::class, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
}.let { }.let {
@@ -219,8 +233,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithScriptDefinition() { fun testScriptWithScriptDefinition() {
val aClass = compileScript("fib.kts", ScriptWithIntParam::class) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithIntParam::class, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
}.let { }.let {
@@ -230,8 +245,9 @@ class ScriptTemplateTest {
@Test @Test
fun testScriptWithParamConversion() { fun testScriptWithParamConversion() {
val aClass = compileScript("fib.kts", ScriptWithIntParam::class) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithIntParam::class, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
captureOut { captureOut {
val anObj = tryConstructClassFromStringArgs(aClass!!, listOf("4")) val anObj = tryConstructClassFromStringArgs(aClass!!, listOf("4"))
Assert.assertNotNull(anObj) Assert.assertNotNull(anObj)
@@ -253,8 +269,9 @@ class ScriptTemplateTest {
@Test @Test
fun testAsyncResolver() { fun testAsyncResolver() {
val aClass = compileScript("fib.kts", ScriptWithAsyncResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithAsyncResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
val out = captureOut { val out = captureOut {
aClass!!.getConstructor(Integer.TYPE).newInstance(4) aClass!!.getConstructor(Integer.TYPE).newInstance(4)
} }
@@ -263,32 +280,37 @@ class ScriptTemplateTest {
@Test @Test
fun testAcceptedAnnotationsSync() { fun testAcceptedAnnotationsSync() {
val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsSyncResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsSyncResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
} }
@Test @Test
fun testAcceptedAnnotationsAsync() { fun testAcceptedAnnotationsAsync() {
val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsAsyncResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsAsyncResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
} }
@Test @Test
fun testAcceptedAnnotationsLegacy() { fun testAcceptedAnnotationsLegacy() {
val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsLegacyResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("acceptedAnnotations.kts", ScriptWithAcceptedAnnotationsLegacyResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
} }
@Test @Test
fun testSeveralConstructors() { fun testSeveralConstructors() {
val aClass = compileScript("fib.kts", ScriptWithSeveralConstructorsResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithSeveralConstructorsResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
} }
@Test @Test
fun testConstructorWithDefaultArgs() { fun testConstructorWithDefaultArgs() {
val aClass = compileScript("fib.kts", ScriptWithDefaultArgsResolver::class, null) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("fib.kts", ScriptWithDefaultArgsResolver::class, null, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
} }
@Test @Test
@@ -301,8 +323,9 @@ class ScriptTemplateTest {
@Test @Test
fun testSmokeScriptException() { fun testSmokeScriptException() {
val aClass = compileScript("smoke_exception.kts", ScriptWithArrayParam::class) val messageCollector = TestMessageCollector()
Assert.assertNotNull(aClass) val aClass = compileScript("smoke_exception.kts", ScriptWithArrayParam::class, messageCollector = messageCollector)
Assert.assertNotNull("Compilation failed:\n$messageCollector", aClass)
var exceptionThrown = false var exceptionThrown = false
try { try {
tryConstructClassFromStringArgs(aClass!!, emptyList()) tryConstructClassFromStringArgs(aClass!!, emptyList())
@@ -349,7 +372,12 @@ class ScriptTemplateTest {
): Class<*>? { ): Class<*>? {
val rootDisposable = Disposer.newDisposable() val rootDisposable = Disposer.newDisposable()
try { try {
val configuration = KotlinTestUtils.newConfiguration(if (includeKotlinRuntime) ConfigurationKind.ALL else ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK) val additionalClasspath = System.getProperty("kotlin.test.script.classpath")?.split(File.pathSeparator)
?.map{ File(it) }.orEmpty().toTypedArray()
val configuration = KotlinTestUtils.newConfiguration(
if (includeKotlinRuntime) ConfigurationKind.ALL else ConfigurationKind.JDK_ONLY,
TestJdkKind.FULL_JDK,
*additionalClasspath)
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector) configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector)
configuration.addKotlinSourceRoot(scriptPath) configuration.addKotlinSourceRoot(scriptPath)
configuration.add(JVMConfigurationKeys.SCRIPT_DEFINITIONS, scriptDefinition) configuration.add(JVMConfigurationKeys.SCRIPT_DEFINITIONS, scriptDefinition)
+2
View File
@@ -1,6 +1,8 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
jvmTarget = "1.6"
dependencies { dependencies {
compile(project(":core")) compile(project(":core"))
compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>))) compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array<String>)))
+1 -1
View File
@@ -8,7 +8,7 @@ jvmTarget = "1.6"
dependencies { dependencies {
compile(project(":core:builtins")) compile(project(":core:builtins"))
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
+4 -3
View File
@@ -2,13 +2,14 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":kotlin-reflect")) compile(projectDist(":kotlin-reflect"))
compile(project(":compiler:backend")) compile(project(":compiler:backend"))
compile(ideaSdkDeps("asm-all")) compile(ideaSdkDeps("asm-all"))
// compile(files(PathUtil.getJdkClassesRootsFromCurrentJre())) // TODO: make this one work instead of the nex one, since it contains more universal logic // compile(files(PathUtil.getJdkClassesRootsFromCurrentJre())) // TODO: make this one work instead of the nex one, since it contains more universal logic
compile(files("${System.getProperty("java.home")}/../lib/tools.jar")) compile(files("${System.getProperty("java.home")}/../lib/tools.jar"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(commonDep("junit:junit"))
} }
sourceSets { sourceSets {
+1 -1
View File
@@ -14,7 +14,7 @@ dependencies {
compile(project(":js:js.ast")) compile(project(":js:js.ast"))
compile(project(":js:js.frontend")) compile(project(":js:js.frontend"))
compile(project(":idea:idea-test-framework")) compile(project(":idea:idea-test-framework"))
compile(project(":kotlin-test:kotlin-test-jvm")) compile(projectDist(":kotlin-test:kotlin-test-jvm"))
compile(projectTests(":kotlin-build-common")) compile(projectTests(":kotlin-build-common"))
compile(projectTests(":compiler")) compile(projectTests(":compiler"))
compile(projectTests(":compiler:tests-java8")) compile(projectTests(":compiler:tests-java8"))
+98
View File
@@ -26,6 +26,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -397,6 +398,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -436,6 +438,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -508,6 +511,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -580,6 +584,7 @@
"archives", "archives",
"compilerJar", "compilerJar",
"default", "default",
"distJar",
"fatJar", "fatJar",
"fatJarContents", "fatJarContents",
"fatSourcesJarContents", "fatSourcesJarContents",
@@ -664,6 +669,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -708,6 +714,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptAgp25", "kaptAgp25",
@@ -749,6 +756,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -876,6 +884,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -915,6 +924,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -952,6 +962,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -989,6 +1000,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1032,6 +1044,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1069,6 +1082,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1107,6 +1121,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1146,6 +1161,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1183,6 +1199,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1261,6 +1278,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1312,6 +1330,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptAnnotations", "kaptAnnotations",
@@ -1353,6 +1372,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"runtime", "runtime",
"runtimeClasspath", "runtimeClasspath",
@@ -1388,6 +1408,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1426,6 +1447,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -1471,6 +1493,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"merger", "merger",
"nodeDist", "nodeDist",
@@ -1751,6 +1774,41 @@
"reporting": "org.gradle.api.reporting.ReportingExtension" "reporting": "org.gradle.api.reporting.ReportingExtension"
} }
}, },
":compiler:conditional-preprocessor": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
},
"configurations": [
"apiElements",
"archives",
"compile",
"compileClasspath",
"compileOnly",
"default",
"implementation",
"kapt",
"kaptTest",
"runtime",
"runtimeClasspath",
"runtimeElements",
"runtimeOnly",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
"testImplementation",
"testRuntime",
"testRuntimeClasspath",
"testRuntimeOnly"
],
"extensions": {
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
}
},
":compiler:container": { ":compiler:container": {
"conventions": { "conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention", "base": "org.gradle.api.plugins.BasePluginConvention",
@@ -1787,6 +1845,41 @@
"reporting": "org.gradle.api.reporting.ReportingExtension" "reporting": "org.gradle.api.reporting.ReportingExtension"
} }
}, },
":compiler:daemon": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
},
"configurations": [
"apiElements",
"archives",
"compile",
"compileClasspath",
"compileOnly",
"default",
"implementation",
"kapt",
"kaptTest",
"runtime",
"runtimeClasspath",
"runtimeElements",
"runtimeOnly",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
"testImplementation",
"testRuntime",
"testRuntimeClasspath",
"testRuntimeOnly"
],
"extensions": {
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
}
},
":compiler:daemon-common": { ":compiler:daemon-common": {
"conventions": { "conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention", "base": "org.gradle.api.plugins.BasePluginConvention",
@@ -3083,6 +3176,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"runtime", "runtime",
"runtimeClasspath", "runtimeClasspath",
@@ -3118,6 +3212,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implement", "implement",
"implementation", "implementation",
"runtime", "runtime",
@@ -3154,6 +3249,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
@@ -3192,6 +3288,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implement", "implement",
"implementation", "implementation",
"kapt", "kapt",
@@ -3720,6 +3817,7 @@
"compileClasspath", "compileClasspath",
"compileOnly", "compileOnly",
"default", "default",
"distJar",
"implementation", "implementation",
"kapt", "kapt",
"kaptTest", "kaptTest",
+4 -3
View File
@@ -2,11 +2,11 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
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(":kotlin-daemon-client")) compile(projectDist(":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"))
@@ -45,10 +45,11 @@ dependencies {
compile(preloadedDeps("markdown", "kotlinx-coroutines-core")) compile(preloadedDeps("markdown", "kotlinx-coroutines-core"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(project(":compiler:cli")) testCompile(project(":compiler:cli"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(project(":idea:idea-test-framework")) { isTransitive = false } testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(commonDep("junit:junit"))
testCompileOnly(ideaPluginDeps("gradle-base-services", "gradle-tooling-extension-impl", "gradle-wrapper", plugin = "gradle")) testCompileOnly(ideaPluginDeps("gradle-base-services", "gradle-tooling-extension-impl", "gradle-wrapper", plugin = "gradle"))
testCompileOnly(ideaPluginDeps("Groovy", plugin = "Groovy")) testCompileOnly(ideaPluginDeps("Groovy", plugin = "Groovy"))
+3 -2
View File
@@ -2,7 +2,7 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-reflect")) compile(projectDist(":kotlin-reflect"))
compile(project(":compiler:util")) compile(project(":compiler:util"))
compile(project(":compiler:light-classes")) compile(project(":compiler:light-classes"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
@@ -15,13 +15,14 @@ dependencies {
compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "layoutlib-api", plugin = "android")) compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "layoutlib-api", plugin = "android"))
compile(preloadedDeps("dx", subdir = "android-5.0/lib")) compile(preloadedDeps("dx", subdir = "android-5.0/lib"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(project(":idea:idea-test-framework")) { isTransitive = false } testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(project(":plugins:lint")) { isTransitive = false } testCompile(project(":plugins:lint")) { isTransitive = false }
testCompile(projectTests(":idea")) testCompile(projectTests(":idea"))
testCompile(ideaPluginDeps("properties", plugin = "properties")) testCompile(ideaPluginDeps("properties", plugin = "properties"))
testCompile(ideaSdkDeps("gson")) testCompile(ideaSdkDeps("gson"))
testCompile(commonDep("junit:junit"))
testRuntime(project(":plugins:android-extensions-idea")) testRuntime(project(":plugins:android-extensions-idea"))
testRuntime(project(":plugins:sam-with-receiver-ide")) testRuntime(project(":plugins:sam-with-receiver-ide"))
+1 -1
View File
@@ -1,7 +1,7 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":core")) compile(project(":core"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
+1 -1
View File
@@ -2,7 +2,7 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":compiler:util")) compile(project(":compiler:util"))
compile(project(":compiler:cli-common")) compile(project(":compiler:cli-common"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
+1 -1
View File
@@ -4,7 +4,7 @@ description = "Kotlin Gradle Tooling support"
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":compiler:cli-common")) compile(project(":compiler:cli-common"))
compile(ideaSdkDeps("gradle-tooling-api", compile(ideaSdkDeps("gradle-tooling-api",
"gradle-tooling-extension-api", "gradle-tooling-extension-api",
+23 -23
View File
@@ -6,7 +6,7 @@ apply { plugin("kotlin") }
//} //}
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:light-classes")) compile(project(":compiler:light-classes"))
@@ -15,30 +15,30 @@ dependencies {
testCompile(project(":idea")) testCompile(project(":idea"))
testCompile(project(":idea:idea-test-framework")) testCompile(project(":idea:idea-test-framework"))
testCompile(project(":compiler:light-classes")) testCompile(project(":compiler:light-classes"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(commonDep("junit:junit"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
// testRuntime(project(":idea:idea-android")) testRuntime(project(":idea:idea-android"))
// testRuntime(project(":plugins:android-extensions-idea")) testRuntime(project(":plugins:android-extensions-idea"))
// testRuntime(project(":plugins:sam-with-receiver-ide")) testRuntime(project(":plugins:sam-with-receiver-ide"))
// testRuntime(project(":plugins:allopen-ide")) testRuntime(project(":plugins:allopen-ide"))
// testRuntime(project(":plugins:noarg-ide")) testRuntime(project(":plugins:noarg-ide"))
testRuntime(ideaSdkDeps("*.jar")) testRuntime(ideaSdkDeps("*.jar"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "junit")) testRuntime(ideaPluginDeps("*.jar", plugin = "properties"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "testng")) testRuntime(ideaPluginDeps("*.jar", plugin = "gradle"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "properties")) testRuntime(ideaPluginDeps("*.jar", plugin = "Groovy"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "gradle")) testRuntime(ideaPluginDeps("*.jar", plugin = "coverage"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "Groovy")) testRuntime(ideaPluginDeps("*.jar", plugin = "maven"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "coverage")) testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "maven")) testRuntime(ideaPluginDeps("*.jar", plugin = "junit"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "android")) testRuntime(ideaPluginDeps("*.jar", plugin = "testng"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "junit")) testRuntime(ideaPluginDeps("*.jar", plugin = "IntelliLang"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "IntelliLang")) testRuntime(ideaPluginDeps("*.jar", plugin = "testng"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "testng")) testRuntime(ideaPluginDeps("*.jar", plugin = "copyright"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "copyright")) testRuntime(ideaPluginDeps("*.jar", plugin = "properties"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "properties")) testRuntime(ideaPluginDeps("*.jar", plugin = "java-i18n"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "java-i18n")) testRuntime(ideaPluginDeps("*.jar", plugin = "coverage"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "coverage")) testRuntime(ideaPluginDeps("*.jar", plugin = "java-decompiler"))
// testRuntime(ideaPluginDeps("*.jar", plugin = "java-decompiler"))
} }
sourceSets { sourceSets {
+3 -3
View File
@@ -7,9 +7,9 @@ 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(":kotlin-daemon-client")) compile(projectDist(":kotlin-daemon-client"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":kotlin-preloader")) compile(projectDist(":kotlin-preloader"))
compile(project(":idea:idea-jps-common")) compile(project(":idea:idea-jps-common"))
compile(ideaSdkDeps("jps-builders", "jps-builders-6", subdir = "jps")) compile(ideaSdkDeps("jps-builders", "jps-builders-6", subdir = "jps"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
@@ -17,7 +17,7 @@ dependencies {
testCompile(projectTests(":compiler:incremental-compilation-impl")) testCompile(projectTests(":compiler:incremental-compilation-impl"))
testCompileOnly(ideaSdkDeps("jps-build-test", subdir = "jps/test")) testCompileOnly(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(projectTests(":kotlin-build-common")) testCompile(projectTests(":kotlin-build-common"))
compilerModules.forEach { compilerModules.forEach {
testRuntime(project(it)) testRuntime(project(it))
+17 -8
View File
@@ -10,9 +10,10 @@ dependencies {
testCompile(project(":js:js.serializer")) testCompile(project(":js:js.serializer"))
testCompile(project(":js:js.dce")) testCompile(project(":js:js.dce"))
testCompile(ideaSdkDeps("openapi", "idea")) testCompile(ideaSdkDeps("openapi", "idea"))
testRuntime(project(":kotlin-stdlib")) testRuntime(projectDist(":kotlin-stdlib"))
testRuntime(project(":compiler:backend-common")) testRuntime(project(":compiler:backend-common"))
testRuntime(ideaSdkDeps("*.jar")) testRuntime(ideaSdkDeps("*.jar"))
testRuntime(commonDep("org.fusesource.jansi", "jansi"))
} }
sourceSets { sourceSets {
@@ -20,14 +21,22 @@ sourceSets {
"test" { projectDefault() } "test" { projectDefault() }
} }
val test: Test by tasks val testDistProjects = listOf(
test.apply { "", // for root project
dependsOnTaskIfExistsRec("dist", project = rootProject) ":prepare:mock-runtime-for-test",
dependsOn(":prepare:mock-runtime-for-test:dist") ":kotlin-compiler",
":kotlin-runtime",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-js",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-daemon-client",
":kotlin-ant")
projectTest {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
} }
testsJar {} testsJar {}
+9
View File
@@ -131,9 +131,18 @@ ext.configurePublishing = { Project project ->
} }
} }
configurations {
distJar
}
task dist(type: Copy, dependsOn: assemble) { task dist(type: Copy, dependsOn: assemble) {
rename "-${java.util.regex.Pattern.quote(version)}", '' rename "-${java.util.regex.Pattern.quote(version)}", ''
into distLibDir into distLibDir
afterEvaluate {
project.artifacts {
distJar file: file("$distLibDir${File.separator}${archivesBaseName}.jar"), builtBy: "dist"
}
}
} }
uploadArchives { uploadArchives {
@@ -3,7 +3,7 @@ description = "Simple Annotation Processor for testing kapt"
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
@@ -14,7 +14,7 @@ dependencies {
compile project(':kotlin-test::kotlin-test-junit') compile project(':kotlin-test::kotlin-test-junit')
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compileOnly project(path: ":kotlin-stdlib", configuration: "distJar")
compileOnly project(':compiler') compileOnly project(':compiler')
compileOnly project(':compiler:plugin-api') compileOnly project(':compiler:plugin-api')
compileOnly project(':compiler:cli-common') compileOnly project(':compiler:cli-common')
@@ -4,13 +4,14 @@ description = "Sample Kotlin JSR 223 scripting jar with daemon (out-of-process)
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":kotlin-script-runtime")) compile(projectDist(":kotlin-script-runtime"))
compile(projectRuntimeJar(":kotlin-compiler")) compile(projectRuntimeJar(":kotlin-compiler"))
compile(project(":kotlin-script-util")) compile(project(":kotlin-script-util"))
compile(projectRuntimeJar(":kotlin-daemon-client")) compile(projectRuntimeJar(":kotlin-daemon-client"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(commonDep("junit:junit"))
testRuntime(project(":kotlin-reflect")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testRuntime(projectDist(":kotlin-reflect"))
} }
projectTest() projectTest()
@@ -4,12 +4,13 @@ description = "Sample Kotlin JSR 223 scripting jar with local (in-process) compi
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":kotlin-script-runtime")) compile(projectDist(":kotlin-script-runtime"))
compile(projectRuntimeJar(":kotlin-compiler")) compile(projectRuntimeJar(":kotlin-compiler"))
compile(project(":kotlin-script-util")) compile(project(":kotlin-script-util"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testRuntime(project(":kotlin-reflect")) testCompile(commonDep("junit:junit"))
testRuntime(projectDist(":kotlin-reflect"))
} }
projectTest() projectTest()
@@ -5,7 +5,7 @@ dependencies {
compile(project(":plugins:kapt3")) compile(project(":plugins:kapt3"))
compileOnly("org.jetbrains.kotlin:gradle-api:1.6") compileOnly("org.jetbrains.kotlin:gradle-api:1.6")
compileOnly("com.android.tools.build:gradle:1.1.0") compileOnly("com.android.tools.build:gradle:1.1.0")
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
} }
@@ -4,15 +4,16 @@ description = "Kotlin scripting support utilities"
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":kotlin-script-runtime")) compile(projectDist(":kotlin-script-runtime"))
compile(projectRuntimeJar(":kotlin-compiler")) compile(projectRuntimeJar(":kotlin-compiler"))
compile(projectRuntimeJar(":kotlin-daemon-client")) compile(projectRuntimeJar(":kotlin-daemon-client"))
compileOnly("com.jcabi:jcabi-aether:0.10.1") compileOnly("com.jcabi:jcabi-aether:0.10.1")
compileOnly("org.sonatype.aether:aether-api:1.13.1") compileOnly("org.sonatype.aether:aether-api:1.13.1")
compileOnly("org.apache.maven:maven-core:3.0.3") compileOnly("org.apache.maven:maven-core:3.0.3")
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testRuntime(project(":kotlin-reflect")) testRuntime(projectDist(":kotlin-reflect"))
testCompile(commonDep("junit:junit"))
testRuntime("com.jcabi:jcabi-aether:0.10.1") testRuntime("com.jcabi:jcabi-aether:0.10.1")
testRuntime("org.sonatype.aether:aether-api:1.13.1") testRuntime("org.sonatype.aether:aether-api:1.13.1")
testRuntime("org.apache.maven:maven-core:3.0.3") testRuntime("org.apache.maven:maven-core:3.0.3")
+3 -6
View File
@@ -7,8 +7,8 @@ dependencies {
compileOnly(ideaSdkCoreDeps("intellij-core")) compileOnly(ideaSdkCoreDeps("intellij-core"))
compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:plugin-api"))
compileOnly(project(":compiler:frontend")) compileOnly(project(":compiler:frontend"))
runtime(project(":kotlin-compiler", configuration = "runtimeJar")) runtime(projectDist(":kotlin-compiler"))
runtime(project(":kotlin-stdlib")) runtime(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
@@ -20,10 +20,7 @@ val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") } from(fileTree("$projectDir/src")) { include("META-INF/**") }
} }
dist { dist(targetName = the<BasePluginConvention>().archivesBaseName.removePrefix("kotlin-") + ".jar")
from(jar)
rename("^kotlin-", "")
}
ideaPlugin { ideaPlugin {
from(jar) from(jar)
@@ -17,7 +17,8 @@ dependencies {
testCompile(project(":idea:idea-test-framework")) { isTransitive = false } testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(projectTests(":idea")) testCompile(projectTests(":idea"))
testCompile(projectTests(":idea:idea-android")) testCompile(projectTests(":idea:idea-android"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(commonDep("junit:junit"))
testRuntime(project(":plugins:android-extensions-jps")) testRuntime(project(":plugins:android-extensions-jps"))
testRuntime(project(":plugins:sam-with-receiver-ide")) testRuntime(project(":plugins:sam-with-receiver-ide"))
testRuntime(project(":plugins:noarg-ide")) testRuntime(project(":plugins:noarg-ide"))
+3 -6
View File
@@ -9,8 +9,8 @@ dependencies {
compileOnly(project(":compiler:backend")) compileOnly(project(":compiler:backend"))
compileOnly(project(":compiler:util")) compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:plugin-api"))
runtime(project(":kotlin-compiler", configuration = "runtimeJar")) runtime(projectDist(":kotlin-compiler"))
runtime(project(":kotlin-stdlib")) runtime(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
@@ -22,10 +22,7 @@ val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") } from(fileTree("$projectDir/src")) { include("META-INF/**") }
} }
dist { dist(targetName = the<BasePluginConvention>().archivesBaseName.removePrefix("kotlin-") + ".jar")
from(jar)
rename("^kotlin-", "")
}
ideaPlugin { ideaPlugin {
from(jar) from(jar)
+3 -6
View File
@@ -18,8 +18,9 @@ dependencies {
testCompile(project(":idea:idea-android")) { isTransitive = false } testCompile(project(":idea:idea-android")) { isTransitive = false }
testCompile(project(":plugins:lint")) { isTransitive = false } testCompile(project(":plugins:lint")) { isTransitive = false }
testCompile(project(":plugins:uast-kotlin")) testCompile(project(":plugins:uast-kotlin"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(projectTests(":jps-plugin")) testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
testCompileOnly(ideaSdkDeps("jps-builders")) testCompileOnly(ideaSdkDeps("jps-builders"))
testCompile(ideaSdkDeps("jps-build-test", subdir = "jps/test")) testCompile(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
testCompile(ideaPluginDeps("*.jar", plugin = "android", subdir = "lib/jps")) testCompile(ideaPluginDeps("*.jar", plugin = "android", subdir = "lib/jps"))
@@ -37,12 +38,8 @@ sourceSets {
testsJar {} testsJar {}
val test: Test by tasks projectTest {
test.apply {
dependsOnTaskIfExistsRec("dist", project = rootProject) dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
} }
@@ -7,8 +7,8 @@ dependencies {
compileOnly(project(":compiler:frontend")) compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:frontend.java")) compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:plugin-api"))
runtime(project(":kotlin-compiler", configuration = "runtimeJar")) runtime(projectDist(":kotlin-compiler"))
runtime(project(":kotlin-stdlib")) runtime(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
@@ -24,10 +24,7 @@ javadocJar()
publish() publish()
dist { dist(targetName = the<BasePluginConvention>().archivesBaseName.removePrefix("kotlin-") + ".jar")
from(jar)
rename("^kotlin-", "")
}
ideaPlugin { ideaPlugin {
from(jar) from(jar)
+1 -1
View File
@@ -2,7 +2,7 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":core:util.runtime")) compile(project(":core:util.runtime"))
compile(project(":compiler:backend")) compile(project(":compiler:backend"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
+2 -2
View File
@@ -2,14 +2,14 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
compile(project(":core:util.runtime")) compile(project(":core:util.runtime"))
compile(project(":compiler:backend")) compile(project(":compiler:backend"))
compile(project(":compiler:frontend")) compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java")) compile(project(":compiler:frontend.java"))
compile(project(":compiler:light-classes")) compile(project(":compiler:light-classes"))
compileOnly(ideaSdkDeps("openapi", "idea")) compileOnly(ideaSdkDeps("openapi", "idea"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":compiler.tests-common")) testCompile(project(":compiler.tests-common"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":compiler:util")) testCompile(project(":compiler:util"))
@@ -35,11 +35,11 @@ dependencies {
testCompile(project(it)) testCompile(project(it))
} }
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":kotlin-test:kotlin-test-junit")) testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
testRuntimeCompilerJar(project(":kotlin-compiler", configuration = "runtimeJar")) testRuntimeCompilerJar(projectDist(":kotlin-compiler"))
testStdlibJar(project(":kotlin-stdlib", configuration = "mainJar")) testStdlibJar(projectDist(":kotlin-stdlib"))
testScriptRuntimeJar(project(":kotlin-script-runtime", configuration = "mainJar")) testScriptRuntimeJar(projectDist(":kotlin-script-runtime"))
} }
sourceSets { sourceSets {
+1 -1
View File
@@ -30,7 +30,7 @@ val packagesToRelocate =
"org.fusesource") "org.fusesource")
dependencies { dependencies {
compilerJar(project(":kotlin-compiler", configuration = "runtimeJar")) compilerJar(projectDist(":kotlin-compiler"))
} }
runtimeJar(task<ShadowJar>("embeddable")) { runtimeJar(task<ShadowJar>("embeddable")) {
+6 -12
View File
@@ -88,9 +88,9 @@ dependencies {
proguardLibraryJars(files(firstFromJavaHomeThatExists("lib/rt.jar", "../Classes/classes.jar"), proguardLibraryJars(files(firstFromJavaHomeThatExists("lib/rt.jar", "../Classes/classes.jar"),
firstFromJavaHomeThatExists("lib/jsse.jar", "../Classes/jsse.jar"), firstFromJavaHomeThatExists("lib/jsse.jar", "../Classes/jsse.jar"),
firstFromJavaHomeThatExists("../lib/tools.jar", "../Classes/tools.jar"))) firstFromJavaHomeThatExists("../lib/tools.jar", "../Classes/tools.jar")))
proguardLibraryJars(project(":kotlin-stdlib", configuration = "mainJar")) proguardLibraryJars(projectDist(":kotlin-stdlib"))
proguardLibraryJars(project(":kotlin-script-runtime", configuration = "mainJar")) proguardLibraryJars(projectDist(":kotlin-script-runtime"))
proguardLibraryJars(project(":kotlin-reflect", configuration = "mainJar")) proguardLibraryJars(projectDist(":kotlin-reflect"))
proguardLibraryJars(preloadedDeps("kotlinx-coroutines-core")) proguardLibraryJars(preloadedDeps("kotlinx-coroutines-core"))
} }
@@ -98,7 +98,6 @@ val packCompiler by task<ShadowJar> {
configurations = listOf(fatJar) configurations = listOf(fatJar)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDir = File(buildDir, "libs") destinationDir = File(buildDir, "libs")
// baseName = compilerBaseName
dependsOn(protobufFullTask) dependsOn(protobufFullTask)
setupPublicJar("before-proguard", "") setupPublicJar("before-proguard", "")
@@ -130,14 +129,9 @@ val proguard by task<ProGuardTask> {
printconfiguration("$buildDir/compiler.pro.dump") printconfiguration("$buildDir/compiler.pro.dump")
} }
dist { dist(targetName = compilerBaseName + ".jar",
if (shrink) { fromTask = if (shrink) proguard
from(proguard) else packCompiler)
} else {
from(packCompiler)
}
rename(".*", compilerBaseName + ".jar")
}
runtimeJarArtifactBy(proguard, proguard.outputs.files.singleFile) { runtimeJarArtifactBy(proguard, proguard.outputs.files.singleFile) {
name = compilerBaseName name = compilerBaseName
+1 -1
View File
@@ -56,7 +56,7 @@ val sideJars by configurations.creating
dependencies { dependencies {
packedJars(commonDep("com.github.spullara.cli-parser", "cli-parser")) packedJars(commonDep("com.github.spullara.cli-parser", "cli-parser"))
packedJars(preloadedDeps("protobuf-${rootProject.extra["versions.protobuf-java"]}")) packedJars(preloadedDeps("protobuf-${rootProject.extra["versions.protobuf-java"]}"))
sideJars(project(":kotlin-script-runtime")) sideJars(projectDist(":kotlin-script-runtime"))
sideJars(commonDep("io.javaslang", "javaslang")) sideJars(commonDep("io.javaslang", "javaslang"))
sideJars(commonDep("javax.inject")) sideJars(commonDep("javax.inject"))
sideJars(preloadedDeps("markdown", "kotlinx-coroutines-core", "kotlinx-coroutines-jdk8")) sideJars(preloadedDeps("markdown", "kotlinx-coroutines-core", "kotlinx-coroutines-jdk8"))
@@ -7,7 +7,7 @@ jvmTarget = "1.6"
javaHome = rootProject.extra["JDK_16"] as String javaHome = rootProject.extra["JDK_16"] as String
dependencies { dependencies {
compile(project(":kotlin-stdlib")) compile(projectDist(":kotlin-stdlib"))
} }
sourceSets { sourceSets {
@@ -34,12 +34,8 @@ tasks.withType<JavaCompile> {
val jar = runtimeJar { val jar = runtimeJar {
from(fileTree("${rootProject.extra["distDir"]}/builtins")) { include("kotlin/**") } from(fileTree("${rootProject.extra["distDir"]}/builtins")) { include("kotlin/**") }
archiveName = "kotlin-mock-runtime-for-test.jar"
} }
task<Copy>("dist") { val distDir: String by rootProject.extra
from(jar)
into(rootProject.extra["distDir"].toString())
rename("-${Regex.escape(rootProject.extra["build.number"].toString())}", "")
}
dist(targetName = "kotlin-mock-runtime-for-test.jar", targetDir = File(distDir))