<commit_before># Java Shell Builder

Ideas, thoughts, and more on the architecture of `Bach.java`.

## Uniques

- [x] [zero installation](#zero-installation) required (besides JDK 11+, using `jshell`)
- [x] [zero extra configuration](#zero-extra-configuration) required (conventions and information gathered from `module-info.java` files)
- [x] [customize with properties](#customize-via-properties) to override auto-configured values (`.bach/project.properties`)
- [x] [b-y-o-b](#bring-your-own-build) program using plain old Java (`src/bach/Build.java`)
- [ ] 3rd-party modules in plain sight (single `lib/` directory)
- [ ] considers compile (`javac`) and package (`jar`) as an atomic step
- [ ] single-pass multi-module processing (`--module-source-path`)
- [ ] multi-release modules (`java-7`, `java-8`, ..., `java-11`, ..., `java-N`)
- [ ] automated checks (`test(${MODULE})`,`junit`)
- [ ] document (`${MODULE}-javadoc.jar`, `${MODULE}-sources.jar`)

## Zero Installation

Enter the base directory of your Java project, open a shell, and execute one of the following commands:

- Long: `jshell https://raw.githubusercontent.com/sormuras/bach/master/src/bach/Bach.jsh`
- Shorter: `jshell https://github.com/sormuras/bach/raw/master/src/bach/Bach.jsh`
- Shortened: `jshell https://bit.ly/bach-jsh`

That's it.

## Zero Extra Configuration

Almost all required information to build a modular Java project is either deduced from conventions or gathered from
module declarations, i.e. `module-info.java` files.

- Required modules' versions via https://github.com/sormuras/modules

Also, the following attributes are extracted from comments (soon annotations?) found in module declarations: 

- Module version `--module-version ...`
- Module entry-point `--main-class ...`

## Customize Via Properties

The default [ProjectBuilder](https://github.com/sormuras/bach/blob/master/src/de.sormuras.bach/main/java/de/sormuras/bach/project/ProjectBuilder.java)
implementation loads some properties from a `.bach/project.properties` file.
Here, you may set different values for project properties like `name`, `version`, etc.

## Bring Your Own Build

Does your project use a different structure?
Want to execute tasks is a different order?
Need additional tasks to be executed?
Want skip tests?

Write your own build program using plain old Java!

Store your build program as [`src/bach/Build.java`](https://github.com/sormuras/bach/blob/master/src/bach/Build.java) and [Bach.java](https://github.com/sormuras/bach/blob/master/src/bach/Bach.java#L43) will delegate to it.
To make your own build program runnable from within an IDE, you need to download and mount module `de.sormuras.bach` first.
After that simply run the `de.sormuras.bach` module.

## Singe-File Source-Code program or modular library?

- `Bach.java`
  - Single source of everything
  - Zero-installation, direct usage via `jshell https://...`
  - Stored in project under `.bach/src/Bach.java`, it is...
    - runnable via `java .bach/src/Bach.java action [args]`<commit_msg>Describe 3rd-party modules support<commit_after># Java Shell Builder

Ideas, thoughts, and more on the architecture of `Bach.java`.

## Uniques

- [x] [zero installation](#zero-installation) required (besides JDK 11+, using `jshell`)
- [x] [zero extra configuration](#zero-extra-configuration) required (conventions and information gathered from `module-info.java` files)
- [x] [customize with properties](#customize-via-properties) to override auto-configured values (`.bach/project.properties`)
- [x] [b-y-o-b](#bring-your-own-build) program using plain old Java (`src/bach/Build.java`)
- [x] [3rd-party modules](#3rd-party-modules) in plain sight (single `lib/` directory)
- [ ] considers compile (`javac`) and package (`jar`) as an atomic step
- [ ] single-pass multi-module processing (`--module-source-path`)
- [ ] multi-release modules (`java-7`, `java-8`, ..., `java-11`, ..., `java-N`)
- [ ] automated checks (`test(${MODULE})`,`junit`)
- [ ] document (`${MODULE}-javadoc.jar`, `${MODULE}-sources.jar`)

## Zero Installation

Enter the base directory of your Java project, open a shell, and execute one of the following commands:

- Long: `jshell https://raw.githubusercontent.com/sormuras/bach/master/src/bach/Bach.jsh`
- Shorter: `jshell https://github.com/sormuras/bach/raw/master/src/bach/Bach.jsh`
- Shortened: `jshell https://bit.ly/bach-jsh`

That's it.

## Zero Extra Configuration

Almost all required information to build a modular Java project is either deduced from conventions or gathered from
module declarations, i.e. `module-info.java` files.

- Required modules' versions via https://github.com/sormuras/modules

Also, the following attributes are extracted from comments (soon annotations?) found in module declarations: 

- Module version `--module-version ...`
- Module entry-point `--main-class ...`

## Customize Via Properties

The default [ProjectBuilder](https://github.com/sormuras/bach/blob/master/src/de.sormuras.bach/main/java/de/sormuras/bach/project/ProjectBuilder.java)
implementation loads some properties from a `.bach/project.properties` file.
Here, you may set different values for project properties like `name`, `version`, etc.

## Bring Your Own Build

Does your project use a different structure?
Want to execute tasks is a different order?
Need additional tasks to be executed?
Want skip tests?

Write your own build program using plain old Java!

Store your build program as [`src/bach/Build.java`](https://github.com/sormuras/bach/blob/master/src/bach/Build.java) and [Bach.java](https://github.com/sormuras/bach/blob/master/src/bach/Bach.java#L43) will delegate to it.
To make your own build program runnable from within an IDE, you need to download and mount module `de.sormuras.bach` first.
After that simply run the `de.sormuras.bach` module.

## 3rd-party Modules

All 3rd-party modules are stored in plain sight: `lib/`
3rd-party modules are all modules that are not declared in your project and that are not modules provided by the _system_, i.e. the current Java runtime.

How do you provide 3rd-party modules?

- Load and drop modular JAR files into the `lib/` directory.

Missing 3rd-party modules are being resolved in a best-effort manner using [sormuras/modules](https://github.com/sormuras/modules) database.

## Singe-File Source-Code program or modular library?

- `Bach.java`
  - Single source of everything
  - Zero-installation, direct usage via `jshell https://...`
  - Stored in project under `.bach/src/Bach.java`, it is...
    - runnable via `java .bach/src/Bach.java action [args]`
{'fraction_non_alphanumeric': 0.13040181956027294, 'fraction_numerical': 0.0037907505686125853, 'mean_word_length': 4.340890688259109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 17, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '541373', 'n_tokens_mistral': 2028, 'n_tokens_neox': 1942, 'n_words': 671}