-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbb.edn
67 lines (53 loc) · 2.88 KB
/
bb.edn
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
{:paths ["bb"]
:deps {borkdude/gh-release-artifact
{:git/url "https://github.com/borkdude/gh-release-artifact"
:sha "a83ee8da47d56a80b6380cbb6b4b9274048067bd"}}
:tasks {:requires [[babashka.fs :as fs]
[clojure.string :as str]
[clojure.edn :as edn]]
:init (do (def target-dir (fs/absolutize "out"))
(def executable-name "obb")
(def bin-dir (str (fs/file target-dir "bin")))
(def main-js (str (fs/file target-dir "obb.js")))
(def executable-path (str (fs/file bin-dir executable-name)))
(def version (:version (edn/read-string (slurp "project.edn"))))
(def tar-file (fs/file target-dir "obb.tar.gz")))
clean (fs/delete-tree target-dir)
shadow-server (do
(shell "npm install")
(shell "npx shadow-cljs server"))
shadow-dev-compile (shell "npx shadow-cljs release obb")
dev (load-file "bb/watch.clj")
shadow-release (shell "npx shadow-cljs release obb"
"--config-merge"
"{:compiler-options {:optimizations :advanced}}")
build (when (seq (fs/modified-since executable-path ["deps.edn"
"shadow-cljs.edn"
"src"]))
(println "Compiling obb")
(fs/copy "project.edn" "resources" {:replace-existing true})
(run 'shadow-release)
(fs/create-dirs bin-dir)
(println "Preparing executable")
(spit executable-path
(str "#!/usr/bin/env osascript -l JavaScript\n\n"
(slurp "out/obb.js")))
(shell (str "chmod u+x " executable-path)))
tar {:depends [build]
:requires ([tar])
:task (tar/tar {:executable-path executable-path
:executable-name executable-name
:tar-file tar-file})}
upload-assets {:doc "Uploads jar and vsix to Github"
:depends [tar]
:requires ([upload-release :as ur])
:task (ur/release {:file tar-file
:version version})}
test {:doc "Run integration tests"
:depends [build]
:task integration-tests/run-tests}
dev-test {:doc "Run integration tests while `bb dev` is running"
:requires ([integration-tests :as it])
:task (it/run-tests :dev true)}
changelog {:doc "Updates changelog with links to issues"
:task (load-file "bb/changelog.clj")}}}