diff --git a/libraries/kotlin.test/js/it/build.gradle b/libraries/kotlin.test/js/it/build.gradle index e6ffa0073ea..1d4a40fe003 100644 --- a/libraries/kotlin.test/js/it/build.gradle +++ b/libraries/kotlin.test/js/it/build.gradle @@ -10,46 +10,25 @@ dependencies { compile project(':kotlin-test:kotlin-test-js') } - -sourceSets { - main.kotlin.srcDirs += 'src' - test.kotlin.srcDirs += 'test' +[compileKotlin2Js, compileTestKotlin2Js]*.configure { + kotlinOptions.moduleKind = "commonjs" } +task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { + from compileKotlin2Js.destinationDir -compileKotlin2Js { - kotlinOptions { - moduleKind = "commonjs" + configurations.testCompile.each { + from zipTree(it.absolutePath).matching { include '*.js' } } -} -compileTestKotlin2Js { - kotlinOptions { - moduleKind = "commonjs" - } -} - -compileKotlin2Js.doLast { - configurations.compile.each { File file -> - copy { - includeEmptyDirs = false - - from zipTree(file.absolutePath) - into "${buildDir}/classes/" - include { fileTreeElement -> - def path = fileTreeElement.path - path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/")) - } - } - } + into "${buildDir}/classes" } node { - version = '6.11.0' download = true } -task testJest(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin2Js, npmInstall]) { +task testJest(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { args = ['run', 'test-jest'] execOverrides { it.standardOutput = new FileOutputStream("$buildDir/test-jest.log") @@ -57,28 +36,28 @@ task testJest(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin } } -task testJasmine(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin2Js, npmInstall]) { +task testJasmine(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { args = ['run', 'test-jasmine'] execOverrides { it.standardOutput = new FileOutputStream("$buildDir/test-jasmine.log") } } -task testMocha(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin2Js, npmInstall]) { +task testMocha(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { args = ['run', 'test-mocha'] execOverrides { it.standardOutput = new FileOutputStream("$buildDir/test-mocha.log") } } -task testQunit(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin2Js, npmInstall]) { +task testQunit(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { args = ['run', 'test-qunit'] execOverrides { it.standardOutput = new FileOutputStream("$buildDir/test-qunit.log") } } -task testTape(type: NpmTask, dependsOn: [compileTestKotlin2Js, compileTestKotlin2Js, npmInstall]) { +task testTape(type: NpmTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, npmInstall]) { args = ['run', 'test-tape'] execOverrides { it.standardOutput = new FileOutputStream("$buildDir/test-tape.log") diff --git a/libraries/kotlin.test/js/it/src/Main.kt b/libraries/kotlin.test/js/it/src/main/kotlin/Main.kt similarity index 100% rename from libraries/kotlin.test/js/it/src/Main.kt rename to libraries/kotlin.test/js/it/src/main/kotlin/Main.kt diff --git a/libraries/kotlin.test/js/it/test/MainTest.kt b/libraries/kotlin.test/js/it/src/test/kotlin/MainTest.kt similarity index 100% rename from libraries/kotlin.test/js/it/test/MainTest.kt rename to libraries/kotlin.test/js/it/src/test/kotlin/MainTest.kt diff --git a/libraries/kotlin.test/js/it/test/org/OrgTest.kt b/libraries/kotlin.test/js/it/src/test/kotlin/org/OrgTest.kt similarity index 100% rename from libraries/kotlin.test/js/it/test/org/OrgTest.kt rename to libraries/kotlin.test/js/it/src/test/kotlin/org/OrgTest.kt diff --git a/libraries/kotlin.test/js/it/test/org/other/name/NameTest.kt b/libraries/kotlin.test/js/it/src/test/kotlin/org/other/name/NameTest.kt similarity index 100% rename from libraries/kotlin.test/js/it/test/org/other/name/NameTest.kt rename to libraries/kotlin.test/js/it/src/test/kotlin/org/other/name/NameTest.kt diff --git a/libraries/kotlin.test/js/it/test/org/some/SomeTest.kt b/libraries/kotlin.test/js/it/src/test/kotlin/org/some/SomeTest.kt similarity index 100% rename from libraries/kotlin.test/js/it/test/org/some/SomeTest.kt rename to libraries/kotlin.test/js/it/src/test/kotlin/org/some/SomeTest.kt diff --git a/libraries/kotlin.test/js/it/test/org/some/name/NameTest.kt b/libraries/kotlin.test/js/it/src/test/kotlin/org/some/name/NameTest.kt similarity index 100% rename from libraries/kotlin.test/js/it/test/org/some/name/NameTest.kt rename to libraries/kotlin.test/js/it/src/test/kotlin/org/some/name/NameTest.kt