Skip to content
Back to search

bld

Pure java build tool for developers who don't like dealing with build tools

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/rife2--bld/badge.svg)](/listings/rife2--bld)

HTML

<a href="/listings/rife2--bld"><img src="/api/listings/rife2--bld/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 181 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
  2. [![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
  3. [![bld](https://img.shields.io/badge/3.0.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
  4. [![Release](https://img.shields.io/github/release/rife2/bld.svg)](https://github.com/rife2/bld/releases/latest)
  5. [![Maven Central](https://img.shields.io/maven-central/v/com.uwyn.rife2/bld)](https://central.sonatype.com/artifact/com.uwyn.rife2/bld)
  6. [![GitHub Snapshot](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fcentral.sonatype.com%2Frepository%2Fmaven-snapshots%2Fcom%2Fuwyn%2Frife2%2Fbld%2Fmaven-metadata.xml)](https://github.com/rife2/bld/packages/2214741/versions)
  7. [![gradle-ci](https://github.com/rife2/bld/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld/actions/workflows/bld.yml)
  8. [![Tests](https://rife2.com/tests-badge/badge/com.uwyn.rife2/bld)](https://github.com/rife2/rife2/actions/workflows/bld.yml)
  9. <br>
  10. <p align="center"><img src="https://github.com/rife2/bld/raw/main/images/bld_logo.png" width="120"></p>
  11. # What is bld?
  12. `bld` is a build tool that lets you write your build logic in pure Java.
  13. `bld` was created because we're not really interested in build tools. We use
  14. them because we have to, but we'd rather just get on with coding the real stuff.
  15. `bld` is designed with the following principles in mind:
  16. * tasks don't happen without you telling them to happen
  17. * no auto-magical behavior, task behavior is explicit and API-defined
  18. * managing libs yourself is fine, automating that is fine too, or mix and match
  19. * build logic is written in Java, with all the advantages of Java
  20. * standard collection of Java-centric tasks for common operations
  21. * bld is distributed as a single jar, if you have the jar, you have the build system
  22. # Designed for modern Java
  23. `bld` requires Java 17 or later and supports the latest JDK releases. Your
  24. build logic stays concise and readable, and any Java IDE understands it. You
  25. get auto-completion and javadoc documentation, and you can split your build
  26. logic into multiple files and classes when you outgrow a single file.
  27. Here is a complete bld file for a Java application using JUnit 5 for its tests.
  28. Nothing else is needed to be able to run it, test it and distribute it:
  29. ```java
  30. package com.example;
  31. import rife.bld.Project;
  32. import java.util.List;
  33. import static rife.bld.dependencies.Repository.*;
  34. import static rife.bld.dependencies.Scope.*;
  35. public class MyAppBuild extends Project {
  36. public MyAppBuild() {
  37. pkg = "com.example";
  38. name = "my-app";
  39. mainClass = "com.example.MyApp";
  40. version = version(0,1,0);
  41. downloadSources = true;
  42. repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
  43. scope(test)
  44. .include(dependency("org.junit.jupiter", "junit-jupiter", version(6,1,3)))
  45. .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(6,1,3)));
  46. }
  47. public static void main(String[] args) {
  48. new MyAppBuild().start(args);
  49. }
  50. }
  51. ```
  52. > **NOTE:** `bld` supports different ways to describe dependencies,
  53. > `dependency("org.junit.jupiter", "junit-jupiter", version(6,1,3))` can for instance also
  54. > be written as `dependency("org.junit.jupiter:junit-jupiter:6.1.3")`. Which format you use,
  55. > is a matter of personal taste.
  56. # Where does `bld` fit?
  57. Maven and Gradle describe a build for the tool to execute. `bld` is ordinary
  58. Java that runs directly.
  59. | | Maven | Gradle | `bld` |
  60. |------------------------------|-------------------|----------------------|---------------------------------------------------|
  61. | Language | XML | Groovy / Kotlin | Java |
  62. | IDE completion & refactoring | limited | with a plugin | full, it's Java |
  63. | Debugging | attach to the JVM | attach to the daemon | the whole Java debugger: breakpoints, watches, .. |
  64. | Extensions | plugins | plugins / DSL | any Java jar, or a `bld` extension |
  65. Writing your build logic in the same language as your application (Java)
  66. reduces the cognitive load, and taking actions immediately without having to
  67. mentally construct a described plan makes it easier to reason about your
  68. build.
  69. # One jar, everything included
  70. Out of the box, `bld` knows how to create, compile, test, document, run,
  71. package and publish your projects. Transitive dependencies are resolved and
  72. downloaded in parallel with live progress reporting, Maven bills of materials
  73. keep versions consistent across your dependency tree, builds run offline when
  74. you want them to, and your artifacts publish straight to Maven Central through
  75. the Sonatype Central Portal.
  76. Modern Java deployment is covered as well, with first-class operations for Java
  77. modules, `jmod`, `jlink` runtime images, `jpackage` native installers, and
  78. annotation processing.
  79. When you need more, there's a growing collection of
  80. [extensions](https://github.com/rife2/bld/wiki/Extensions): Kotlin, Spring
  81. Boot, Checkstyle, PMD, SpotBugs, JaCoCo code coverage, ANTLR4, PIT mutation
  82. testing, TestNG, and many others. Writing your own extension is just writing
  83. Java code.
  84. # Ready for AI agents
  85. Since version 3.0, `bld` can serve your build commands as Model Context
  86. Protocol (MCP) tools. AI coding agents get a structured interface to compile,
  87. test and run your project, with streamed command output and execution
  88. metadata instead of scraped terminal text. Your build stays explicit and
  89. API-defined, agents just get a first-class way to drive it.
  90. ```console
  91. ./bld mcp install # register the project with Claude Code
  92. ./bld mcp install cursor # register with Cursor
  93. ./bld mcp install vscode # register with VS Code
  94. ```
  95. # IDE support
  96. <img src="https://rife2.com/images/bld-idea.png" style="width: 100%">
  97. Since version 2.0, bld comes with its own [IntelliJ IDEA plugin](https://github.com/rife2/bld-idea):
  98. * detect `bld` projects and find their main Java class
  99. * quick access to open and edit the main Java class and wrapper properties of `bld` projects
  100. * list all the commands in `bld` projects in a side panel
  101. * execute one or multiple commands in the order they were selected
  102. * run `bld` commands from icons in the gutter of the build file
  103. * reload the commands in the `bld` project
  104. * automatically reload the commands and dependencies when the build sources or wrapper properties change
  105. * terminate currently running `bld` commands
  106. * `bld` console panel for command output with source code hyperlinking
  107. * display the `bld` dependency tree
  108. * toggle to run `bld` in offline or online mode
  109. * toggle to show the `bld` console when a command is executed
  110. * auto-save all open files before executing a `bld` command
  111. * convenient `bld` one-click cache invalidation
  112. * set `bld` commands to run before or after IDEA compilation
  113. * create custom `bld` command run configuration with options, JVM arguments, and before launch tasks
  114. * assign keyboard shortcuts to `bld` commands
  115. # Find out more
  116. `bld` lets your build logic get out of the way so that you can focus on writing
  117. applications.
  118. Get started immediately by [installing](https://github.com/rife2/bld/wiki/Installation) `bld`
  119. through Homebrew, SDKMAN!, JBang, zip archive, or run it directly from its jar file.
  120. ```console
  121. brew install rife2/tools/bld # using Homebrew
  122. sdk install bld # using SDKMAN!
  123. jbang com.uwyn.rife2:bld:3.0.1 # using JBang
  124. ```
  125. If you merely want to create a new project, `bld` can also be used by executing this one-liner:
  126. ```console
  127. bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"
  128. ```
  129. Or on Windows:
  130. ```console
  131. irm https://rife2.com/bld/create.ps1 | iex
  132. ```
  133. If you have any questions, suggestions, ideas or just want to chat, feel free
  134. to post on the [forums](https://forum.uwyn.com) or to join us on [Discord](https://discord.gg/zDG6anEXQX).
  135. Read more in the [full documentation](https://github.com/rife2/bld/wiki) and [bld Javadocs](https://rife2.github.io/bld/).
  136. # Contributing
  137. See [CONTIBUTING.md](https://github.com/rife2/bld?tab=contributing-ov-file#readme) for information about
  138. contributing to this project.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.