-
Notifications
You must be signed in to change notification settings - Fork 53
/
build.savant
70 lines (56 loc) · 1.95 KB
/
build.savant
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
fusionauthWebsiteStyleVersion = "0.3.70"
project(group: "io.fusionauth", name: "fusionauth-site", version: "3.0.0", licenses: ["ApacheV2_0"]) {
workflow {
fetch {
cache()
url(url: "https://repository.savantbuild.org")
}
publish {
cache()
}
}
publishWorkflow {
subversion(repository: "https://svn.savantbuild.org")
}
}
dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:1.0.2")
file = loadPlugin(id: "org.savantbuild.plugin:file:1.0.2")
target(name: "clean", description: "cleans the project") {
astroExecute(["rm", "-rf", "node_modules", "dist"])
}
target(name: "install", description: "installs npm dependencies") {
astroExecute(["npm", "install"])
}
target(name: "compile", description: "builds the project", dependsOn: ["install"]) {
astroExecute(["npm", "run", "dev-build"])
}
target(name: "serve", description: "Build and watch the project", dependsOn: ["install"]) {
astroExecute(["npm", "run", "start"])
}
target(name: "watch", description: "Build and watch the project", dependsOn: ["install"]) {
astroExecute(["npm", "run", "dev"])
}
target(name: "lint", description: "Check the project for style, spelling, and syntax errors", dependsOn: ["install"]) {
// todo eslint
astroExecute(["npm", "run", "spellcheck"])
}
target(name: "int", description: "Build and check the astro project", dependsOn: ["lint", "compile"]) {
// todo any post build tests
}
boolean astroExecute(List<String> args) {
ProcessBuilder pb = new ProcessBuilder(args).inheritIO().directory(new File('./astro'))
def process = pb.start()
process.consumeProcessOutput(System.out, System.err)
process.waitFor()
return process.exitValue() == 0
}
/**
* Clears out the RBENV variables in the environment.
*
* @param pb The ProcessBuilder to clear out.
*/
static def clearEnvironment(ProcessBuilder pb) {
pb.environment().remove("RBENV_VERSION")
pb.environment().remove("RBENV_DIR")
pb.environment().remove("RBENV_ROOT")
}