[#389] csv feature flag
This commit is contained in:
parent
823866e000
commit
e565890f1d
6 changed files with 26 additions and 8 deletions
|
|
@ -17,7 +17,6 @@
|
|||
[borkdude/graal.locking "0.0.2"]
|
||||
[borkdude/sci.impl.reflector "0.0.1"]
|
||||
[org.clojure/tools.cli "1.0.194"]
|
||||
[org.clojure/data.csv "1.0.0"]
|
||||
[cheshire "5.10.0"]
|
||||
[fipp "0.6.22"]
|
||||
[com.cognitect/transit-clj "1.0.324"]]
|
||||
|
|
@ -31,11 +30,14 @@
|
|||
:feature/hsqldb [:feature/jdbc {:dependencies [[org.hsqldb/hsqldb "2.4.0"]]}]
|
||||
:feature/core-async {:source-paths ["feature-core-async"]
|
||||
:dependencies [[org.clojure/core.async "1.1.587"]]}
|
||||
:feature/csv {:source-paths ["feature-csv"]
|
||||
:dependencies [[org.clojure/data.csv "1.0.0"]]}
|
||||
:test [:feature/xml
|
||||
:feature/yaml
|
||||
:feature/postgresql
|
||||
:feature/hsqldb
|
||||
:feature/core-async
|
||||
:feature/csv
|
||||
{:dependencies [[clj-commons/conch "0.9.2"]
|
||||
[com.clojure-goes-fast/clj-async-profiler "0.4.1"]]}]
|
||||
:uberjar {:global-vars {*assert* false}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ else
|
|||
BABASHKA_LEIN_PROFILES+=",-feature/core-async"
|
||||
fi
|
||||
|
||||
if [ "$BABASHKA_FEATURE_CSV" != "false" ]
|
||||
then
|
||||
BABASHKA_LEIN_PROFILES+=",+feature/csv"
|
||||
else
|
||||
BABASHKA_LEIN_PROFILES+=",-feature/csv"
|
||||
fi
|
||||
|
||||
if [ -z "$BABASHKA_JAR" ]; then
|
||||
lein with-profiles "$BABASHKA_LEIN_PROFILES,+reflection,-uberjar" do run
|
||||
lein with-profiles "$BABASHKA_LEIN_PROFILES" do clean, uberjar
|
||||
|
|
|
|||
|
|
@ -41,9 +41,15 @@ if not "%BABASHKA_FEATURE_YAML%"=="false" (
|
|||
)
|
||||
|
||||
if not "%BABASHKA_FEATURE_CORE_ASYNC%"=="false" (
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/core-async
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/core-async
|
||||
) else (
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/core-async
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/core-async
|
||||
)
|
||||
|
||||
if not "%BABASHKA_FEATURE_CSV%"=="false" (
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/csv
|
||||
) else (
|
||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/csv
|
||||
)
|
||||
|
||||
call lein with-profiles %BABASHKA_LEIN_PROFILES% bb "(+ 1 2 3)"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
(def yaml? (not= "false" (System/getenv "BABASHKA_FEATURE_YAML")))
|
||||
(def xml? (not= "false" (System/getenv "BABASHKA_FEATURE_XML")))
|
||||
(def core-async? (not= "false" (System/getenv "BABASHKA_FEATURE_CORE_ASYNC")))
|
||||
(def csv? (not= "false" (System/getenv "BABASHKA_FEATURE_CSV")))
|
||||
|
||||
;; excluded by default
|
||||
(def jdbc? (= "true" (System/getenv "BABASHKA_FEATURE_JDBC")))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
[babashka.impl.clojure.pprint :refer [pprint-namespace]]
|
||||
[babashka.impl.clojure.stacktrace :refer [stacktrace-namespace]]
|
||||
[babashka.impl.common :as common]
|
||||
[babashka.impl.csv :as csv]
|
||||
[babashka.impl.curl :refer [curl-namespace]]
|
||||
[babashka.impl.features :as features]
|
||||
[babashka.impl.nrepl-server :as nrepl-server]
|
||||
|
|
@ -66,6 +65,9 @@
|
|||
(when features/core-async?
|
||||
(require '[babashka.impl.async]))
|
||||
|
||||
(when features/csv?
|
||||
(require '[babashka.impl.csv]))
|
||||
|
||||
(binding [*unrestricted* true]
|
||||
(sci/alter-var-root sci/in (constantly *in*))
|
||||
(sci/alter-var-root sci/out (constantly *out*))
|
||||
|
|
@ -279,7 +281,6 @@ Everything after that is bound to *command-line-args*."))
|
|||
signal babashka.signal
|
||||
shell clojure.java.shell
|
||||
io clojure.java.io
|
||||
csv clojure.data.csv
|
||||
json cheshire.core
|
||||
curl babashka.curl
|
||||
transit cognitect.transit
|
||||
|
|
@ -287,7 +288,8 @@ Everything after that is bound to *command-line-args*."))
|
|||
features/xml? (assoc 'xml 'clojure.data.xml)
|
||||
features/yaml? (assoc 'yaml 'clj-yaml.core)
|
||||
features/jdbc? (assoc 'jdbc 'next.jdbc)
|
||||
features/core-async? (assoc 'async 'clojure.core.async)))
|
||||
features/core-async? (assoc 'async 'clojure.core.async)
|
||||
features/csv? (assoc 'csv 'clojure.data.csv)))
|
||||
|
||||
(def cp-state (atom nil))
|
||||
|
||||
|
|
@ -309,7 +311,6 @@ Everything after that is bound to *command-line-args*."))
|
|||
'wait-for-path wait/wait-for-path}
|
||||
;;'babashka.signal {'pipe-signal-received? pipe-signal-received?}
|
||||
'clojure.java.io io-namespace
|
||||
'clojure.data.csv csv/csv-namespace
|
||||
'cheshire.core cheshire-core-namespace
|
||||
'clojure.stacktrace stacktrace-namespace
|
||||
'clojure.main {'demunge demunge
|
||||
|
|
@ -325,7 +326,8 @@ Everything after that is bound to *command-line-args*."))
|
|||
features/jdbc? (assoc 'next.jdbc @(resolve 'babashka.impl.jdbc/njdbc-namespace)
|
||||
'next.jdbc.sql @(resolve 'babashka.impl.jdbc/next-sql-namespace))
|
||||
features/core-async? (assoc 'clojure.core.async @(resolve 'babashka.impl.async/async-namespace)
|
||||
'clojure.core.async.impl.protocols @(resolve 'babashka.impl.async/async-protocols-namespace))))
|
||||
'clojure.core.async.impl.protocols @(resolve 'babashka.impl.async/async-protocols-namespace))
|
||||
features/csv? (assoc 'clojure.data.csv @(resolve 'babashka.impl.csv/csv-namespace))))
|
||||
|
||||
(def bindings
|
||||
{'java.lang.System/exit exit ;; override exit, so we have more control
|
||||
|
|
|
|||
Loading…
Reference in a new issue