-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle.kts
101 lines (81 loc) · 2.18 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import com.github.gradle.node.yarn.task.YarnTask
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
plugins {
kotlin("jvm") version "1.8.10"
id("com.github.node-gradle.node") version "4.0.0"
id("idea")
}
project.defaultTasks = listOf("build")
repositories {
mavenLocal()
gradlePluginPortal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
idea {
module {
setDownloadJavadoc(true)
setDownloadSources(true)
}
}
dependencies {
implementation(gradleApi())
implementation(gradleKotlinDsl())
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
withJavadocJar()
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
}
named<YarnTask>("yarn_install") {
group = "doc"
args.set(listOf("--mutex", "network"))
workingDir.set(file("${rootDir}/documentation"))
}
register<YarnTask>("yarnRunStart") {
group = "doc"
dependsOn(named("yarn_install"))
args.set(listOf("run", "start"))
workingDir.set(file("${rootDir}/documentation"))
}
register<YarnTask>("yarnRunBuild") {
group = "doc"
dependsOn(named("yarn_install"))
args.set(listOf("run", "build"))
workingDir.set(file("${rootDir}/documentation"))
}
register<Delete>("docCleanUp") {
group = "doc"
delete(file("${rootDir}/docs"))
delete(file("${rootDir}/documentation/build"))
delete(file("${rootDir}/documentation/.docusaurus"))
delete(file("${rootDir}/documentation/node_modules"))
}
register<Copy>("docBuild") {
group = "doc"
dependsOn(named("yarnRunBuild"), named("docCleanUp"))
from(file("${rootDir}/documentation/build"))
into(file("${rootDir}/docs"))
}
}
tasks.named("build") {
dependsOn("docBuild")
}
node {
version.set("14.17.5")
yarnVersion.set("1.22.11")
download.set(true)
}