From afa83cf5fd789d4d25f33cd1c2df76955822154c Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sat, 13 Apr 2024 08:52:07 +0200 Subject: [PATCH] Add 1-minute tutorial: Prelude --- .bach/run | 1 + README.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.bach/run b/.bach/run index 80329bf9e..e08ab3b9f 100644 --- a/.bach/run +++ b/.bach/run @@ -1 +1,2 @@ +# Run an arbitrary application via the command-line: NAME [ARGS...] .bach/src/run.bach/run/bach/internal/RunTool.java diff --git a/README.md b/README.md index c59c14d91..17a234f01 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,37 @@ Bach is a Java Shell-like that orchestrates [JDK tools] for building modular Java projects. +## Prelude + +Install Bach's basic tool framework using its sources via `git` and Java 22 or higher. + +First time: +```shell +mkdir myproject +cd myproject +git init +git submodule add https://github.com/sormuras/run.bach .bach/src/run.bach/run/bach +echo .bach/src/run.bach/run/bach/internal/RunTool.java > .bach/run +``` + +Subsequent times: +```shell +cd myproject +git submodule update --remote --recursive +``` + +Run time: +```shell +java @.bach/run jar --version +java @.bach/run java --version +java @.bach/run https://raw.githubusercontent.com/sormuras/hello/main/Hello.java World +java @.bach/run https://github.com/sormuras/hello/releases/download/1-M3/hello-1-M3.jar World +``` +Consult the following manual pages for details of `git` and `java` tools: +- [git init](https://git-scm.com/docs/git-init) - Create an empty Git repository or reinitialize an existing one +- [git submodule](https://git-scm.com/docs/git-submodule) - Initialize, update or inspect submodules +- [java @file](https://docs.oracle.com/en/java/javase/22/docs/specs/man/java.html#java-command-line-argument-files) - Java Command-Line Argument Files + # be free - have fun [![jdk22](https://img.shields.io/badge/JDK-22-blue.svg)](https://jdk.java.net)