From b642f661c2503102d5099f825cb9b326decabb07 Mon Sep 17 00:00:00 2001 From: onionpancakes <639985+onionpancakes@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:23:18 -0800 Subject: [PATCH] build script --- build/build.clj | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ build/pom.xml | 22 ++++++++++++++++++++++ deps.edn | 14 +++++++++++++- 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 build/build.clj create mode 100644 build/pom.xml diff --git a/build/build.clj b/build/build.clj new file mode 100644 index 0000000..b1e0f69 --- /dev/null +++ b/build/build.clj @@ -0,0 +1,48 @@ +(ns build + (:require [cognitect.test-runner.api :as tr] + [clojure.tools.build.api :as b] + [deps-deploy.deps-deploy :as dd])) + +(def basis + (delay (b/create-basis))) + +(def class-dir + "target/classes") + +(def lib + 'dev.onionpancakes/chassis) + +(def version + (format "1.0.%s" (b/git-count-revs nil))) + +(def jar-file + (format "target/%s-%s.jar" (name lib) version)) + +(defn clean [_] + (b/delete {:path "target"})) + +(defn jar [_] + (clean nil) + (b/write-pom {:basis @basis + :src-pom "./build/pom.xml" + :src-dirs ["src"] + :class-dir class-dir + :lib lib + :version version}) + (b/copy-dir {:src-dirs ["src"] + :target-dir class-dir}) + (b/jar {:class-dir class-dir + :jar-file jar-file})) + +(defn install [_] + (b/install {:basis @basis + :class-dir class-dir + :lib lib + :version version + :jar-file jar-file})) + +(defn deploy [_] + (jar nil) + (dd/deploy {:installer :remote + :artifact jar-file + :pom-file (b/pom-path {:class-dir class-dir :lib lib})})) diff --git a/build/pom.xml b/build/pom.xml new file mode 100644 index 0000000..f4a7b1b --- /dev/null +++ b/build/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + jar + dev.onionpancakes + chassis + chassis + Fast HTML5 serialization for Clojure + https://github.com/onionpancakes/chassis + + + MIT License + https://opensource.org/license/mit + + + + + clojars + https://repo.clojars.org/ + + + diff --git a/deps.edn b/deps.edn index 8bed615..21d1572 100644 --- a/deps.edn +++ b/deps.edn @@ -9,6 +9,12 @@ enlive/enlive {:mvn/version "1.1.6"}} :extra-paths ["dev" "test" "resources"]} + :build + {:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"} + io.github.clojure/tools.build {:mvn/version "0.9.6"} + slipset/deps-deploy {:mvn/version "0.2.2"}} + :extra-paths ["build" "test"]} + :run-tests {:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}} :extra-paths ["test"] @@ -22,4 +28,10 @@ selmer/selmer {:mvn/version "1.12.59"} enlive/enlive {:mvn/version "1.1.6"}} :extra-paths ["dev" "test" "resources"] - :exec-fn user/run-gen-bench-all}}} + :exec-fn user/run-gen-bench-all} + + :deploy + {:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"} + io.github.clojure/tools.build {:mvn/version "0.9.6"} + slipset/deps-deploy {:mvn/version "0.2.2"}} + :extra-paths ["build" "test"]}}}