• Stars
    star
    102
  • Rank 308,281 (Top 7 %)
  • Language
    Java
  • License
    GNU General Publi...
  • Created about 7 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Java build tool that works seamlessly with modules

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.

More Repositories

1

java-guide

A guide of modern Java (Java 17)
Jupyter Notebook
527
star
2

design-pattern-reloaded

Implementation of GoF design patterns using Java 17
Java
185
star
3

loom-fiber

Continuation & Fiber examples using the OpenJDK project Loom prototype
Java
114
star
4

exotic

A bestiary of classes implementing exotic semantics in Java
Java
112
star
5

proxy2

Better / faster proxy generator than java.lang.reflect.Proxy for Java (require 1.7)
Java
69
star
6

beautiful_logger

Yet another logger API in Java with beautiful features
Java
61
star
7

record-util

Some utility classes around java records
Java
32
star
8

kata-restrospective-11

Un kata sur comment utiliser Java 11 pour créer des APIs fonctionnelles
Java
26
star
9

vector-handle

A high level API to express vectorized operations in Java
Java
25
star
10

moduletools

A small example of a Java 9 modular application
Java
20
star
11

macro

Java Macro Library
Java
20
star
12

loom-actor

A small but fun actor framework based on loom
Java
18
star
13

kata-java17

A kata to transform an existing program to use Java 17 new features
Java
17
star
14

mjolnir

Thor Hammer and a way to express invokedynamic in Java
Java
17
star
15

java-next

Binary builds of several OpenJDK projects
Shell
15
star
16

vmboiler

A small library on top of ASM that generates optimistically typed bytecodes for dynamically typed JVM based languages
Java
14
star
17

jayspec

RSpec for Java 8
Java
13
star
18

hidden_proxy

A simple API that shows how,to use Hidden class to create proxies
Java
13
star
19

blast_from_the_past

Evolution of Java on an example from 1.0 to 10
Java
12
star
20

argvester

Argument Harvester - a simple command line parser
Java
12
star
21

jsjs

jsjs is a JavaScript engine written in JavaScript on top of the Java Virtual Machine
Java
11
star
22

jexpress

A light express.js like library written in Java (in one file)
Java
11
star
23

write_your_own_java_framework

Understand how Spring, JakartaEE, Jackson, Guice and Hibernate works by rewriting a toy version of them
Java
11
star
24

do-synthetic-methods-dream-of-electric-switch-expressions

Slides for ParisJUG, ChtiJUG and DevoxxFR 2021
JavaScript
11
star
25

write_your_dynamic_language_runtime

How to write interpreters or dynamic compilers for dynamically typed languages on top of the JVM
Java
10
star
26

write_your_own_java_framework_exercices

Try to implement small demos of the code powering usual Java frameworks
Java
10
star
27

pratt_parser

Implementation of a Pratt Parser in Java
Java
9
star
28

dragon

A simple enhanceable programming language for teaching algorithms
HTML
8
star
29

valuetype-lworld

Tests of Java value type (lworld prototype)
Java
8
star
30

pro-demo

A small demo of pro
Java
6
star
31

ninal

Ninal which stands for "Ninal is not a Lisp" is a small demo language (lisp like syntax/C like semantics) using Graal/Truffle
Java
5
star
32

jigsaw-jrtfs

A backport of jrtfs.jar for 1.7
Java
5
star
33

varhandle2

A safe yet efficient implementation of atomic operations for the JVM.
Java
5
star
34

indy-everywhere

A sample code that rewrite a folder of classes to use invokedynamic instead of getfield/putfield/invokevirtual/invokeinterface
Java
5
star
35

cplisp

A Lisp that is able to compile itself into the constant pool of a Java .class
Java
5
star
36

tomahawk

A better Java API for Apache Arrow
Java
5
star
37

dop-examples

Data Oriented Programming Examples
Java
4
star
38

amber-record

tests of the OpenJDK Amber record/sealed types
Java
4
star
39

java-interpolation

variation around how to implement string interpolation in Java
Java
4
star
40

forax.github.io

blog pages
JavaScript
4
star
41

umldoc

Automatically generates documentation with the UML diagrams using either plantUML or mermaidjs
Java
4
star
42

smartass

A toy language used to explain how to implement a dynamic language on top of the JVM
Java
4
star
43

struct-of-array

Two data structures with the API of an array of structs (AoS) and the internals of a struct of arrays (SoA)
Java
4
star
44

snowcamp-demo

one JDK8 application used as demo to show how to migrate to JDK9
JavaScript
3
star
45

blog

A blog publisher (like Jekyll) written in Java and tailored for me
Java
3
star
46

record-map

A java.util.Map that mostly supports Map interface but use a record instead of Map.Entry
Java
3
star
47

swisstable

A Java implementation of the Swisstable algorithm
Java
3
star
48

virtual-bean

A simple API to compose bean behavior based on annotations
Java
3
star
49

panama-vector

A workspace to test the vector API of the OpenJDK Panama project
Java
3
star
50

cheapcoverage

A demo on how to gather code coverage information on Java (Kotlin, Scala, etc) classfiles
Java
3
star
51

jruby-methodcall-optimizer

a proof of concept of an optimizer of bytecodes able to transform recognizable pattern to invokedynamic
Java
2
star
52

8to6

A retroweaver from Java 8 to Java 6 in order to run Java 8 code on Android !
Java
2
star
53

jsonapi

Proposal implementation for a Light-Weight JSON API (JEP 198)
Java
2
star
54

jsonjedi

parsing JSON with JDK8 lambdas
Java
2
star
55

panama-fastaccess

Java
2
star
56

amber-deconstructor

A prototype of how deconstructor can work for Amber OpenJDK project
Java
2
star
57

switch-carrier

A study of the carrier factory for the destructuring switch
Java
1
star
58

parisjug-2023

Java 21 : Add some sparkle to your life
Java
1
star
59

parisjug2013

The code I have shown during Paris JUG session "In bed with ..." in september 2013
Java
1
star
60

lambda-perf

performance of various implementations of lambda-lib (future jdk8 API)
Java
1
star
61

graalvm-demo

A demo of all graal projects
Java
1
star
62

movie_buddy

A movie buddy application for Devoxx 2014 (Vertx + Java8 lambda)
JavaScript
1
star
63

switch-pattern-combinator

A prototype showing how to generte the bytecode for a switch on patterns
Java
1
star
64

pattern-matching

Examples of pattern matching in Java
Java
1
star
65

webapp-java17

A example of a Spring project using Java 17
Java
1
star
66

kija

Kija is a small programming language to teach algorithmics
Java
1
star
67

reducedjs

A reduced set of the JavaScript feature that can run fast on the JVM
1
star
68

foraxproof

An example of a tool that analyze bytecode (like findbugs)
Java
1
star
69

amber-demo

Examples of features of the Amber OpenJDK project
Java
1
star