-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
33 lines (28 loc) · 983 Bytes
/
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
(ns build
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def lib 'com.example.grpc/grpc-example)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(defn clean [_]
(b/delete {:path "target"}))
(defn compile-java [_]
(b/javac {:src-dirs ["java/src"]
:class-dir class-dir
:basis basis
:javac-opts ["-source" "11" "-target" "11"]}))
(defn jar [_]
(compile-java nil)
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["clojure/src"]})
(b/copy-dir {:src-dirs ["clojure/src"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))
(defn print-version [_]
(println version))