forked from useshortcut/qslice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
73 lines (63 loc) · 2.24 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
71
72
73
(ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd])
(:import (java.time ZoneOffset ZonedDateTime)
(java.time.format DateTimeFormatter)))
(def lib 'net.clojars.favila/qslice)
(def version (format "1.0.%s" (b/git-count-revs nil)))
(def tag (str "v" version))
(def basis (delay (b/create-basis {})))
(def github-path "/favila/qslice")
(def github-url (str "https://github.com" github-path))
(def jar-opts
(delay
;; pom opts
{:lib lib
:version version
:basis @basis
:scm {:tag tag
:url github-url
:connection (str "scm:git:" github-url ".git")
:developerConnection (str "scm:git:ssh://[email protected]" github-path ".git")}
:pom-data [[:description "Represent partial Datomic datalog queries with their bindings and combine them safely."]
[:url github-url]
[:licenses
[:license
[:name "MIT License"]
[:url "https://opensource.org/license/mit"]]]
[:developers
[:developer
[:name "Francis Avila"]]]]
;; copy-dir and jar opts
:src-dirs ["src"]
:target-dir "target/classes"
:class-dir "target/classes"
:jar-file (format "target/%s-%s.jar" (name lib) version)}))
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(clean nil)
(let [opts @jar-opts]
(b/write-pom opts)
(b/copy-dir opts)
(b/jar opts)))
(defn- today-YMD []
(-> (ZonedDateTime/now ZoneOffset/UTC)
(.format DateTimeFormatter/ISO_LOCAL_DATE)))
(defn changelog-header
[_]
(println (format "### [%s] - %s" tag (today-YMD)))
(println (format "[%s]: %s/compare/%s...%s" tag github-url "FIXME" tag)))
(defn git-tag
[_]
(println (format "git tag -a '%s' -m '%s'" tag tag)))
(defn deploy
[_]
(clean nil)
(jar nil)
(let [{:keys [jar-file] :as opts} @jar-opts]
(dd/deploy {:installer :remote
:artifact (b/resolve-path jar-file)
:pom-file (b/pom-path (select-keys opts [:lib :class-dir]))}))
(git-tag nil))