A Java build tool that works seamlessly with modules
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings update Eclipse configuration to Java 11 Aug 16, 2018
aether-bootstrap
deps update to use ASM 7.0 Oct 28, 2018
plugins Update listener's package and type name Nov 25, 2018
src use convention in tester to get the report folder Nov 22, 2018
wrapper Use Path.of instead of Pats.get() [move to java 11] Oct 21, 2018
.appveyor.yml update appveyor to use jdk 11 GA Sep 27, 2018
.classpath fix Eclipse configuration (add JUnit platform.reporting) Nov 22, 2018
.gitignore
.project clean Eclipse specific files Jul 31, 2017
.travis.yml update to use latest early access images Dec 2, 2018
LICENSE Initial commit Nov 23, 2016
README.md update README Oct 30, 2018
build.bat
build.sh add --add-modules jdk.unsupported when bootstrapping May 6, 2018
format.pro propagate the errorCode Oct 18, 2018
test.pro test.pro should not return 0 when something goes wrong Oct 16, 2018

README.md

Linux build status Windows build status

pro

A Java build tool that works seamlessly with modules

No need to be a maven to be able to use a build tool

rationale

With the introduction of modules in Java 9, creating modules/jars is easier and new applications will tend to have many more, smaller modules than before. The build model of Maven is not well suited to describe this new world.

principles

  • programmatic API first
  • use convention over configuration
  • stateless plugins
  • separate configuration time where configuration is mutable and build time where configuration is immutable
  • external dependencies are in plain sight (in the deps folder)

anatomy of a build.pro

pro uses a file named build.pro as build script, which is composed of two parts, the configuration part and the run part. In the configuration part, you can set the properties of a specific plugin, by example, this how to set the release version of the source to Java 11 for the compiler

  compiler.sourceRelease(11)

you can chain the calls, by example to set the source release and use the preview features

  compiler.
    sourceRelease(11).
    enablePreview(true)

Note: pro uses jshell to parse the build.pro, this tool is line oriented so you have to put the dot '.' at the end of the line to ask for the parsing of the next line.

Then you have to call run() with all the commands you want to execute, by example,

  run(compiler, packager)

to run the compiler on the sources and uses the packager to create a jar.

Here is a list of the main plugins

  • resolver use Maven artifact coordinates to download the dependencies
  • modulefixer patch the artifacts downloaded to make them fully compatible with the module-path
  • compiler compile the sources and the tests
  • tester run the JUnit 5 tests
  • docer generate the javadoc
  • runner run the main() of the main class of the main module.

getting started

To create the layout of a minimal project, you can use the option scaffold

  mkdir myproject
  cd myproject
  pro scaffold 

scaffold will ask for a module name (a name in reverse DNS form like a kind of root package) and will generate a skeleton of the folders.

Then you can run pro to build your project

  pro

demo

There is a small demo in the github project pro-demo.

build instructions

To compile and build pro, run:

build.sh

pro will bootstrap itself.

To build pro you need the jdk11 or a more recent version, you may have to change the value of the variable JAVA_HOME at the start of the script build.sh.

Once built, you have an image of the tool in target/pro. This image embeds its own small JDK: no need to install anything Java-related to be able to build your application. Obviously, you will need a JDK to run your application.