next-jdbc/build.clj

41 lines
1 KiB
Clojure
Raw Normal View History

(ns build
2021-08-13 02:43:04 +00:00
"next.jdbc's build script.
clojure -T:build ci
2021-08-31 01:23:18 +00:00
clojure -T:build deploy
Run tests via:
clojure -X:test
2021-08-13 02:43:04 +00:00
For more information, run:
clojure -A:deps -T:build help/doc"
2021-09-23 01:48:05 +00:00
(:refer-clojure :exclude [test])
2021-08-03 03:41:43 +00:00
(:require [clojure.tools.build.api :as b]
2021-08-28 05:51:55 +00:00
[org.corfield.build :as bb]))
2021-08-03 03:23:24 +00:00
(def lib 'com.github.seancorfield/next.jdbc)
(defn- the-version [patch] (format "1.2.%s" patch))
(def version (the-version (b/git-count-revs nil)))
(def snapshot (the-version "999-SNAPSHOT"))
2021-09-23 01:48:05 +00:00
(defn test "Run all the tests." [opts]
(reduce (fn [opts alias]
(bb/run-tests (assoc opts :aliases [alias])))
opts
[:1.10 :master])
opts)
2021-08-03 03:23:24 +00:00
2021-08-13 02:43:04 +00:00
(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
2021-08-23 02:51:40 +00:00
(-> opts
2021-09-23 01:48:05 +00:00
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
(test)
2021-08-28 05:51:55 +00:00
(bb/clean)
(assoc :src-pom "pom_template.xml")
2021-08-28 05:51:55 +00:00
(bb/jar)))
(defn deploy "Deploy the JAR to Clojars." [opts]
2021-08-28 05:51:55 +00:00
(-> opts
2021-09-23 01:48:05 +00:00
(assoc :lib lib :version (if (:snapshot opts) snapshot version))
2021-08-28 05:51:55 +00:00
(bb/deploy)))