-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb.edn
50 lines (50 loc) · 2.85 KB
/
bb.edn
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
{:min-bb-version "0.4.0"
:paths ["script"]
:deps {cli-matic/cli-matic {:mvn/version "0.4.3"}
nrepl/nrepl {:mvn/version "0.8.3"}}
:tasks {:requires ([nrepl-client :as repl]
[clojure.string :as str]
[clojure.tools.cli :refer [parse-opts]])
:init (do (def platform-alias
(case (System/getProperty "os.name")
"Linux"
"backend/linux"
"Windows"
"backend/windows"
"Mac OS X"
"backend/macosx"))
(defn eshell
"Print command before executing it in shell."
[& args]
(binding [*out* *err*]
(println args))
(apply shell args))
(defn custom-parse-opts
[cli-args cli-opts]
(let [parsed-opts (parse-opts cli-args cli-opts)
{:keys [summary errors]
{:keys [help]} :options} parsed-opts]
;; (println parsed-opts)
(when errors
(println "Allowed options are:\n" summary "\n"
"Error parsing args:\n" errors "\n"
"Parsed options are:\n" parsed-opts "\n")
(System/exit 1))
(when help
(println "Allowed options are:\n" summary "\n")
(System/exit 0))
parsed-opts)))
list-services {:doc "List ofbiz services"
:task (let [q (repl/ofbiz
"localhost" 7888
(repl/string-it (ofbiz-ops/list-services (fn [s] (clojure.string/includes? (.toLowerCase s) "test"))))
999)]
(println (repl/first-response-value q 999)))}
get-model-service {:doc "Get the ModelService of a service"
:task (let [expr-str (repl/string-it (ofbiz-ops/get-model-service "simpleMapListTest"))
q (repl/ofbiz "localhost" 7888 expr-str 999)]
(println (repl/first-response-value q 999)))}
run-service {:doc "Run OFBiz service"
:task (let [expr-str (repl/string-it (ofbiz-ops/run-sync "testScv" {"defaultValue" 123.45 "message" "Hello OFBiz from Clojure REPL"}))
q (repl/ofbiz "localhost" 7888 expr-str 999)]
(println (repl/first-response-value q 999)))}}}