Need help with bach?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

sormuras
204 Stars 47 Forks MIT License 5.2K Commits 15 Opened issues

Description

ğŸŽ¼ Bach Builds (on(ly)) Modules

Services available

!
?

Need anything else?

Contributors list

# 22,535
Groovy
Kotlin
test-fr...
junit
5241 commits
# 1,692
steam
laravel...
laravel...
advent-...
81 commits
# 208,679
jakarta...
C
PHP
Shell
6 commits
# 5,429
Java
reactjs
openapi
CSS
3 commits
# 10,894
Groovy
mocking...
mockito
test-fr...
2 commits
# 54,091
Java
mocking...
immutab...
oracle
1 commit
# 11,965
playfra...
sbt
play-fr...
jvm-lan...
1 commit
# 463,704
Shell
HTML
katas
Kotlin
1 commit
# 13,652
code-an...
apex
plsql
swift-3
1 commit
# 14,600
Java
usb-dev...
jna
Linux
1 commit
# 39,092
Groovy
nexus
mocking...
mockito
1 commit
# 9,099
Java
Shell
Groovy
gRPC
1 commit

Bach - Java Shell Builder - Builds (on(ly)) Modules

"The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities."

Edsger W. Dijkstra, 18 June 1975

Bach is a lightweight Java build tool that orchestrates JDK tools for building modular Java projects.

By default, it tries its best to call the right tool at the right time with the right arguments. Bach encourages developers to explore, learn, and master these foundation tools with their options; in order to allow a good understanding of what is really going on when building a Java project. Pass those learnings and optimizations as fine-grained tweaks in a declarative manner back to Bach using pure Java syntax.

Fast-forward to sections: ♥ Motivation, ✔ Goals, and ❌ Non-Goals

Build Bach with Bach

  • Install JDK 17 or later.

  • Build ```text

    java .bach/src/bootstrap.java .bach/bin/bach build ```

Motivation

The JDK contains a set of foundation tools but none of them guides developers from processing Java source files into shippable products: be it a reusable modular JAR file with its API documentation or an entire custom runtime image. There exists however an implicit workflow encoded in the available tools and their options. The (binary) output of one tool is the input of one or more other tools. With the introduction of modules in Java 9 some structural parts of that workflow got promoted into the language itself and resulted in explicit module-related tool options.

These structural information, encoded explicitly by developers in Java's module descriptors (

module-info.java
files), serves as basic building blocks for Bach's project model. Their location within the file tree, their module name, and their
requires
directives are examples of such information. In addition, Bach defines an API in order to let developers define extra configuration information. Included are project-specific values such as a short name, a version that is applied to all modules of the project, a path matcher defining where to find modules, and a lot more. Most of these project-specific values have pre-defined default values; some of these values provide an auto-configuration feature.

Goals

Bach...

  • builds Java projects.
  • builds modular Java projects.
  • is a lightweight wrapper for existing and future tools, mainly foundation tools provided by the JDK.
  • supports running modularized tools registered via the
    ToolProvider
    SPI.
  • supports running tools packaged in executable JAR files (via Java's
    Process
    API).
  • can be invoked directly from the command line, or programmatically via its modular API (in a JShell session).
  • infers basic project information from
    module-info.java
    files.
  • uses standard Java syntax for extra configuration purposes.
  • supports creation of multi-release JARs (via javac's and jar's
    --release
    option).
  • helps resolve missing external dependences by downloading required modules into a single project-local directory.
  • launches the JUnit Platform Console (if provided as
    junit
    tool by the project).

Non-Goals

Bach will not support "all features known from other build tools".

If a feature F is not provided by an underlying tool, Bach will not support F.

Bach will not...

  • support non-Java projects.
  • support non-modular Java projects.
  • provide a GUI for the tool.
  • resolve conflicting external dependencies.
  • deploy modules to external hosting services.

be free - have fun

jdk17 experimental GitHub all releases

jsb

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.