-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
85 lines (65 loc) · 2.82 KB
/
build.boot
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
(set-env!
:source-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"]
[adzerk/bootlaces "0.1.13" :scope "test"]
[adzerk/boot-test "1.2.0" :scope "test"]
[manenko/boot-download "0.2.0-SNAPSHOT" :scope "test"]
[boot/core "2.7.1" :scope "test"]
[org.apache.commons/commons-compress "1.14"]])
(require '[adzerk.bootlaces :refer :all]
'[boot.core :refer [deftask]]
'[manenko.boot-download :refer [download-file]]
'[manenko.boot-zip :refer [compress-into-zip extract-from-zip]]
'[adzerk.boot-test :as boot-test])
(def +project+ 'manenko/boot-zip)
(def +version+ "0.2.0-SNAPSHOT")
(bootlaces! +version+)
(task-options!
pom {:project +project+
:version +version+
:description "Boot task for (de-)compressing ZIP archives preserving the Unix permissions."
:url "https://github.com/manenko/boot-zip/"
:scm {:url "https://github.com/manenko/boot-zip/"}
:license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}})
(deftask testing
[]
(set-env! :source-paths #(conj % "test"))
identity)
(ns-unmap 'boot.user 'test)
(deftask test
[]
(comp (testing)
(boot-test/test)))
(deftask auto-test
[]
(comp (testing)
(watch)
(speak)
(boot-test/test)))
(deftask test-zip-extraction
[]
(let [root "https://github.com/electron/electron/releases/download"]
(comp
(download-file :url (str root "/v1.7.4/electron-v1.7.4-linux-x64.zip")
:output-file "downloads/electron-v1.7.4-linux-x64.zip")
(extract-from-zip :archive "downloads/electron-v1.7.4-linux-x64.zip"
:output-dir "extracted/electron/v1.7.4/linux-x64")
(target))))
(deftask test-zip-extraction-compression
[]
(let [root "https://github.com/electron/electron/releases/download"]
(comp
(download-file :url (str root "/v1.7.4/electron-v1.7.4-linux-x64.zip")
:output-file "downloads/electron-v1.7.4-linux-x64.zip")
(extract-from-zip :archive "downloads/electron-v1.7.4-linux-x64.zip"
:output-dir "extracted/electron/v1.7.4/linux-x64")
(compress-into-zip :input-dir "extracted/electron/v1.7.4/linux-x64"
:archive "archived/electron-v1.7.4-linux-x64.zip")
(target))))
(deftask test-zip-compression
[]
(set-env! :source-paths #(conj % "test-compression"))
(comp
(compress-into-zip :input-dir "extracted/electron/v1.7.4/linux-x64"
:archive "archived/electron-v1.7.4-linux-x64.zip")
(target)))