-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
21 lines (20 loc) · 1.45 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{:deps {town.lilac/eql {:local/root "."}
org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
:git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}}
:tasks {:requires ([clojure.string :as string])
gen-script (let [prelude (slurp "prelude")
eql (slurp "src/town/lilac/eql.clj")]
(spit "eql" (string/join "\n" [prelude eql])))
bump-version {:task (let [version (-> (slurp "version.txt")
string/trim)
[major minor patch] (string/split version (re-pattern "\\."))
version (string/join "." [major minor (inc (Integer/parseInt patch))])]
(spit "version.txt" version)
version)}
sync-version (let [version (-> (slurp "version.txt") string/trim)
oldsource (slurp "src/town/lilac/eql.clj")
newsource (string/replace oldsource
;; Regex literals like #"\(def version \"[0-9\.]+\"\)" are not supported in bb.edn
(re-pattern "\\(def version \\\"[0-9\\.]+\\\"\\)")
(str "(def version \"" version "\")"))]
(spit "src/town/lilac/eql.clj" newsource))}}