-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
44 lines (35 loc) · 1.37 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
(ns build
(:require [clojure.tools.build.api :as b]))
(def lib 'com.github.brianium/blah)
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def version (:version basis))
(def jar-file (format "target/%s.jar" (name lib)))
(defn clean [_]
(doseq [path ["target" "public" "out"]]
(b/delete {:path path})))
(defn jar [_]
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src"]
:scm {:url "https://github.com/brianium/blah"
:connection "scm:git:git://github.com/brianium/blah.git"
:developerConnection "scm:git:git://github.com/brianium/blah.git"
:tag "HEAD"}})
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file}))
(defn out [_]
(let [cmds (b/java-command
{:basis (b/create-basis {:aliases [:dev] :project "deps.edn"})
:main 'clojure.main
:main-args ["-m" "cljs.main" "--optimizations" "advanced" "-c" "cljs.user"]})]
(b/process cmds)))
(defn demo [_]
(out _)
(b/copy-dir {:src-dirs ["out"]
:target-dir "public/out"})
(b/copy-file {:src "index.html" :target "public/index.html"}))