Skip to content

Latest commit

 

History

History
112 lines (79 loc) · 3.44 KB

build.md

File metadata and controls

112 lines (79 loc) · 3.44 KB

Building babashka

Prerequisites

  • Install lein for producing uberjars

  • Download GraalVM. Currently we use java11-20.1.0.

  • Set $GRAALVM_HOME to the GraalVM distribution directory. On macOS this can look like:

    export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-20.1.0/Contents/Home

    On linux:

    export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-20.1.0

    On Windows:

    set GRAALVM_HOME=C:\Users\IEUser\Downloads\graalvm-ce-java11-20.1.0
    

Clone repository

NOTE: the babashka repository contains submodules. You need to use the --recursive flag to clone these submodules along with the main repo.

$ git clone https://github.com/borkdude/babashka --recursive

To update later on:

$ git submodule update --recursive

Build

Run the uberjar and compile script:

$ script/uberjar
$ script/compile

To configure max heap size you can use:

$ export BABASHKA_XMX="-J-Xmx6500m"

Note: setting the max heap size to a low value can cause the build to crash or take long to complete.

Windows

To compile on Windows you need to check out the windows branch:

$ git checkout windows

Then run script\uberjar.bat followed by script\compile.bat.

Feature flags

Babashka supports the following feature flags:

Name Description Default
BABASHKA_FEATURE_CORE_ASYNC Includes the clojure.core.async library true
BABASHKA_FEATURE_CSV Includes the clojure.data.csv library true
BABASHKA_FEATURE_JAVA_NIO Includes commonly used classes from the java.nio package true
BABASHKA_FEATURE_JAVA_TIME Includes commonly used classes from the java.time package true
BABASHKA_FEATURE_TRANSIT Includes the transit-clj library true
BABASHKA_FEATURE_XML Includes the clojure.data.xml library true
BABASHKA_FEATURE_YAML Includes the clj-yaml library true
BABASHKA_FEATURE_JDBC Includes the next.jdbc library false
BABASHKA_FEATURE_POSTGRESQL Includes the PostgresSQL JDBC driver false
BABASHKA_FEATURE_HSQLDB Includes the HSQLDB JDBC driver false
BABASHKA_FEATURE_DATASCRIPT Includes datascript false

To disable all of the above features, you can set BABASHKA_LEAN to true.

HyperSQL

To compile babashka with the next.jdbc library and the embedded HyperSQL database:

$ export BABASHKA_FEATURE_JDBC=true
$ export BABASHKA_FEATURE_HSQLDB=true
$ script/uberjar
$ script/compile

Note: there is now a pod for working with HyperSQL.

PostgresQL

To compile babashka with the next.jdbc library and a PostgresQL driver:

$ export BABASHKA_FEATURE_JDBC=true
$ export BABASHKA_FEATURE_POSTGRESQL=true
$ script/uberjar
$ script/compile

Note: there is now a pod for working with PostgreSQL.