-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.clj
85 lines (73 loc) · 2.65 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
74
75
76
77
78
79
80
81
82
83
84
85
(ns build
(:require [clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]
[clojure.pprint :as pprint]))
(def lib 'org.clojars.jekyllislandtours/conceptual)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(def clj-src-dirs ["src/clj"])
(def java-src-dirs ["src/java"])
(def basis (delay (b/create-basis {:project "deps.edn"})))
(defn show-defaults [_]
(println "default-basis:")
(pprint/pprint @basis)
(println "target:" "target")
(println "class-dir:" class-dir)
(println "jar-file:" jar-file))
(defn clean [_]
(b/delete {:path "target"}))
(defn compile-java [_]
(println "Compiling java...")
(b/javac {:src-dirs java-src-dirs
:class-dir class-dir
:basis @basis
:javac-opts ["--release" "11"
"-Xlint:deprecation" "-Xlint:unchecked"
"-proc:none"]}))
(defn compile-clj [_]
(println "Compiling clj...")
(b/compile-clj {:src-dirs clj-src-dirs
:class-dir class-dir
:basis @basis}))
(defn- pom-template [version]
[[:description "Conceptual is a fast JVM based in-memory concept database that can be used as a feature store, graph database, and more."]
[:url "https://github.com/jekyllislandtours/conceptual"]
[:licenses
[:license
[:name "MIT License"]
[:url "https://opensource.org/license/mit/"]]]
[:developers
[:developer
[:name "Scott Jappinen"]]]
[:scm
[:url "https://github.com/jekyllislandtours/conceptual"]
[:connection "scm:git:https://github.com/jekyllislandtours/conceptual.git"]
[:developerConnection "scm:git:ssh:[email protected]:jekyllislandtours/conceptual.git"]
[:tag (str "v" version)]]])
(defn jar [_]
(clean nil)
(compile-java nil)
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis @basis
:src-dirs clj-src-dirs
:pom-data (pom-template version)})
(b/copy-dir {:src-dirs (conj clj-src-dirs "resources")
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))
(defn install [_]
(jar nil)
(println "Installing jar into local Maven repo cache...")
(b/install {:lib lib
:version version
:basis @basis
:class-dir class-dir
:jar-file jar-file}))
(defn deploy [_]
(dd/deploy {:installer :remote
:artifact (b/resolve-path jar-file)
:pom-file (b/pom-path {:lib lib
:class-dir class-dir})}))