-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.clj
59 lines (53 loc) · 1.84 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
(ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'com.janetacarr/masala)
(def version "0.1.0")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" lib version))
(defn clean [_]
(b/delete {:path "target"}))
(defn- pom-template [version]
[[:description "Currying in Clojure for fun and learning."]
[:url "https://github.com/janetacarr/masala"]
[:licenses
[:license
[:name "APACHE LICENSE, VERSION 2.0"]
[:url "https://www.apache.org/licenses/LICENSE-2.0"]]]
[:developers
[:developer
[:name "Janet A. Carr"]]]
[:scm
[:url "https://github.com/janetacarr/masala"]
[:connection "scm:git:https://github.com/janetacarr/masala.git"]
[:developerConnection "scm:git:ssh://git@github.com/janetacarr/masala.git"]
[:tag version]]])
(defn jar [_]
(clean nil)
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src"]
:pom-data (pom-template version)})
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))
(defn install [_]
(jar {})
(b/install {:class-dir class-dir
:lib lib
:version version
:basis basis
:jar-file jar-file}))
(defn deploy
[{:keys [repository] :as opts}]
(let [dd-deploy (try (requiring-resolve 'deps-deploy.deps-deploy/deploy) (catch Throwable _))]
(if dd-deploy
(dd-deploy {:installer :remote
:artifact (b/resolve-path jar-file)
:repository (or (str repository) "clojars")
:pom-file (b/pom-path {:lib lib
:class-dir class-dir})})
(println "borked"))))