From 6ed068862a068077ac40fed8b203e8471a71b1a7 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 6 Jun 2019 12:35:16 +0300 Subject: [PATCH] [tests] use tests for compiler and stdlib from composite build --- backend.native/tests/build.gradle | 39 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 4dffd6acd58..5ea947d24bf 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -50,16 +50,26 @@ repositories { dependencies { cli_bc project(path: ':backend.native', configuration: 'cli_bc') - update_tests (group: 'org', name: 'Kotlin_dev_Compiler', version: testKotlinCompilerVersion) { - artifact { - name = 'internal/kotlin-test-data' - type = 'zip' + if (project.hasProperty("kotlinProjectPath")) { + /** + * TODO: It's desired to get archives from composite build automatically, but still user have to execute :kotlin:zipTestData, + * unfortuantly `buildBy` on ConfigurableFileCollection doesn't work as desired and added dependsOn `:kotlin:zipTestData` in tasks + * using `update_external_tests` fails on evaluation phase. + */ + update_tests files(Paths.get(project.property("kotlinProjectPath").toString(), "dist", "kotlin-test-data.zip").toFile()) + update_stdlib_tests files(Paths.get(project.property("kotlinProjectPath").toString(), "dist", "kotlin-stdlib-tests.zip").toFile()) + } else { + update_tests(group: 'org', name: 'Kotlin_dev_Compiler', version: testKotlinCompilerVersion) { + artifact { + name = 'internal/kotlin-test-data' + type = 'zip' + } } - } - update_stdlib_tests (group: 'org', name: 'Kotlin_dev_Compiler', version: kotlinStdlibVersion) { - artifact { - name = 'internal/kotlin-stdlib-tests' - type = 'zip' + update_stdlib_tests (group: 'org', name: 'Kotlin_dev_Compiler', version: kotlinStdlibVersion) { + artifact { + name = 'internal/kotlin-stdlib-tests' + type = 'zip' + } } } } @@ -121,17 +131,6 @@ def update_external_tests() { externalTestsDir.mkdirs() def compilerTestsFiles = configurations.update_tests.asFileTree - if (project.hasProperty("kotlinProjectPath")) { - def f = Paths.get(project.property("kotlinProjectPath").toString(), "dist", "kotlin-test-data.zip").toFile() - if (f.exists()) { - println(""" - |Using $f as a source of codegen/box* and stdlib tests - |Update test data zip with :kotlin:zipTestData task - """.stripMargin()) - compilerTestsFiles = project.files(f) - } - } - copy { compilerTestsFiles.each { from(zipTree(it))