Skip to content

Instantly share code, notes, and snippets.

@eelkevanfoeken
Last active December 7, 2021 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eelkevanfoeken/3ef0a6f4519f34956d63ecd0ef38137a to your computer and use it in GitHub Desktop.
Save eelkevanfoeken/3ef0a6f4519f34956d63ecd0ef38137a to your computer and use it in GitHub Desktop.
(ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'some/lib)
(def version (format "0.0.%s" (b/git-count-revs nil)))
(def class-dir "target")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(def copy-srcs ["src/cljs" "src/clj" "env/prod/clj" #_"resources"])
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
(defn uber [_]
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src/clj" "src/cljs"]
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main 'some.server}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment