Skip to content

Commit

Permalink
dev/build: distribute the jar for software should use uberjar
Browse files Browse the repository at this point in the history
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
  • Loading branch information
avelino committed May 10, 2024
1 parent 68531b3 commit c5f9060
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions dev/com/moclojer/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
:exclude ["docs/*" "META-INF/*" "test/*" "target/*"]}))

(defn -main
[& _]
[& args]
(let [basis (b/create-basis {:project "deps.edn"})]
(println "Clearing target directory")
(b/delete {:path "target"})
Expand All @@ -64,11 +64,16 @@
(println "Compile sources to classes")
(b/compile-clj options)

(println "Packaging classes into jar")
(b/jar options)

;; (println "Building uberjar")
;; (b/uber options)
;; build `.jar` used uberjar (distribute software) or jar (distribute library)
(println "args" args)
(let [uberjar-flag (or (some #(= % "--uberjar") args) false)]
(if uberjar-flag
(do
(println "Building uberjar")
(b/uber options))
(do
(println "Packaging classes into jar")
(b/jar options))))

;; prepare file for native image
;; TODO: commented feature, see why https://github.com/moclojer/moclojer/issues/158
Expand Down

0 comments on commit c5f9060

Please sign in to comment.