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