From 93a0d2b101306bcc96c42fd8b642d3d2dfbc7457 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 8 Jan 2020 21:30:50 +0100 Subject: [PATCH] Docs --- README.md | 51 +------------------------------------------ doc/cljdoc.edn | 3 ++- doc/dev.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 51 deletions(-) create mode 100644 doc/dev.md diff --git a/README.md b/README.md index ffb50eaa..3adb0722 100644 --- a/README.md +++ b/README.md @@ -635,56 +635,7 @@ break> x - [Clojure in the Shell](https://lambdaisland.com/blog/2019-12-05-advent-of-parens-5-clojure-in-the-shell) by Arne Brasseur - [Clojure Tool](https://purelyfunctional.tv/issues/purelyfunctional-tv-newsletter-351-clojure-tool-babashka/) by Eric Normand -## Developing Babashka - -To work on Babashka itself make sure Git submodules are checked out. - -``` shellsession -$ git clone https://github.com/borkdude/babashka --recursive -``` - -To update later on: - -``` shellsession -$ git submodule update --recursive -``` - -You need [Leiningen](https://leiningen.org/), and for building binaries you need GraalVM. - -### REPL - -`lein repl` will get you a standard REPL/nREPL connection. To work on tests use `lein with-profiles +test repl`. - -### Adding classes - -Add necessary classes to `babashka/impl/classes.clj`. For every addition, write -a unit test, so it's clear why it is added and removing it will break the -tests. Try to reduce the size of the binary by only adding the necessary parts -of a class in `:instance-check`, `:constructors`, `:methods`, `:fields` or -`:custom`. - -The `reflection.json` file that is needed for GraalVM compilation is generated -with: - - lein with-profiles +reflection run - -### Test - -Test on the JVM (for development): - - script/test - -Test the native version: - - BABASHKA_TEST_ENV=native script/test - -### Build - -To build this project, set `$GRAALVM_HOME` to the GraalVM distribution directory. - -Then run: - - script/compile +## [Developing Babashka](doc/dev.md) ## Related projects diff --git a/doc/cljdoc.edn b/doc/cljdoc.edn index c8bbab47..a6cd8b56 100644 --- a/doc/cljdoc.edn +++ b/doc/cljdoc.edn @@ -1,2 +1,3 @@ {:cljdoc.doc/tree - [["Readme" {:file "README.md"}]]} + [["Readme" {:file "README.md"}] + ["Developing Babashka" {:file "doc/dev.md"}]]} diff --git a/doc/dev.md b/doc/dev.md new file mode 100644 index 00000000..ae7f500f --- /dev/null +++ b/doc/dev.md @@ -0,0 +1,59 @@ +# Developing Babashka + +To work on Babashka itself make sure Git submodules are checked out. + +``` shellsession +$ git clone https://github.com/borkdude/babashka --recursive +``` + +To update later on: + +``` shellsession +$ git submodule update --recursive +``` + +You need [Leiningen](https://leiningen.org/), and for building binaries you need GraalVM. + +## REPL + +`lein repl` will get you a standard REPL/nREPL connection. To work on tests use `lein with-profiles +test repl`. + +### Adding classes + +Add necessary classes to `babashka/impl/classes.clj`. For every addition, write +a unit test, so it's clear why it is added and removing it will break the +tests. Try to reduce the size of the binary by only adding the necessary parts +of a class in `:instance-check`, `:constructors`, `:methods`, `:fields` or +`:custom`. + +The `reflection.json` file that is needed for GraalVM compilation is generated +with: + + lein with-profiles +reflection run + +## Test + +Test on the JVM (for development): + + script/test + +Test the native version: + + BABASHKA_TEST_ENV=native script/test + +## Build + +To build this project, set `$GRAALVM_HOME` to the GraalVM distribution directory. + +Then run: + + script/compile + + +## Binary size + +Keep notes here about how adding libraries and classes to Babashka grows the binary size. + +On macOS: + +2020/01/08, 303ca9e825d76a4a45bc4240a59139d342c13964: 36.9MB