-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
config.clj
64 lines (49 loc) · 1.13 KB
/
config.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(ns shadow.build.config
(:require [clojure.spec.alpha :as s]))
(s/def ::build-id keyword?)
(s/def ::target
#(or (simple-keyword? %)
(symbol? %)))
(s/def ::build-hook
(s/cat
:hook-sym qualified-symbol?
:hook-args (s/* any?)
))
(s/def ::build-hooks
(s/coll-of ::build-hook :kind vector?))
(defmulti target-spec :target :default ::default)
(defmethod target-spec ::default [_]
(s/spec any?))
(s/def ::build
(s/keys
:req-un
[::build-id
::target]
:opt-un
[::build-hooks]))
(s/def ::build+target
(s/and
::build
(s/multi-spec target-spec :target)))
;; deps.cljs specs
(s/def ::file-min string?)
(s/def ::file string?)
;; probably vector or set, doesn't matter
(s/def ::externs (s/coll-of string? :distinct true))
(s/def ::provides (s/coll-of string? :distinct true))
(s/def ::requires (s/coll-of string? :distinct true))
(s/def ::foreign-lib
(s/keys
:opt-un
[::file-min
::file
::externs
::provides
::requires]))
(s/def ::foreign-libs
(s/coll-of ::foreign-lib :distinct true))
(s/def ::deps-cljs
(s/keys
:opt-un
[::externs
::foreign-libs]))