-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
59 lines (53 loc) · 1.38 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
(ns build
(:require
[clojure.tools.build.api :as b]
[publicize.core :as p]))
;
(def lib 'land.bnert/virtual)
(def version "0.1.0")
; -- build stuff
(def basis
(p/clean-clojure-dep
(b/create-basis {:project "deps.edn"})))
(def class-dir "target/classes")
(def target-dir "target")
(def jar-path (format (str target-dir "/%s-%s.jar") (name lib) version))
(def pom-path (b/pom-path {:lib lib :class-dir class-dir}))
(def pom-data
[[:licenses
[:license
[:name "Eclipse Public License version 2.0"]
[:url "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt"]
[:distribution "repo"]]]])
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(clean nil)
(println "Writing pom...")
(b/write-pom
{:basis basis
:class-dir class-dir
:lib lib
:pom-data pom-data
:src-dirs (get basis :paths ["src"])
:scm {:url "https://github.com/bnert-land/virtual"}
:version version})
(println "Done...")
(println "Copying src...")
(b/copy-dir
{:src-dirs (get basis :paths ["src"])
:target-dir class-dir})
(println "Building jar...")
(b/jar
{:class-dir class-dir
:jar-file jar-path})
(println "Done."))
(defn publicize [_]
(jar nil)
(println "Publicizing...")
(p/publicize
{:jar-file jar-path
:lib lib
:pom-file pom-path
:version version})
(println "Done."))