-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.clj
70 lines (63 loc) · 2.03 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(ns build
(:require
[clojure.java.shell :as sh]
[clojure.string :as str]
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as deploy]))
(def ^:private version (str/trim (slurp "resources/version")))
(def ^:private lib 'com.github.liquidz/clj-vimhelp)
(def ^:private class-dir "target/classes")
(def ^:private jar-file "target/clj-vimhelp.jar")
(def ^:private uberjar-file "target/clj-vimhelp-standalone.jar")
(def ^:private scm
{:connection "scm:git:git:https://github.com/liquidz/clj-vimhelp.git"
:developerConnection "scm:git:ssh:https://[email protected]/liquidz/clj-vimhelp.git"
:url "https://github.com/liquidz/clj-vimhelp"
:tag version})
(defn pom
[_]
(let [basis (b/create-basis)]
(b/write-pom {:basis basis
:class-dir class-dir
:lib lib
:version version
:src-dirs (:paths basis)
:scm scm})))
(defn jar
[arg]
(let [basis (b/create-basis)]
(pom arg)
(b/copy-dir {:src-dirs (:paths basis)
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file})))
(defn uberjar
[_]
(let [basis (b/create-basis)]
(b/copy-dir {:src-dirs (:paths basis)
:target-dir class-dir})
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uberjar-file
:basis basis
:main 'vimhelp.core})))
(defn install
[arg]
(jar arg)
(deploy/deploy {:artifact jar-file
:installer :local
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}))
(defn tag
[_]
(sh/sh "git" "tag" version)
(sh/sh "git" "push" "origin" version))
(defn deploy
[arg]
(assert (and (System/getenv "CLOJARS_USERNAME")
(System/getenv "CLOJARS_PASSWORD")))
(jar arg)
(deploy/deploy {:artifact jar-file
:installer :remote
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}))