Skip to content

Commit 2cfd062

Browse files
committed
Changed version calculation code a bit
Added output to see what's going on during uberjar build process
1 parent fc32ee8 commit 2cfd062

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

build.clj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,35 @@
33
[clojure.tools.build.api :as b]))
44

55
(def lib 'practitest/practitest-firecracker)
6-
(def version (format "2.2.%s" (b/git-count-revs nil)))
6+
7+
; Create new tag v<Major>.<Minor> when starting working on new major/minor version branch
8+
(def major-version 2)
9+
(def minor-version 2)
10+
11+
(def commits-count (b/git-process {:git-args (format "rev-list v%s.%s..HEAD --count" major-version minor-version)}))
12+
(def version (format "%s.%s.%s" major-version minor-version commits-count))
713
(def class-dir "target/classes")
814
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
915

1016
;; delay to defer side effects (artifact downloads)
1117
(def basis (delay (b/create-basis {:project "deps.edn"})))
1218

1319
(defn clean [_]
20+
(println "Cleaning directories")
1421
(b/delete {:path "target"}))
1522

1623
(defn uber [_]
24+
(println "Building uberjar for" version)
1725
(clean nil)
1826
(b/copy-dir {:src-dirs ["src"]
1927
:target-dir class-dir})
2028
(b/copy-dir {:src-dirs ["resources"]
2129
:target-dir class-dir})
30+
(println "Compiling clojure code")
2231
(b/compile-clj {:basis @basis
2332
:ns-compile '[practitest-firecracker.core]
2433
:class-dir class-dir})
34+
(println "Packing JAR file")
2535
(b/uber {:class-dir class-dir
2636
:uber-file uber-file
2737
:basis @basis

0 commit comments

Comments
 (0)