-
Notifications
You must be signed in to change notification settings - Fork 80
/
build.gradle.kts
105 lines (77 loc) · 2.29 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
102
103
104
105
import at.phatbl.shellexec.ShellExec
plugins {
kotlin("jvm") version "1.7.0" apply false
id("at.phatbl.shellexec") version "1.5.2"
}
val htmlBuildDir = "$buildDir/spec/html"
val pdfBuildDir = "$buildDir/spec/pdf"
val resourcesBuildDir = "$htmlBuildDir/resources"
val jsBuildDir = "$resourcesBuildDir/js"
tasks.create<Copy>("copyStatic") {
group = "internal"
from("$projectDir/web/resources")
into(resourcesBuildDir)
}
tasks.create<Copy>("copyBuiltJs") {
group = "internal"
mustRunAfter("web:build")
from("$projectDir/web/build/js")
into(jsBuildDir)
}
tasks.create<Copy>("copyHtml") {
group = "internal"
mustRunAfter("docs:buildHtml", "docs:buildHtmlBySections")
from("$projectDir/docs/build/spec/html")
into(htmlBuildDir)
}
tasks.create<Copy>("copyPdf") {
group = "internal"
mustRunAfter("docs:buildPdf", "docs:buildPdfBySections")
from("$projectDir/docs/build/spec/pdf")
into(pdfBuildDir)
}
tasks.create<Copy>("copyStubIndexToRedirectToIntroduction") {
group = "internal"
mustRunAfter("docs:buildPdf", "docs:buildPdfBySections")
from("$projectDir/web/resources/html")
into(htmlBuildDir)
}
tasks.create("buildJs") {
group = "internal"
dependsOn("copyStatic")
dependsOn("web:build")
dependsOn("copyBuiltJs")
doFirst {
File(jsBuildDir).mkdirs()
}
}
tasks.create("buildWeb") {
group = "build"
dependsOn("docs:buildHtml")
dependsOn("docs:buildHtmlBySections")
dependsOn("copyHtml")
dependsOn("buildJs")
}
tasks.create("buildWebFullOnly") {
group = "build"
dependsOn("docs:buildHtml")
dependsOn("copyHtml")
dependsOn("buildJs")
}
tasks.create("buildWebBySectionsOnly") {
group = "build"
dependsOn("docs:buildHtmlBySections")
dependsOn("copyHtml")
dependsOn("buildJs")
dependsOn("copyStubIndexToRedirectToIntroduction")
}
tasks.create("buildPdf") {
group = "build"
dependsOn("docs:buildPdf")
dependsOn("docs:buildPdfBySections")
dependsOn("copyPdf")
}
tasks.create<ShellExec>("syncGrammarWithKotlinGrammarApache2Repo") {
group = "internal"
command = """echo -e "Run the following commands: git checkout release; ...; git subtree push --prefix grammar/src/main/antlr git@github.com:Kotlin/kotlin-grammar-apache2 release""""
}