Akhil Sunny
11/16/2019, 2:14 AMcompileKotlin2Js {
kotlinOptions {
metaInfo = true
outputFile = "${project.buildDir.path}/classes/main/${project.name}.js"
sourceMap = true
sourceMapEmbedSources = "always"
moduleKind = 'umd'
}
}
compileTestKotlin2Js { kotlinOptions.moduleKind = 'umd' }
task populateNodeModules(type: Copy, dependsOn: compileTestKotlin2Js) {
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 yarnInstall(type: YarnTask) {
args = ['install']
}
task runMocha(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules,yarnInstall, installMocha]) {
script = file('node_modules/mocha/bin/mocha')
args = [compileTestKotlin2Js.outputFile]
}
task runTest {
dependsOn runMocha
}
test.dependsOn runTest
Ilya Goncharov [JB]
11/16/2019, 6:42 AM