-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.sc
More file actions
46 lines (39 loc) · 1.08 KB
/
Build.sc
File metadata and controls
46 lines (39 loc) · 1.08 KB
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
import ammonite.ops._
import java.io.File
val ignored = List(".git", ".gitignore", "README.md", "LICENSE", "main.js", "config.ini", "Build.sc")
object Build {
def getListOfFiles(dir: String):List[File] = {
val d = new File(dir)
if (d.exists && d.isDirectory) {
d.listFiles.toList
} else {
List[File]()
}
}
def clean = {
implicit val wd = pwd
Build.getListOfFiles(".")
.filter(f => !ignored.contains(f.getName))
.foreach(f => %rm("-rf", wd / f.getName))
this
}
def frontend = {
implicit val wd = pwd / up / "identity-webclient"
%npm("run", "electron")
this
}
def backend = {
implicit val wd = pwd / up / "identity-server-js"
%npm("run", "electron")
this
}
}
@main
def main(action: String, path: Path = pwd) = {
if (action.contains("clean")) Build.clean
if (action.contains("frontend")) Build.frontend
if (action.contains("backend")) Build.backend
if (action.contains("build")) Build.clean.frontend.backend
}
// amm -s --no-remote-logging Build.sc clean
// amm -s --no-remote-logging Build.sc build