Repository navigation
Expand file tree
/
Copy pathbb.edn
More file actions
79 lines (66 loc) · 3.64 KB
/
Copy pathbb.edn
File metadata and controls
79 lines (66 loc) · 3.64 KB
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
;; Development tasks. Run `bb tasks` for the list.
{:paths ["src" "test" "directives/src" "directives/test"]
:deps {metosin/malli {:mvn/version "0.16.4"}}
:tasks
{:requires ([clojure.string :as string])
test:jvm
{:doc "Run the psosf tests on the JVM (babashka)"
:task (do (require 'clojure.test 'psosf.core-test 'psosf.model-test 'psosf.conformance-test)
(let [{:keys [fail error]} (clojure.test/run-tests 'psosf.core-test 'psosf.model-test 'psosf.conformance-test)]
(when (pos? (+ fail error)) (System/exit 1))))}
test:directives
{:doc "Run the directive parser and schema tests (babashka)"
:task (do (require 'clojure.test 'pebblestream.parse-str-test 'pebblestream.directives.schema-test 'pebblestream.directives.worksheet-rules-test
'pebblestream.directives.parse-test 'pebblestream.directives.check-test
'pebblestream.directives.time-series-test)
(let [{:keys [fail error]} (clojure.test/run-tests 'pebblestream.parse-str-test
'pebblestream.directives.schema-test
'pebblestream.directives.worksheet-rules-test
'pebblestream.directives.parse-test
'pebblestream.directives.check-test
'pebblestream.directives.time-series-test)]
(when (pos? (+ fail error)) (System/exit 1))))}
test:cljs
{:doc "Run the ClojureScript tests with nbb"
:task (shell "npx nbb --classpath src:test test/psosf/js_runner.cljs")}
test:cljs-directives
{:doc "Run the directive check's ClojureScript tests (shadow-cljs and Node)"
:task (shell "npm run test:directives")}
test
{:doc "Run every test suite"
:depends [test:jvm test:directives test:cljs test:cljs-directives]}
conformance:generate
{:doc "Regenerate the conformance cases from conformance/generate.clj"
:task (shell "bb -cp src conformance/generate.clj")}
check
{:doc "Check a PSOSF archive and print a JSON report: bb check FILE.psosf [--allow SUM,IF]"
:task (do (require 'pebblestream.directives.cli)
(System/exit ((resolve 'pebblestream.directives.cli/run) *command-line-args*)))}
version:check
{:doc "Fail if package.json and VERSION disagree"
:task (let [v (string/trim (slurp "VERSION"))
pkg-version (fn [f] (second (re-find (re-pattern "\"version\":\\s*\"([^\"]+)\"") (slurp f))))]
(doseq [f ["package.json" "npm/psosf/package.json" "npm/psosf-directives/package.json"]]
(when-not (= v (pkg-version f))
(println "VERSION is" v "but" f "is" (pkg-version f))
(System/exit 1))))}
jar
{:doc "Build both jars with tools.build (needs the Clojure CLI and a JDK)"
:depends [version:check]
:task (clojure "-T:build jar")}
install
{:doc "Install both jars into the local Maven repository"
:depends [version:check]
:task (clojure "-T:build install")}
npm
{:doc "Build both npm packages with shadow-cljs, into npm/psosf/dist/ and npm/psosf-directives/dist/"
:depends [version:check]
:task (do (shell "npm install")
(shell "npx shadow-cljs release npm directives"))}
build
{:doc "Test everything, then build the jars and the npm package"
:depends [test jar npm]}
clean
{:doc "Remove build output"
:task (do (clojure "-T:build clean")
(shell "rm -rf npm/psosf/dist npm/psosf-directives/dist .shadow-cljs"))}}}