Skip to content

bld

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

Install

$brew install rife2/tools/bld

Install command taken from the project's README or registry entry. Always review code before running it.

What is bld?

bld is a build tool that lets you write your build logic in pure Java.

bld was created because we're not really interested in build tools. We use them because we have to, but we'd rather just get on with coding the real stuff.

bld is designed with the following principles in mind:

  • tasks don't happen without you telling them to happen
  • no auto-magical behavior, task behavior is explicit and API-defined
  • managing libs yourself is fine, automating that is fine too, or mix and match
  • build logic is written in Java, with all the advantages of Java
  • standard collection of Java-centric tasks for common operations
  • bld is distributed as a single jar, if you have the jar, you have the build system

Designed for modern Java

bld requires Java 17 or later and supports the latest JDK releases. Your build logic stays concise and readable, and any Java IDE understands it. You get auto-completion and javadoc documentation, and you can split your build logic into multiple files and classes when you outgrow a single file.

Here is a complete bld file for a Java application using JUnit 5 for its tests. Nothing else is needed to be able to run it, test it and distribute it:

package com.example;

import rife.bld.Project;
import java.util.List;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.*;

public class MyAppBuild extends Project {
    public MyAppBuild() {
        pkg = "com.example";
        name = "my-app";
        mainClass = "com.example.MyApp";
        version = version(0,1,0);

        downloadSources = true;
        repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
        scope(test)
            .include(dependency("org.junit.jupiter", "junit-jupiter", version(6,1,3)))
            .include(dependency("org.junit.platform", "junit-platform-console-standalone", version(6,1,3)));
    }

    public static void main(String[] args) {
        new MyAppBuild().start(args);
    }
}

NOTE: bld supports different ways to describe dependencies, dependency("org.junit.jupiter", "junit-jupiter", version(6,1,3)) can for instance also be written as dependency("org.junit.jupiter:junit-jupiter:6.1.3"). Which format you use, is a matter of personal taste.

Where does bld fit?

Maven and Gradle describe a build for the tool to execute. bld is ordinary Java that runs directly.

Maven Gradle bld
Language XML Groovy / Kotlin Java
IDE completion & refactoring limited with a plugin full, it's Java
Debugging attach to the JVM attach to the daemon the whole Java debugger: breakpoints, watches, ..
Extensions plugins plugins / DSL any Java jar, or a bld extension

Writing your build logic in the same language as your application (Java) reduces the cognitive load, and taking actions immediately without having to mentally construct a described plan makes it easier to reason about your build.

One jar, everything included

Similar plugs

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts. 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI…

An open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM

AI Agent Assistant & development framework that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative.

Explore related