Babashka pod for clj-ant.
Babashka itself can't load org.apache.tools.ant -- Ant relies on
custom classloaders and a great deal of reflection, neither of which
the bb sci runtime supports. The standard answer to that mismatch is
a pod: a separate JVM process that exposes a small RPC surface,
which bb scripts can call as if it were a local namespace.
Run this pod with one of:
clojure -M:pod
java -cp $(clojure -Spath) clj_ant.pod
Then in a bb script:
(require '[babashka.pods :as pods])
(pods/load-pod ["clojure" "-M:pod"])
(require '[clj-ant.tasks :as t]
'[clj-ant.pod :as a])
(a/execute [(t/echo :message "hello from bb")])
The pod protocol is bencode-over-stdio. We implement just enough of it inline -- pods are small enough that pulling in a dependency for bencode would be overkill.
Babashka pod for clj-ant.
Babashka itself can't load `org.apache.tools.ant` -- Ant relies on
custom classloaders and a great deal of reflection, neither of which
the bb sci runtime supports. The standard answer to that mismatch is
a *pod*: a separate JVM process that exposes a small RPC surface,
which bb scripts can call as if it were a local namespace.
Run this pod with one of:
clojure -M:pod
java -cp $(clojure -Spath) clj_ant.pod
Then in a bb script:
(require '[babashka.pods :as pods])
(pods/load-pod ["clojure" "-M:pod"])
(require '[clj-ant.tasks :as t]
'[clj-ant.pod :as a])
(a/execute [(t/echo :message "hello from bb")])
The pod protocol is bencode-over-stdio. We implement just enough of
it inline -- pods are small enough that pulling in a dependency for
bencode would be overkill.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |