Last active
April 30, 2018 17:22
-
-
Save alandipert/3d53a625d95eb8edd30f31603008d851 to your computer and use it in GitHub Desktop.
Example of producing multiple jars with boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set-env! :source-paths #{"src"}) | |
(def +filesets+ (atom ())) | |
(deftask push-fs [] | |
(fn [next] | |
(fn [fs] | |
(swap! +filesets+ conj fs) | |
(next fs)))) | |
(deftask pop-fs [] | |
(fn [next] | |
(fn [fs] | |
(if-let [prev (peek @+filesets+)] | |
(do (swap! +filesets+ pop) | |
(next prev)) | |
(next fs))))) | |
(deftask build [] | |
(comp (javac) | |
(uber) | |
(push-fs) | |
(jar :file "main1.jar" :main 'com.example.multijar.Main1) | |
(sift :include [#"^main1.jar$"]) | |
(target) | |
(pop-fs) | |
(sift :to-resource [#".*"]) | |
(jar :file "main2.jar" :main 'com.example.multijar.Main2) | |
(sift :include [#"^main2.jar$"]) | |
(target :no-clean true))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment