Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (39 sloc) 1.12 KB
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.20'
classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0'
}
}
apply plugin: 'kotlin2js'
apply plugin: 'com.moowork.node'
repositories {
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js"
testCompile "org.jetbrains.kotlin:kotlin-test-js"
}
[compileKotlin2Js, compileTestKotlin2Js]*.configure {
kotlinOptions.moduleKind = "commonjs"
}
task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) {
from compileKotlin2Js.destinationDir
configurations.testCompile.each {
from zipTree(it.absolutePath).matching { include '*.js' }
}
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]
}
test.dependsOn runMocha
You can’t perform that action at this time.