diff --git a/gradle/js-tests/.gitignore b/gradle/js-tests/.gitignore index c556c5f495..b0ec1e93a7 100644 --- a/gradle/js-tests/.gitignore +++ b/gradle/js-tests/.gitignore @@ -3,3 +3,4 @@ build .idea *.iml node_modules +package-lock.json diff --git a/gradle/js-tests/frontend-plugin/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/frontend-plugin/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/frontend-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/frontend-plugin/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/jasmine/build.gradle b/gradle/js-tests/jasmine/build.gradle index 3a34508dfc..95a1e5548f 100644 --- a/gradle/js-tests/jasmine/build.gradle +++ b/gradle/js-tests/jasmine/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20' - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' + classpath 'gradle.plugin.de.solugo.gradle:gradle-nodejs-plugin:0.2.1' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'de.solugo.gradle.nodejs' repositories { jcenter() @@ -34,17 +34,10 @@ task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { into "${buildDir}/node_modules" } -node { - download = true -} - -task installJasmine(type: NpmTask) { - args = ['install', 'jasmine'] -} - -task runJasmine(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installJasmine]) { - script = file('node_modules/jasmine/bin/jasmine.js') - args = [compileTestKotlin2Js.outputFile] +task runJasmine(type: NodeJsTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + require = ["jasmine"] + executable = "node_modules/jasmine/bin/jasmine.js" + args = [projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] } test.dependsOn runJasmine diff --git a/gradle/js-tests/jasmine/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/jasmine/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/jasmine/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/jasmine/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/jest/build.gradle b/gradle/js-tests/jest/build.gradle index 7d85f45e52..6041b03219 100644 --- a/gradle/js-tests/jest/build.gradle +++ b/gradle/js-tests/jest/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20' - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' + classpath 'gradle.plugin.de.solugo.gradle:gradle-nodejs-plugin:0.2.1' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'de.solugo.gradle.nodejs' repositories { jcenter() @@ -34,17 +34,10 @@ task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { into "${buildDir}/node_modules" } -node { - download = true -} - -task installJest(type: NpmTask) { - args = ['install', 'jest'] -} - -task runJest(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installJest]) { - script = file('node_modules/jest/bin/jest.js') - args = [projectDir.toURI().relativize(compileTestKotlin2Js.outputFile.toURI())] +task runJest(type: NodeJsTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + require = ["jest"] + executable = "node_modules/jest/bin/jest.js" + args = [projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] } test.dependsOn runJest diff --git a/gradle/js-tests/jest/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/jest/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/jest/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/jest/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/jest/package.json b/gradle/js-tests/jest/package.json index 469bde7cc5..7eede641bc 100644 --- a/gradle/js-tests/jest/package.json +++ b/gradle/js-tests/jest/package.json @@ -3,6 +3,9 @@ "test": "./gradlew test" }, "jest": { - "testRegex": "_test\\.js$" + "testRegex": "_test\\.js$" + }, + "dependencies": { + "jest": "^23.0.1" } } diff --git a/gradle/js-tests/karma/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/karma/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/karma/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/karma/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/mocha/build.gradle b/gradle/js-tests/mocha/build.gradle index d7f8da32c1..60882f883f 100644 --- a/gradle/js-tests/mocha/build.gradle +++ b/gradle/js-tests/mocha/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20' - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' + classpath 'gradle.plugin.de.solugo.gradle:gradle-nodejs-plugin:0.2.1' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'de.solugo.gradle.nodejs' repositories { jcenter() @@ -34,17 +34,10 @@ task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { into "${buildDir}/node_modules" } -node { - download = true -} - -task installMocha(type: NpmTask) { - args = ['install', 'mocha'] -} - -task runMocha(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha]) { - script = file('node_modules/mocha/bin/mocha') - args = [compileTestKotlin2Js.outputFile] +task runMocha(type: NodeJsTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + require = ["mocha"] + executable = "node_modules/mocha/bin/mocha" + args = [projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] } test.dependsOn runMocha diff --git a/gradle/js-tests/mocha/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/mocha/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/mocha/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/mocha/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/qunit/build.gradle b/gradle/js-tests/qunit/build.gradle index 81020d1967..d0610fead4 100644 --- a/gradle/js-tests/qunit/build.gradle +++ b/gradle/js-tests/qunit/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20' - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' + classpath 'gradle.plugin.de.solugo.gradle:gradle-nodejs-plugin:0.2.1' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'de.solugo.gradle.nodejs' repositories { jcenter() @@ -34,16 +34,9 @@ task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { into "${buildDir}/node_modules" } -node { - download = true -} - -task installQunit(type: NpmTask) { - args = ['install', 'qunitjs'] -} - -task runQunit(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installQunit]) { - script = file('node_modules/qunitjs/bin/qunit') +task runQunit(type: NodeJsTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + require = ["qunit"] + executable = "node_modules/qunit/bin/qunit" args = [projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] } diff --git a/gradle/js-tests/qunit/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/qunit/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/qunit/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/qunit/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip diff --git a/gradle/js-tests/tape/build.gradle b/gradle/js-tests/tape/build.gradle index 2dba7162d7..09f2a70170 100644 --- a/gradle/js-tests/tape/build.gradle +++ b/gradle/js-tests/tape/build.gradle @@ -4,12 +4,12 @@ buildscript { } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20' - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' + classpath 'gradle.plugin.de.solugo.gradle:gradle-nodejs-plugin:0.2.1' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'de.solugo.gradle.nodejs' repositories { jcenter() @@ -24,25 +24,20 @@ dependencies { kotlinOptions.moduleKind = "commonjs" } -task populateNodeModules(type: Copy) { +task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { from compileKotlin2Js.destinationDir - configurations.testCompile.each { from zipTree(it.absolutePath) } - include '*.js' - into "${buildDir}/node_modules" -} + configurations.testCompile.each { + from zipTree(it.absolutePath).matching { include '*.js' } + } -node { - download = true -} - -task installTape(type: NpmTask) { - args = ['install', 'tape'] + into "${buildDir}/node_modules" } -task testTape(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installTape]) { - script = file('node_modules/tape/bin/tape') - args = ['tape-plugin.js', compileTestKotlin2Js.outputFile] +task("testTape", type: NodeJsTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + require = ["tape"] + executable = "node_modules/tape/bin/tape" + args = ['tape-plugin.js', projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] } test.dependsOn testTape diff --git a/gradle/js-tests/tape/gradle/wrapper/gradle-wrapper.properties b/gradle/js-tests/tape/gradle/wrapper/gradle-wrapper.properties index da0e5c9b16..1ed3339172 100755 --- a/gradle/js-tests/tape/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/js-tests/tape/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip