-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.boot
141 lines (127 loc) · 4.83 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
;; Copyright © 2016 Dynamic Object Language Labs Inc.
;;
;; This software is licensed under the terms of the
;; Apache License, Version 2.0 which can be found in
;; the file LICENSE at the root of this distribution.
;; Acknowledgement and Disclaimer:
;; This material is based upon work supported by the Army Contracting
;; and DARPA under contract No. W911NF-15-C-0005.
;; Any opinions, findings and conclusions or recommendations expressed
;; in this material are those of the author(s) and do necessarily reflect the
;; views of the Army Contracting Command and DARPA.
(def project 'dollabs/pamela)
;;Soon: (def version "0.6.4-SNAPSHOT")
(def version "0.6.3")
(def description "Probabalistic Advanced Modeling and Execution Learning Architecture (PAMELA)")
(def project-url "https://github.com/dollabs/pamela")
(def main 'pamela.cli)
(set-env!
:source-paths #{"src" "test/clj"}
:resource-paths #{"resources"}
:dependencies '[[org.clojure/clojure "1.8.0"]
[org.clojure/data.codec "0.1.0"]
[org.clojure/tools.cli "0.3.5"]
[org.clojure/data.json "0.2.6"]
;; logging
[com.taoensso/timbre "4.7.4"]
[org.slf4j/slf4j-api "1.7.21"]
[com.fzakaria/slf4j-timbre "0.3.2"]
[org.clojure/tools.logging "0.3.1"]
;; utilities
[environ "1.1.0"]
[instaparse "1.4.7"]
[avenir "0.2.2"]
[me.raynes/fs "1.4.6"]
[camel-snake-kebab "0.4.0"]
[dollabs/plan-schema "0.3.8"]
;; testing
[adzerk/boot-test "1.1.2" :scope "test"]
[criterium "0.4.4" :scope "test"]
[adzerk/bootlaces "0.2.0" :scope "test"]
])
(require
'[adzerk.boot-test :refer [test]])
(require
'[adzerk.bootlaces :refer [push-snapshot push-release]])
;; (require
;; '[adzerk.bootlaces :refer :all])
;;(def +version+ "0.0-2371-5")
;; (def +version+ "0.6.3-SNAPSHOT")
;; (bootlaces! +version+)
;; (bootlaces! version)
(task-options!
pom {:project project
:version version
:description description
:url project-url
:scm {:url project-url}
:license {"Apache-2.0" "http://opensource.org/licenses/Apache-2.0"}}
aot {:namespace #{main}}
jar {:main main}
push {:ensure-clean false} ;;For clojars deployment
test {:namespaces #{'testing.pamela.cli 'testing.pamela.utils
'testing.pamela.parser 'testing.pamela.unparser
'testing.pamela.tpn 'testing.pamela.htn
'testing.pamela.plan-schema
'testing.pamela.inheritance
}})
(deftask run
"Run the project (build from source)."
[A args ARG [str] "preface each app arg with -A"]
(require [main :as 'app])
(with-post-wrap [_]
(apply (resolve 'app/-main) args)))
;; (deftask build-jar
;; "Build the project locally as an uberjar."
;; [d dir PATH #{str} "the set of directories to write to (target)."]
;; (let [dir (if (seq dir) dir #{"target"})]
;; (comp
;; ;; do not include these files...
;; (sift :include #{#"~$" #"\.xhtml$" #"\.w3c$"} :invert true)
;; (aot)
;; (uber)
;; (jar :file (str (name project) ".jar"))
;; (target :dir dir))))
(deftask local
"Build jar and install to local repo."
[]
(comp
(sift :include #{#"~$"} :invert true) ;; don't include emacs backups
(aot)
(pom)
(jar)
(install)))
;; NOTE: Requires PAMELA_MODE=prod (or unset)
(deftask cli-test
"Run the command line tests."
[]
(let [cmd ["./bin/cli-test"]]
(comp
(build-jar)
(with-post-wrap [_]
(apply dosh cmd))))) ;; will throw exception on non-zero exit
(deftask all-tests
"Run the Clojure and command line tests."
[]
(comp
(cli-test) ;Call build-jar, which recreates target, which deletes target/gen-files.
; we need to preserve target/gen-files
(test)
))
;; For Emacs if you Customize your Cider Boot Parameters to 'cider-boot'
;; then this task will be invoked upon M-x cider-jack-in-clojurescript
;; which is on C-c M-J
;; CIDER will then open two REPL buffers for you, one for CLJS
;; and another for CLJ. FFI:
;; https://cider.readthedocs.io/en/latest/up_and_running/#clojurescript-usage
;; This task is commented out here for users that have not copied
;; a profile.boot file to ~/.boot/ which defines the cider task:
;;
;; (deftask cider-boot
;; "Cider boot params task"
;; []
;; ;; (cider))
;; (comp
;; (cider)
;; (repl :server true)
;; (wait)))