blob: 31a61f39c0d292b92c1c1239934fd25a18ea1f40 (
plain)
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
|
{:tasks
{:requires ([babashka.fs :as fs]
[clojure.string :as str])
:init (let [windows? (str/starts-with? (System/getProperty "os.name") "Windows")]
(if windows?
(do
(println "Cannot run on Windows !")
(System/exit 1))))
clean {:doc "Removes target folder."
:task (fs/delete-tree "target")}
nrepl {:doc "Starts a nrepl session."
:task (apply clojure "-M:nrepl" *command-line-args*)}
storm {:doc "Starts a nrepl session with storm debugger."
:task (apply clojure "-M:storm" *command-line-args*)}
lib:run:main {:doc "Run's main only for cljcc library."
:task (apply shell {:dir "cljcc-compiler"} "clojure -M -m cljcc.cljcc" *command-line-args*)}
lib:build:jar {:doc "Builds uberjar only for cljcc lib."
:task (shell {:dir "cljcc-compiler"} "clojure -T:build ci")}
lib:build:wasm {:doc "Builds native WASM image."
:depends [lib:build:jar]
:task (shell {:dir "target/lib"}
"native-image"
"--tool:svm-wasm"
"-jar" "cljcc-lib.jar"
"-o" "cljcc-lib-wasm"
"--features=clj_easy.graal_build_time.InitClojureClasses"
"--initialize-at-build-time"
"--verbose")}
cli:run:main {:doc "Run's main CLI function."
:task (apply shell {:dir "cli"} "clojure -M -m cli.cli" *command-line-args*)}
cli:build:jar {:doc "Builds uberjar for CLI."
:task (shell {:dir "cli"} "clojure -T:build ci")}
cli:run:jar {:doc "Runs CLI jar."
:depends [cli:build:jar]
:task (apply shell "java -jar target/cli/cljcc-cli.jar" *command-line-args*)}
cli:build:native {:doc "Builds native image for CLI."
:depends [cli:build:jar]
:task
(shell {:dir "target/cli"}
"native-image"
"-jar" "cljcc-cli.jar"
"-o" "cljcc-cli"
"-Ob" ; quick compilation flag for development
"-H:+ReportExceptionStackTraces"
"--features=clj_easy.graal_build_time.InitClojureClasses"
"--initialize-at-build-time"
"--report-unsupported-elements-at-runtime"
"--verbose"
"--no-fallback")}}}
|