-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(ns build | ||
(:require [clojure.tools.build.api :as b])) | ||
|
||
(def build-folder "target") | ||
(def jar-content (str build-folder "/classes")) | ||
|
||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def version "1.0") | ||
(def app-name "redqu") | ||
(def uber-file-name (format "%s/%s-%s.jar" build-folder app-name version)) ; path for result uber file | ||
|
||
(defn clean [_] | ||
(b/delete {:path "target"}) | ||
(println (format "Build folder \"%s\" removed" build-folder))) | ||
|
||
(defn uber [_] | ||
(clean nil) | ||
|
||
(b/copy-dir {:src-dirs ["resources"] ; copy resources | ||
:target-dir jar-content}) | ||
|
||
(b/compile-clj {:basis basis ; compile clojure code | ||
:src-dirs ["src"] | ||
:class-dir jar-content}) | ||
|
||
(b/uber {:class-dir jar-content ; create uber file | ||
:uber-file uber-file-name | ||
:basis basis | ||
:main 'redqu.core}) ; here we specify the entry point for uberjar | ||
|
||
(println (format "Uber file created: \"%s\"" uber-file-name))) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{:deps {org.clojure/clojure {:mvn/version "1.11.1"} | ||
clj-http {:mvn/version "3.12.3"} | ||
clj-http/clj-http {:mvn/version "3.12.3"} | ||
org.clojure/tools.build {:mvn/version "0.9.0"} | ||
org.clojure/tools.cli {:mvn/version "1.0.214"}} | ||
:paths ["src"] | ||
} | ||
:aliases | ||
{ | ||
:build {:deps {io.github.clojure/tools.build {:git/tag "v0.8.1" :git/sha "7d40500"}} | ||
:ns-default build}} ; <-- set build namespace as default | ||
} |