-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.boot
executable file
·70 lines (63 loc) · 2.41 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
#!/usr/bin/env boot
(set-env!
:source-paths #{"src" "test"}
:dependencies '[
[org.clojure/clojure "1.11.1"]
[cheshire "5.11.0"]
[clj-http "3.12.3"]
[de.ubercode.clostache/clostache "1.4.0"]
[org.clojure/tools.cli "0.4.1"]
[semantic-csv "0.2.0"]
[org.clojure/data.csv "1.0.0"]
[org.clojure/data.json "2.4.0"]
[org.clojure/test.check "1.1.0" :scope "test"]
[org.clojure/core.async "1.5.648"]
[adzerk/boot-test "1.2.0" :scope "test"]
[clj-http-fake "1.0.3"]
[slingshot "0.12.2"]
[clj-time "0.15.2"]
])
(require '[adzerk.boot-test :refer :all])
(require '[keboola.facebook.extractor.core])
(deftask run-extractor
"run extractor"
[x args VAL str "arguments string for main- function"]
(if-not args
(do (boot.util/fail "arguments string x is requried. ")
(*usage*)))
(do
(require '[keboola.facebook.extractor.core])
((resolve 'keboola.facebook.extractor.core/-main) args)))
(deftask generate-test
"given data dir with config.json, this task runs extraktor,
record api calls, create snapshot tests with recrded api calls and compare result dirs"
[d data VAL str "name of directory in test/keboola/snapshots containing config.json"
s skip-token bool "skip token anonymization in config.json"]
(if-not data
(do (boot.util/fail "arguments string d is requried. ")
(*usage*)))
(do(require '[keboola.snapshots.core])
((resolve 'keboola.snapshots.core/generate-test) data (not skip-token))))
(deftask regenerate-snapshots [f dirfilter VAL str "regexp to filter dirs to process"]
(require '[keboola.snapshots.core])
((resolve 'keboola.snapshots.core/regenerate-all-snapshot-dirs) dirfilter))
(deftask build
"Builds an uberjar extractor that can be run with java -jar"
[]
(comp
(aot :all true)
(pom :project 'ex-fb-graph-api
:version "1.0")
(uber)
(jar :main 'keboola.facebook.extractor.core)
(target :dir #{"target"})))
(deftask start-docker-repl
"run repl server on 1111 port"
[]
(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
concat '[[cider/cider-nrepl "0.15.1"]])
(swap! boot.repl/*default-middleware*
conj 'cider.nrepl/cider-middleware)
(repl :bind "0.0.0.0" :port 1111)
)