-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.clj
More file actions
21 lines (20 loc) · 810 Bytes
/
build.clj
File metadata and controls
21 lines (20 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.build.api :as b]
[clojure.java.io :as io]))
(defn copy-deps [{:keys [target-dir]}]
(assert target-dir)
(let [basis (b/create-basis {})
lib-map (:libs basis)
target-dir (doto (io/file target-dir)
.mkdirs)
total-size (volatile! 0)]
(doseq [[lib {:keys [paths]}] lib-map]
(let [jar-path (first paths)
jar-file (io/file jar-path)
target-file (io/file target-dir (.getName jar-file))
size (.length jar-file)]
(println (format "Writing %s (%,d b)" target-file size))
(io/copy jar-file target-file)
(vswap! total-size + size)))
(println (format "---\nWritten %d files (%,d b)" (count lib-map) @total-size))))