diff options
Diffstat (limited to 'runtime/js/build.gradle')
-rw-r--r-- | runtime/js/build.gradle | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/runtime/js/build.gradle b/runtime/js/build.gradle deleted file mode 100644 index ba2cfdc0..00000000 --- a/runtime/js/build.gradle +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - id "com.moowork.node" version "1.2.0" -} - -ext { - nodeVersion = '8.11.1' - qunitjsVersion = '2.4.0' -} - -apply plugin: 'kotlin-platform-js' - -dependencies { - expectedBy project(':common') - - compile libraries.kotlin_stdlib_js - testCompile libraries.kotlin_test_js -} - -compileKotlin2Js { - kotlinOptions.moduleKind = "umd" - kotlinOptions.sourceMap = true - kotlinOptions.metaInfo = true -} - -compileTestKotlin2Js { - kotlinOptions.moduleKind = "commonjs" - kotlinOptions.sourceMap = true -} - -node { - version = nodeVersion - download = true - nodeModulesDir = file(buildDir) -} - -task populateNodeModules(type: Copy, dependsOn: [compileKotlin2Js]) { - from compileKotlin2Js.destinationDir - into "$node.nodeModulesDir/node_modules" - - afterEvaluate { - configurations.testCompile.each { - if (it.absolutePath.endsWith(".jar")) { - from zipTree(it.absolutePath).matching { - include '*.js' - include '*.js.map' - } - } - } - } -} - -// Workaround the problem with Node downloading: -// Konan plugin uses Gradle-metadata feature which is not compatible -// with node plugin download implementation -repositories.whenObjectAdded { - if (it instanceof IvyArtifactRepository) { - metadataSources { - artifact() - } - } -} - -task installQunit(type: NpmTask) { - inputs.property('qunitjsVersion', qunitjsVersion) - outputs.dir file("$node.nodeModulesDir/node_modules/qunitjs") - - args = ['install', "qunitjs@${qunitjsVersion}"] -} - -task runQunit(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installQunit]) { - script = file("$node.nodeModulesDir/node_modules/qunitjs/bin/qunit") - args = [projectDir.toPath().relativize(file(compileTestKotlin2Js.outputFile).toPath())] - if (project.hasProperty("tests")) args += ["-f", project.property('tests')] -} - -test.dependsOn runQunit |