Last active
October 2, 2023 22:05
-
-
Save holyjak/a5e02ef7a3e598790ecec092ebd6a386 to your computer and use it in GitHub Desktop.
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
;; Based on https://github.com/borkdude/fly_io_clojure | |
(ns build | |
(:require [clojure.tools.build.api :as b])) | |
(def lib 'cz.holyjak.rohan-erp/app) | |
(def version "0.0.1") | |
(def class-dir "target/classes") | |
(def basis (b/create-basis {:project "deps.edn"})) | |
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version)) | |
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | |
(defn clean [_] | |
(b/delete {:path "target"})) | |
(defn jar [_] | |
(b/write-pom {:class-dir class-dir | |
:lib lib | |
:version version | |
:basis basis | |
:src-dirs ["src"]}) | |
(b/copy-dir {:src-dirs ["src" "resources"] | |
:target-dir class-dir}) | |
(b/jar {:class-dir class-dir | |
:jar-file jar-file})) | |
(defn uber [_] | |
(clean nil) | |
(b/copy-dir {:src-dirs ["src/main" "resources"] | |
:target-dir class-dir}) | |
;; NOTE: Can comment out compilation to skip AOT => be much faster | |
;; (but then we must start via `clojure.main -m <ns>`) | |
;#_ ; let's skip AOT for now... | |
(b/compile-clj {:basis basis | |
:src-dirs ["src/main"] | |
:class-dir class-dir | |
:ns-compile '[cz.rohan-erp.components.server]}) | |
(b/uber {:class-dir class-dir | |
:uber-file uber-file | |
:basis basis | |
:main 'cz.rohan-erp.components.server}) | |
(println "Uberjar written to" uber-file)) |
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
{:about "clojurescript file"} |
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
(str "This is " #?(:clj "Clojure" :cljs "ClojureScript") " file") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment