-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
43 lines (35 loc) · 989 Bytes
/
build.gradle.kts
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
@file:Suppress("UnstableApiUsage")
import com.moowork.gradle.node.yarn.YarnTask
plugins {
id("com.github.node-gradle.node") version "2.2.4"
}
node {
version = "10.18.1"
yarnVersion = "1.17.0"
download = true
}
tasks {
val reactBuild by creating(YarnTask::class) {
args = listOf("build")
inputs.files(
"package.json", // React package configuration
"yarn.lock", // dependencies lockfile
"tsconfig.json" // TypeScript config
).withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir(
"src" // React sources
).withPathSensitivity(PathSensitivity.RELATIVE)
inputs.dir(
fileTree("node_modules") // Node modules ...
.exclude(".cache") // ... ignoring cache
).withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir("build")
outputs.cacheIf { true }
dependsOn("yarn")
}
create<YarnTask>("jest") {
setEnvironment(mapOf("CI" to "true"))
args = listOf("test")
dependsOn("yarn")
}
}