-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
54 lines (48 loc) · 1.25 KB
/
build.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
import groovy.json.JsonOutput
task verifyBallerinaVerision() {
def stdout = new ByteArrayOutputStream()
doLast {
exec {
commandLine "bash", "-c", "bal version 2>&1 | sed 1q"
standardOutput = stdout;
}
def additionalData = [balVersion : stdout.toString()]
file("data/ballerina.json").text = JsonOutput.toJson(additionalData)
}
}
task test(dependsOn: [verifyBallerinaVerision]) {
}
task hugo() {
def currentDir = file(".")
def themeDir = file("themes/baltips")
doLast {
exec {
commandLine "npm", "install"
workingDir themeDir
}
exec {
commandLine "npm", "run", "build"
workingDir themeDir
}
exec {
commandLine "hugo", "--minify"
workingDir currentDir
}
String npm = 'npm';
if (System.getProperty('os.name').toLowerCase().contains('windows')) {
npm = 'npm.cmd'
}
exec {
commandLine npm, 'run', 'buildsearch'
workingDir currentDir
}
}
}
task codeGen() {
doLast {
exec {
commandLine "bash", "-c", "node build-ballerina.js"
}
}
}
task prepare(dependsOn: [codeGen]){}