babashka/doc/build.md

75 lines
1.6 KiB
Markdown
Raw Normal View History

2020-04-26 11:10:30 +00:00
# Building babashka
## Prerequisites
- Install [lein](https://leiningen.org/) for producing uberjars
- Download [GraalVM](https://www.graalvm.org/downloads/). Currently we use *java8-19.3.1*.
- Set `$GRAALVM_HOME` to the GraalVM distribution directory. On macOS this can look like:
``` shell
export GRAALVM_HOME=~/Downloads/graalvm-ce-java8-19.3.1/Contents/Home
```
On linux:
``` shell
export GRAALVM_HOME=~/Downloads/graalvm-ce-java8-19.3.1
```
On Windows:
```
set GRAALVM_HOME=C:\Users\IEUser\Downloads\graalvm-ce-java8-19.3.1
```
## Clone repository
NOTE: the babashka repository contains submodules. You need to use the
`--recursive` flag to clone these submodules along with the main repo.
``` shellsession
$ git clone https://github.com/borkdude/babashka --recursive
```
To update later on:
``` shellsession
$ git submodule update --recursive
```
## Build
2020-04-28 10:03:01 +00:00
First run `script/uberjar` to create the `.jar` file. Then run `script/compile`.
2020-04-26 11:10:30 +00:00
To configure maximum heap size you can use:
```
2020-04-28 10:03:01 +00:00
$ BABASHKA_XMX="-J-Xmx4800m" script/compile
2020-04-26 11:10:30 +00:00
```
## Windows
To compile on Windows you need to check out the `windows` branch:
``` shell
$ git checkout windows
```
The compile script for Windows is `script/compile.bat`.
## Optional features
### HyperSQL
To compile babashka with `HyperSQL`/`hsqldb` support, set
`BABASHKA_FEATURE_HSQLDB` to `true`:
``` shell
$ BABASHKA_FEATURE_HSQLDB=true script/compile
```
2020-04-26 11:13:51 +00:00
Check out this [example](examples.md#find-unused-vars).
2020-04-26 11:10:30 +00:00
If you think this feature should be enabled in the distributed version of `bb`,
vote with a thumbs up on [this](https://github.com/borkdude/babashka/issues/382)
issue.