forked from camsaul/methodical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.clj
43 lines (35 loc) · 1.13 KB
/
build.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(ns build
(:require [clojure.java.shell :as sh]
[clojure.pprint :as pprint]
[clojure.string :as str]
[org.corfield.build :as bb]))
(def scm-url "git@github.com:camsaul/methodical.git")
(def lib 'methodical/methodical)
(def version (str/trim (slurp "VERSION.txt")))
(defn sha [& _]
(or (not-empty (System/getenv "GITHUB_SHA"))
(not-empty (-> (sh/sh "git" "rev-parse" "HEAD")
:out
str/trim))))
(def default-options
{:lib lib
:version version
:scm {:tag (sha)
:connection (str "scm:git:" scm-url)
:developerConnection (str "scm:git:" scm-url)
:url scm-url}})
(println "Options:")
(pprint/pprint default-options)
(println)
(defn build [opts]
(doto (merge default-options opts)
bb/clean
bb/jar))
(defn install [opts]
(printf "Installing %s to local Maven repository...\n" version)
(bb/install (merge default-options opts)))
(defn build-and-install [opts]
(build opts)
(install opts))
(defn deploy [opts]
(bb/deploy (merge default-options opts)))