This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-12
Channels
- # announcements (2)
- # babashka (26)
- # beginners (48)
- # calva (32)
- # cider (23)
- # clj-kondo (61)
- # cljfx (3)
- # clojure (93)
- # clojure-australia (2)
- # clojure-europe (23)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (4)
- # clojurescript (46)
- # cloverage (9)
- # code-reviews (1)
- # copenhagen-clojurians (1)
- # cursive (39)
- # data-science (6)
- # datahike (8)
- # deps-new (8)
- # depstar (2)
- # etaoin (1)
- # fulcro (2)
- # funcool (2)
- # graalvm (5)
- # jackdaw (3)
- # java (17)
- # jobs-discuss (43)
- # kaocha (2)
- # leiningen (25)
- # malli (8)
- # minecraft (1)
- # missionary (8)
- # observability (6)
- # off-topic (37)
- # other-languages (12)
- # practicalli (1)
- # reagent (4)
- # releases (78)
- # remote-jobs (1)
- # sci (9)
- # shadow-cljs (13)
- # spacemacs (6)
- # sql (1)
- # tools-deps (30)
- # xtdb (3)
The #etaoin babashka pod has an update (last update was August 2021): It allows you to use etaoin from babashka scripts. Other than writing UI tests, I also use it together with a file-watcher to refresh the browser while I'm writing docs (see https://github.com/babashka/book/blob/master/script/watch.clj). • Add `wait` in `pod.babashka.etaoin` https://github.com/babashka/pod-babashka-etaoin/issues/11 (https://github.com/mprokopov) • Upgrade to etaoin 0.4.6 • Add `pod.babashka.etaoin.query/expand` https://github.com/babashka/pod-babashka-etaoin/issues/10 See https://github.com/babashka/pod-babashka-etaoin#run how to use it.
I’d like to access Flyway with bb, however, running bb it fails with
Unable to resolve classname: org.flywaydb.core.Flyway
You can only access pre-defined classes in bb, so that's not going to work. Options: 1. Shell out the flyway CLI from bb. 2. Build a flyway pod. 3. Or just use clojure on the JVM.
What do you mean by pre-defined? bb.edn supports adding new jars, so how the classes are predefined?
Only pre-compiled classes from this file: https://github.com/babashka/babashka/blob/master/src/babashka/impl/classes.clj are available in bb.
See here for a selection of libraries that work with bb:
https://github.com/babashka/babashka/blob/master/doc/projects.md
Usually when a library uses pure Clojure and no strange optimizations or third party Java libs, it works, except when it uses deftype
which is not supported in bb.
I am now going with this approach:
1. Write a file, e.g., ctl.cj as the entrance of all commands
2. Inside ctl.cj, if some command require java class, then use b/process to invoke clojure -X some/command
This works rather fast though. I guess might because the some/command namespace has little class to load at the starting time.
Is there a way to use deps.edn aliases with bb
?
I tried setting up my project this way:
bb.edn
:
{:paths ["src"]
:deps {org.babashka/spec.alpha {:git/url ""
:git/sha "644a7fc216e43d5da87b07471b0f87d874107d1a"}}
:aliases
{:test {:extra-paths ["test"]}}}
I'd like to be able to build an uberscript with just src
on the classpath, e.g.
bb --uberscript uberscript -m my-project.core
Then I'd like to run unit tests with both src
and test
. The following doesn't actually work, but it's what I have in mind:
bb -A:test -m my-project.test-runner
@15joeybloom You can use {:tasks {test {:extra-paths ["test"} :task my-project.test-runner}}
and then invoke bb test
to run the tests
Thanks, this is exactly what I need!
Got this error message with :task my-project.test-runner
:
bb test
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Could not resolve symbol: my-project.test-runner
Location: <expr>:23:1
Phase: analysis
----- Context ------------------------------------------------------------------
19: nil
20: (def test (binding [
21: babashka.tasks/*task* '{:name test, :extra-paths ["test"], :task my-project.test-runner}]
22: nil
23: my-project.test-runner)) test
^--- Could not resolve symbol: my-project.test-runner
I explicitly specified the main function name ( :task my-project.test-runner/-main
) and it worked.See https://book.babashka.org/#tasks for task runner docs.
Thanks, this is exactly what I need!
Got this error message with :task my-project.test-runner
:
bb test
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Could not resolve symbol: my-project.test-runner
Location: <expr>:23:1
Phase: analysis
----- Context ------------------------------------------------------------------
19: nil
20: (def test (binding [
21: babashka.tasks/*task* '{:name test, :extra-paths ["test"], :task my-project.test-runner}]
22: nil
23: my-project.test-runner)) test
^--- Could not resolve symbol: my-project.test-runner
I explicitly specified the main function name ( :task my-project.test-runner/-main
) and it worked.I tried to run bb
binary on Raspbian to understand I have 32-bit Raspbian but bb
for Linux ARM is 64-bit version, is that correct?