2021-08-01 23:21:31 +00:00
|
|
|
(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-01 23:21:31 +00:00
|
|
|
|
2021-08-03 03:23:24 +00:00
|
|
|
(def lib 'com.github.seancorfield/next.jdbc)
|
2021-09-26 00:50:56 +00:00
|
|
|
(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)
|
2021-11-01 19:44:20 +00:00
|
|
|
(assoc :src-pom "template/pom.xml")
|
2021-08-28 05:51:55 +00:00
|
|
|
(bb/jar)))
|
2021-08-23 02:30:15 +00:00
|
|
|
|
|
|
|
|
(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)))
|