Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Babashka tasks (at London Clojurians July 2021)

Babashka tasks (at London Clojurians July 2021)

In babashka 0.4.0 a new feature was introduced: the task runner.
In this talk, Michiel demonstrates how to best leverage this new feature to
automate and compose the execution of common project tasks.

Talk on Youtube:
https://youtu.be/u5ECoR7KT1Y

https://babashka.org/

Michiel Borkent

July 20, 2021
Tweet

More Decks by Michiel Borkent

Other Decks in Programming

Transcript

  1. • Native Clojure scripting tool, single binary, no JVM •

    Developed since August 2019 (2000+ stars, 68 contributors) • Can be used to replace “the grey areas” of bash • Installable via script, brew (macOS, linux), aur (linux), scoop (Windows) $ time bb -e '(+ 1 2 3)'
 6
 0.00s user 0.00s system 67% cpu 0.013 total
  2. Make, just, etc. • Complex project-specific CLI invocations • Remember

    • Shortcuts • Discoverability • Fast startup • Only rebuild when necessary (make) • Clojure...?
  3. bb run options: --parallel $ bb run --parallel d
 d:

    #inst "2021-05-08T14:14:56.322-00:00"
 a: #inst "2021-05-08T14:14:56.357-00:00"
 b: #inst "2021-05-08T14:14:56.360-00:00"
 c: #inst "2021-05-08T14:15:01.366-00:00"
 "Elapsed time: 5023.894512 msecs"
  4. Command line args • Just use *command-line-args*, bb leaves it

    unprocessed. • To pass args from a task to another task, use binding + run
  5. Babashka tasks • Complex project-specific CLI invocations • Remember •

    Shortcuts • Discoverability • Fast startup • Only rebuild when necessary • Clojure!