-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.clj
46 lines (38 loc) · 1.52 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
(ns build
(:require [clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))
(def lib 'io.github.nextjournal/markdown)
(defn scm [version]
{:url "https://github.com/nextjournal/markdown"
:tag (str "v" version)
:connection "scm:git:git://github.com/nextjournal/markdown.git"
:developerConnection "scm:git:ssh://[email protected]/nextjournal/markdown.git"})
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(defn jar-file [version] (format "target/%s-%s.jar" (name lib) version))
(defn clean [_] (b/delete {:path "target"}))
(defn jar [{:keys [version]}]
(b/delete {:path "target"})
(println "Producing jar: " (jar-file version))
(b/write-pom {:basis basis
:class-dir class-dir
:lib lib
:scm (scm version)
:src-dirs ["src"]
:version version
:pom-data
[[:licenses
[:license
[:name "ISC License"]
[:url "https://opensource.org/license/isc-license-txt"]]]]})
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir
:replace {}})
(b/jar {:class-dir class-dir
:jar-file (jar-file version)}))
(defn deploy [{:keys [version] :as opts}]
(println "Deploying version" (jar-file version) "to Clojars.")
(jar opts)
(dd/deploy {:installer :remote
:artifact (jar-file version)
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}))