This repository has been archived by the owner on Mar 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcommon.gradle
56 lines (44 loc) · 1.81 KB
/
common.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
allprojects {
ext.configureNodePlugin = {
apply plugin: 'com.github.node-gradle.node'
node {
// Version of node to use
version = '10.15.3'
// Base URL for fetching node distributions (change if you have a mirror)
distBaseUrl = 'https://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${projectDir}/build/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${projectDir}/build/npm")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${projectDir}/build")
}
}
ext.applyKarma = {
apply plugin: 'kotlin-dce-js'
configureNodePlugin()
runDceJsTestKotlin.dceOptions.devMode = true
runDceJsTestKotlin.dependsOn(jsTestClasses, npmInstall)
task copyKarmaConfig(dependsOn: [runDceJsTestKotlin]) {
doLast {
copy {
from ("${projectDir}") {
include "karma.conf.js"
include "webpack.karma.js"
}
into "${projectDir}/build"
}
}
}
task runKarmaTests(type: NodeTask, dependsOn: [runDceJsTestKotlin, copyKarmaConfig]) {
script = file("${projectDir}/build/node_modules/karma/bin/karma")
args = ['start', '--single-run', '--browsers', 'ChromeHeadlessNoSandbox', file("${projectDir}/build/karma.conf.js")]
execOverrides {
it.workingDir = file("${projectDir}/build/")
}
}
}
}