make core.async and rewrite-clj integral (#1014)

* make core.async integral (not a feature)

tasks (in particular, parallel tasks) require core.async

* make rewrite_clj integral (not a feature)

* cleanup mistakes
This commit is contained in:
Bob 2021-09-23 12:15:01 -04:00 committed by GitHub
parent 7cb972fdec
commit 7df81f1273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 27 additions and 79 deletions

View file

@ -20,7 +20,6 @@ ENV BABASHKA_XMX=$BABASHKA_XMX
# by setting them at build time via `docker build --build-arg ARG_NAME=true ...`
ARG BABASHKA_LEAN=
ARG BABASHKA_MUSL=
ARG BABASHKA_FEATURE_CORE_ASYNC=
ARG BABASHKA_FEATURE_CSV=
ARG BABASHKA_FEATURE_JAVA_NET_HTTP=
ARG BABASHKA_FEATURE_JAVA_NIO=
@ -38,7 +37,6 @@ ARG BABASHKA_FEATURE_DATASCRIPT=
ARG BABASHKA_FEATURE_LANTERNA=
ARG BABASHKA_STATIC=
ENV BABASHKA_LEAN=$BABASHKA_LEAN
ENV BABASHKA_FEATURE_CORE_ASYNC=$BABASHKA_FEATURE_CORE_ASYNC
ENV BABASHKA_FEATURE_CSV=$BABASHKA_FEATURE_CSV
ENV BABASHKA_FEATURE_JAVA_NET_HTTP=$BABASHKA_FEATURE_JAVA_NET_HTTP
ENV BABASHKA_FEATURE_JAVA_NIO=$BABASHKA_FEATURE_JAVA_NIO

View file

@ -1,4 +1,4 @@
{:paths ["src" "feature-xml" "feature-core-async"
{:paths ["src" "feature-xml"
"feature-yaml" "feature-csv" "feature-transit"
"feature-java-time" "feature-java-nio"
"feature-httpkit-client" "feature-httpkit-server"
@ -7,7 +7,6 @@
"feature-hiccup"
"feature-test-check"
"feature-spec-alpha"
"feature-rewrite-clj"
"feature-selmer"
"feature-logging"
"pods/src"
@ -56,7 +55,7 @@
{:git/url "https://github.com/babashka/clj-http-lite"
:sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}
borkdude/spartan.spec {:git/url "https://github.com/borkdude/spartan.spec"
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
lambdaisland/regal {:git/url "https://github.com/lambdaisland/regal"
:sha "f902d2c43121f9e1c48603d6eb99f5900eb6a9f6"}
weavejester/medley {:git/url "https://github.com/weavejester/medley"
@ -91,9 +90,9 @@
clj-commons/multigrep {:mvn/version "0.5.0"}
amperity/vault-clj {:mvn/version "1.0.4"}
java-http-clj/java-http-clj {:mvn/version "0.4.3"}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil
org.clojure/core.specs.alpha nil}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil
org.clojure/core.specs.alpha nil}}
:clj-nvd
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}

View file

@ -93,7 +93,6 @@ Babashka supports the following feature flags:
| Name | Description | Default |
|--------|----------------------------------------------|----------|
| `BABASHKA_FEATURE_CORE_ASYNC` | Includes the [clojure.core.async](https://github.com/clojure/core.async) library | `true` |
| `BABASHKA_FEATURE_CSV` | Includes the [clojure.data.csv](https://github.com/clojure/data.csv) library | `true` |
| `BABASHKA_FEATURE_JAVA_NET_HTTP` | Includes commonly used classes from the `java.net.http` package | `true` |
| `BABASHKA_FEATURE_JAVA_NIO` | Includes commonly used classes from the `java.nio` package | `true` |

View file

@ -23,8 +23,10 @@
[cheshire "5.10.1"]
[nrepl/bencode "1.1.0"]
[borkdude/sci.impl.reflector "0.0.1"]
[org.clojure/core.async "1.3.618"]
[org.clojure/test.check "1.1.0"]
[com.github.clj-easy/graal-build-time "0.1.0"]]
[com.github.clj-easy/graal-build-time "0.1.0"]
[rewrite-clj/rewrite-clj "1.0.644-alpha"]]
:profiles {:feature/xml {:source-paths ["feature-xml"]
:dependencies [[org.clojure/data.xml "0.2.0-alpha6"]]}
:feature/yaml {:source-paths ["feature-yaml"]
@ -35,8 +37,6 @@
;:feature/oracledb [:feature/jdbc {:dependencies [[com.oracle.database.jdbc/ojdbc8 "19.8.0.0"]]}]
:feature/oracledb [:feature/jdbc {:dependencies [[io.helidon.integrations.db/ojdbc "2.1.0"]]}] ; ojdbc10 + GraalVM config, by Oracle
:feature/hsqldb [:feature/jdbc {:dependencies [[org.hsqldb/hsqldb "2.5.1"]]}]
:feature/core-async {:source-paths ["feature-core-async"]
:dependencies [[org.clojure/core.async "1.3.618"]]}
:feature/csv {:source-paths ["feature-csv"]
:dependencies [[org.clojure/data.csv "1.0.0"]]}
:feature/transit {:source-paths ["feature-transit"]
@ -55,8 +55,6 @@
:dependencies [[hiccup/hiccup "2.0.0-alpha2"]]}
:feature/test-check {:source-paths ["feature-test-check"]}
:feature/spec-alpha {:source-paths ["feature-spec-alpha"]}
:feature/rewrite-clj {:source-paths ["feature-rewrite-clj"]
:dependencies [[rewrite-clj/rewrite-clj "1.0.644-alpha"]]}
:feature/selmer {:source-paths ["feature-selmer"]
:dependencies [[selmer/selmer "1.12.44"]]}
:feature/logging {:source-paths ["feature-logging"]
@ -67,7 +65,6 @@
:feature/yaml
:feature/postgresql
:feature/hsqldb
:feature/core-async
:feature/csv
:feature/transit
:feature/datascript
@ -77,7 +74,6 @@
:feature/hiccup
:feature/test-check
:feature/spec-alpha
:feature/rewrite-clj
:feature/selmer
:feature/logging
{:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.5.0"]

View file

@ -1,4 +1,4 @@
{:paths ["src" "feature-xml" "feature-core-async"
{:paths ["src" "feature-xml"
"feature-yaml" "feature-csv" "feature-transit"
"feature-java-time" "feature-java-nio"
"feature-httpkit-client" "feature-httpkit-server"
@ -7,7 +7,6 @@
"feature-hiccup"
"feature-test-check"
"feature-spec-alpha"
"feature-rewrite-clj"
"feature-selmer"
"feature-logging"
"pods/src"
@ -56,7 +55,7 @@
{:git/url "https://github.com/babashka/clj-http-lite"
:sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}
borkdude/spartan.spec {:git/url "https://github.com/borkdude/spartan.spec"
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
lambdaisland/regal {:git/url "https://github.com/lambdaisland/regal"
:sha "f902d2c43121f9e1c48603d6eb99f5900eb6a9f6"}
weavejester/medley {:git/url "https://github.com/weavejester/medley"
@ -91,9 +90,9 @@
clj-commons/multigrep {:mvn/version "0.5.0"}
amperity/vault-clj {:mvn/version "1.0.4"}
java-http-clj/java-http-clj {:mvn/version "0.4.3"}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil
org.clojure/core.specs.alpha nil}}
:classpath-overrides {org.clojure/clojure nil
org.clojure/spec.alpha nil
org.clojure/core.specs.alpha nil}}
:clj-nvd
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}

View file

@ -85,7 +85,6 @@ then
# Remove all the default features, unless explicitly set to true:
export BABASHKA_FEATURE_XML="${BABASHKA_FEATURE_XML:-false}"
export BABASHKA_FEATURE_YAML="${BABASHKA_FEATURE_YAML:-false}"
export BABASHKA_FEATURE_CORE_ASYNC="${BABASHKA_FEATURE_CORE_ASYNC:-false}"
export BABASHKA_FEATURE_CSV="${BABASHKA_FEATURE_CSV:-false}"
export BABAHSKA_FEATURE_TRANSIT="${BABAHSKA_FEATURE_TRANSIT:-false}"
export BABASHKA_FEATURE_JAVA_TIME="${BABASHKA_FEATURE_JAVA_TIME:-false}"
@ -97,7 +96,6 @@ then
export BABASHKA_FEATURE_HICCUP="${BABASHKA_FEATURE_HICCUP:-false}"
export BABASHKA_FEATURE_TEST_CHECK="${BABASHKA_FEATURE_TEST_CHECK:-false}"
export BABASHKA_FEATURE_SPEC_ALPHA="${BABASHKA_FEATURE_SPEC_ALPHA:-false}"
export BABASHKA_FEATURE_REWRITE_CLJ="${BABASHKA_FEATURE_REWRITE_CLJ:-false}"
export BABASHKA_FEATURE_SELMER="${BABASHKA_FEATURE_SELMER:-false}"
export BABASHKA_FEATURE_LOGGING="${BABASHKA_FEATURE_LOGGING:-false}"
fi

View file

@ -70,13 +70,6 @@ else
BABASHKA_LEIN_PROFILES+=",-feature/yaml"
fi
if [ "$BABASHKA_FEATURE_CORE_ASYNC" != "false" ]
then
BABASHKA_LEIN_PROFILES+=",+feature/core-async"
else
BABASHKA_LEIN_PROFILES+=",-feature/core-async"
fi
if [ "$BABASHKA_FEATURE_CSV" != "false" ]
then
BABASHKA_LEIN_PROFILES+=",+feature/csv"
@ -147,13 +140,6 @@ else
BABASHKA_LEIN_PROFILES+=",-feature/spec-alpha"
fi
if [ "$BABASHKA_FEATURE_REWRITE_CLJ" != "false" ]
then
BABASHKA_LEIN_PROFILES+=",+feature/rewrite-clj"
else
BABASHKA_LEIN_PROFILES+=",-feature/rewrite-clj"
fi
if [ "$BABASHKA_FEATURE_SELMER" != "false" ]
then
BABASHKA_LEIN_PROFILES+=",+feature/selmer"

View file

@ -46,12 +46,6 @@ if not "%BABASHKA_FEATURE_YAML%"=="false" (
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/yaml
)
if not "%BABASHKA_FEATURE_CORE_ASYNC%"=="false" (
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/core-async
) else (
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 (
@ -112,12 +106,6 @@ set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/spec-alpha
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/spec-alpha
)
if not "%BABASHKA_FEATURE_REWRITE_CLJ%"=="false" (
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/rewrite-clj
) else (
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/rewrite-clj
)
if not "%BABASHKA_FEATURE_SELMER%"=="false" (
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/selmer
) else (

View file

@ -1,4 +1,4 @@
(ns babashka.impl.async
(ns babashka.impl.clojure.core.async
{:no-doc true}
(:require [clojure.core.async :as async]
[clojure.core.async.impl.protocols :as protocols]

View file

@ -4,7 +4,6 @@
;; included by default
(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")))
(def transit? (not= "false" (System/getenv "BABASHKA_FEATURE_TRANSIT")))
(def java-time? (not= "false" (System/getenv "BABASHKA_FEATURE_JAVA_TIME")))
@ -15,7 +14,6 @@
(def core-match? (not= "false" (System/getenv "BABASHKA_FEATURE_CORE_MATCH")))
(def hiccup? (not= "false" (System/getenv "BABASHKA_FEATURE_HICCUP")))
(def test-check? (not= "false" (System/getenv "BABASHKA_FEATURE_TEST_CHECK")))
(def rewrite-clj? (not= "false" (System/getenv "BABASHKA_FEATURE_REWRITE_CLJ")))
(def selmer? (not= "false" (System/getenv "BABASHKA_FEATURE_SELMER")))
(def logging? (not= "false" (System/getenv "BABASHKA_FEATURE_LOGGING")))
@ -38,9 +36,6 @@
(when jdbc?
(require '[babashka.impl.jdbc]))
(when core-async?
(require '[babashka.impl.async]))
(when csv?
(require '[babashka.impl.csv]))
@ -71,9 +66,6 @@
(when spec-alpha?
(require '[babashka.impl.spec]))
(when rewrite-clj?
(require '[babashka.impl.rewrite-clj]))
(when selmer?
(require '[babashka.impl.selmer]))

View file

@ -9,6 +9,7 @@
[babashka.impl.classes :as classes]
[babashka.impl.classpath :as cp :refer [classpath-namespace]]
[babashka.impl.clojure.core :as core :refer [core-extras]]
[babashka.impl.clojure.core.async :refer [async-namespace async-protocols-namespace]]
[babashka.impl.clojure.java.browse :refer [browse-namespace]]
[babashka.impl.clojure.java.io :refer [io-namespace]]
[babashka.impl.clojure.java.shell :refer [shell-namespace]]
@ -31,6 +32,7 @@
[babashka.impl.proxy :refer [proxy-fn]]
[babashka.impl.reify :refer [reify-fn]]
[babashka.impl.repl :as repl]
[babashka.impl.rewrite-clj :as rewrite]
[babashka.impl.server :refer [clojure-core-server-namespace]]
[babashka.impl.socket-repl :as socket-repl]
[babashka.impl.tasks :as tasks :refer [tasks-namespace]]
@ -225,7 +227,6 @@ Use bb run --help to show this help output.
(format
(str/trim "
{:babashka/version \"%s\"
:feature/core-async %s
:feature/csv %s
:feature/java-nio %s
:feature/java-time %s
@ -241,11 +242,9 @@ Use bb run --help to show this help output.
:feature/hiccup %s
:feature/test-check %s
:feature/spec-alpha %s
:feature/rewrite-clj %s
:feature/selmer %s
:feature/logging %s}")
version
features/core-async?
features/csv?
features/java-nio?
features/java-time?
@ -261,7 +260,6 @@ Use bb run --help to show this help output.
features/hiccup?
features/test-check?
features/spec-alpha?
features/rewrite-clj?
features/selmer?
features/logging?)))
@ -308,11 +306,11 @@ Use bb run --help to show this help output.
curl babashka.curl
fs babashka.fs
bencode bencode.core
deps babashka.deps}
deps babashka.deps
async clojure.core.async}
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/csv? (assoc 'csv 'clojure.data.csv)
features/transit? (assoc 'transit 'cognitect.transit)))
@ -357,14 +355,19 @@ Use bb run --help to show this help output.
'babashka.process process-namespace
'clojure.core.server clojure-core-server-namespace
'babashka.deps deps-namespace
'babashka.tasks tasks-namespace}
'babashka.tasks tasks-namespace
'clojure.core.async async-namespace
'clojure.core.async.impl.protocols async-protocols-namespace
'rewrite-clj.node rewrite/node-namespace
'rewrite-clj.paredit rewrite/paredit-namespace
'rewrite-clj.parser rewrite/parser-namespace
'rewrite-clj.zip rewrite/zip-namespace
'rewrite-clj.zip.subedit rewrite/subedit-namespace}
features/xml? (assoc 'clojure.data.xml @(resolve 'babashka.impl.xml/xml-namespace))
features/yaml? (assoc 'clj-yaml.core @(resolve 'babashka.impl.yaml/yaml-namespace)
'flatland.ordered.map @(resolve 'babashka.impl.ordered/ordered-map-ns))
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))
features/csv? (assoc 'clojure.data.csv @(resolve 'babashka.impl.csv/csv-namespace))
features/transit? (assoc 'cognitect.transit @(resolve 'babashka.impl.transit/transit-namespace))
features/datascript? (assoc 'datascript.core @(resolve 'babashka.impl.datascript/datascript-namespace))
@ -394,16 +397,6 @@ Use bb run --help to show this help output.
'clojure.spec.alpha @(resolve 'babashka.impl.spec/spec-namespace)
'clojure.spec.gen.alpha @(resolve 'babashka.impl.spec/gen-namespace)
'clojure.spec.test.alpha @(resolve 'babashka.impl.spec/test-namespace)))
features/rewrite-clj? (assoc 'rewrite-clj.node
@(resolve 'babashka.impl.rewrite-clj/node-namespace)
'rewrite-clj.paredit
@(resolve 'babashka.impl.rewrite-clj/paredit-namespace)
'rewrite-clj.parser
@(resolve 'babashka.impl.rewrite-clj/parser-namespace)
'rewrite-clj.zip
@(resolve 'babashka.impl.rewrite-clj/zip-namespace)
'rewrite-clj.zip.subedit
@(resolve 'babashka.impl.rewrite-clj/subedit-namespace))
features/selmer? (assoc 'selmer.parser
@(resolve 'babashka.impl.selmer/selmer-parser-namespace)
'selmer.tags

View file

@ -240,7 +240,7 @@
(deftest process-builder-test
(let [cmd-line (if main/windows?
"[\"cmd\" \"/c\" \"dir\" ]"
"[\"cmd\" \"/c\" \"dir\"]"
"[\"ls\"]")]
(is (str/includes? (bb nil (str "
(def pb (ProcessBuilder. " cmd-line "))