Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/bldPublic

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

License

NotificationsYou must be signed in to change notification settings

rife2/bld

Repository files navigation

LicenseJavabldReleaseMaven CentralNexus Snapshotgradle-ciTests


What is bld?

bld is a new build system that allows you to write your build logic in pureJava.

bld was created because we're not really interested in build tools. We usethem 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, having that automated also, 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 in a single jar, if you have the jar, you have the build system

Designed for modern Java

bld relies on Java 17 and leverages many of the features that this version ofJava provides. Thanks to the modern language constructs, your Java build logicends up looking very concise, is easily readable and understood by any IDE.You automatically get support for auto-completion and javadoc documentation,and you can split your build logic into multiple files and classes when yououtgrow 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:

packagecom.example;importrife.bld.Project;importjava.util.List;importstaticrife.bld.dependencies.Repository.*;importstaticrife.bld.dependencies.Scope.*;publicclassMyAppBuildextendsProject {publicMyAppBuild() {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(5,11,4)))            .include(dependency("org.junit.platform","junit-platform-console-standalone",version(1,11,4)));    }publicstaticvoidmain(String[]args) {newMyAppBuild().start(args);    }}

NOTE:bld supports different ways to describe dependencies,dependency("org.junit.jupiter", "junit-jupiter", version(5,11,4)) can for instance alsobe written asdependency("org.junit.jupiter:junit-jupiter:5.11.4"). Which format you use,is a matter of personal taste.

Where doesbld fit?

From a very high level, build tools can be organized in a matrix:

  • either your tool is declarative or in code
  • either your tool first describes a plan or immediately executes a plan
DeclarativeCodeDescribesImmediate
MavenXX
GradleXX
bldXX

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

IDE support

Since version 2.0, bld comes with its ownIntelliJ IDEA plugin:

  • detectbld projects and find their main Java class
  • quick access to open and edit the main Java class and wrapper properties ofbld projects
  • list all the commands inbld projects in a side panel
  • execute one or multiple commands in the order they were selected
  • reload the commands in thebld project
  • terminate currently runningbld commands
  • bld console panel for command output with source code hyperlinking
  • display thebld dependency tree
  • toggle to runbld in offline or online mode
  • auto-save all open files before executing abld command
  • convenientbld one-click cache invalidation
  • setbld commands to run before or after IDEA compilation
  • create custombld command run configuration with options, JVM arguments, and before launch tasks
  • assign keyboard shortcuts tobld commands

Find out more

bld lets your build logic get out of the way so that you can focus on writingapplications.

Get started immediately byinstallingbldthrough Homebrew, SDKMAN!, JBang, zip archive, or run it directly from its jar file.

If you merely want to create a new project,bld can also be used by executing this one-liner:

bash -c "$(curl -fsSL https://rife2.com/bld/create.sh)"

If you have any questions, suggestions, ideas or just want to chat, feel freeto post on theforums or to join us onDiscord.

Read more in thefull documentation andbld Javadocs.

Buildingbld

If you want to contribute tobld or customize it, all you have to do is clone the GitHubrepository and update theRIFE2/core submodule:

git clone git@github.com:rife2/bld.gitcd bldgit submodule initgit submodule update

Then usebld to build itself:

./bld compile

The project has an IntelliJ IDEA project structure. You can just open it after allthe dependencies were downloaded and peruse the code.


[8]ページ先頭

©2009-2025 Movatter.jp