aboutsummaryrefslogtreecommitdiff
path: root/bb.edn
blob: 54f6027a704a5c153fbfd98008f4ab3f60a00e84 (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
{: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*)}

  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")}}}