forked from babashka/nbb-features
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbb.edn
54 lines (49 loc) · 1.89 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
{:paths ["script"]
:deps
{nbb.build/nbb.build
{:git/url "https://github.com/babashka/nbb"
:git/sha "35e4e94966d0ae45bb87569940b7c1fb05c19467"
:deps/root "build"}
#_{:local/root "../nbb/build"}
nbb/nbb
{:git/url "https://github.com/babashka/nbb"
:git/sha "35e4e94966d0ae45bb87569940b7c1fb05c19467"
:git/tag "v1.2.173"}
#_{:local/root "../nbb"}
datascript/deps {:local/root "features/datascript"}
datascript-transit/deps {:local/root "features/datascript-transit"}
linked/deps {:local/root "features/linked"}}
:tasks
{:requires ([babashka.fs :as fs]
[nbb.build :as build]
[clojure.string :as str])
clean (fs/delete-tree "lib")
npm-install (shell "npm install")
release {:depends [clean npm-install]
:doc "Compiles release build."
:task (build/release *command-line-args*)}
test nbb-feature-tests/main
update-nbb
{:doc "Update to latest nbb tag"
:extra-deps {borkdude/rewrite-edn {:mvn/version "0.2.0"}}
:requires ([borkdude.rewrite-edn :as r])
:task
(let [update-bb-dep
(fn [dep dep-map]
(let [nodes (-> "bb.edn" slurp r/parse-string)]
(spit "bb.edn"
(str (reduce (fn [acc [k v]]
(r/assoc-in acc [:deps dep k] v))
nodes
dep-map)))))
[_ sha tag]
(->> (shell {:out :string} "git ls-remote --heads --tags https://github.com/babashka/nbb.git")
:out
str/split-lines
last
(re-matches (re-pattern "(\\S+)\\trefs/tags/([v.0-9]+).*")))]
(assert (and sha tag) "Sha and tag must exist to continue")
(update-bb-dep 'nbb/nbb {:git/sha sha :git/tag tag})
(update-bb-dep 'nbb.build/nbb.build {:git/sha sha})
(println "Update nbb to" tag)
(shell "git commit -m" (str "Update nbb to " tag) "."))}}}