Skip to content

Instantly share code, notes, and snippets.

Created Aug 5, 2021
What would you like to do? with multiple basis to control classes that end up in uberjar
(ns build
(:require [ :as b]))
(def lib 'com.nortia-solutions/ppi-core)
(def version "0.0.1")
(def class-dir "target/classes")
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
(def full-basis
(b/create-basis {:project "deps.edn"
:aliases [:spark :clark/repl]}))
(def jar-basis
(b/create-basis {:project "deps.edn"}))
;; Entry ;;;;;;;;;;
(defn clean
(b/delete {:path "target"}))
(defn prep
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis jar-basis
:src-dirs ["src"]})
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir}))
(defn uber [_]
(println "Compiling")
(b/compile-clj {:basis full-basis
:src-dirs ["src"]
:class-dir class-dir})
(println "Creating Jar")
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis jar-basis}))
(defn all
(println "Cleaning")
(clean nil)
(println "Preparing")
(prep nil)
(println "Assembling")
(uber nil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment