-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.clj
More file actions
45 lines (40 loc) · 1.73 KB
/
Copy pathbuild.clj
File metadata and controls
45 lines (40 loc) · 1.73 KB
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
(ns build
"Build the library jar and its pom via the official `tools.build`.
The pom's <dependencies> are derived from the project basis (deps.edn :deps),
so it declares only org.clojure/clojure + org.clojure/data.json — the build
and deploy tooling in the aliases never leaks into a consumer's tree.
clojure -T:build jar ;; -> target/unirate-api-0.1.0.jar (+ pom)
clojure -T:build clean"
(:require [clojure.tools.build.api :as b]))
(def lib 'com.unirateapi/unirate-api)
(def version "0.1.0")
(def class-dir "target/classes")
(def basis (delay (b/create-basis {:project "deps.edn"})))
(def jar-file (format "target/unirate-api-%s.jar" version))
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(clean nil)
(b/write-pom
{:class-dir class-dir
:lib lib
:version version
:basis @basis
:src-dirs ["src"]
:scm {:url "https://github.com/UniRate-API/unirate-api-clojure"
:connection "scm:git:git://github.com/UniRate-API/unirate-api-clojure.git"
:developerConnection "scm:git:ssh://git@github.com/UniRate-API/unirate-api-clojure.git"
:tag (str "v" version)}
:pom-data [[:description
"Official Clojure client for the UniRate API — free currency exchange rates, historical data, and VAT rates."]
[:url "https://github.com/UniRate-API/unirate-api-clojure"]
[:licenses
[:license
[:name "MIT"]
[:url "https://opensource.org/licenses/MIT"]]]
[:developers
[:developer
[:name "Unirate Team"]]]]})
(b/copy-dir {:src-dirs ["src"] :target-dir class-dir})
(b/jar {:class-dir class-dir :jar-file jar-file})
(println "Built" jar-file))