Badass-Jar example N-Queens
A simple project that shows how to use the Badass Jar Plugin. It implements a library for solving the N-Queens problem.
The plugin is configured in build.gradle
as follows:
plugins {
id 'java'
id "org.beryx.jar" version "1.0.0"
...
}
...
sourceCompatibility = 1.8
...
Usage
To build a modular jar that targets Java 8 execute:
./gradlew build
The above command does not check the validity of module-info.java
.
You can convince yourself of this by replacing the content of module-info.java
with:
module foo.bar {
exports bar.foo;
requires baz.qux;
}
The above gradle command will still succeed, although the new module-info.java
is invalid.
To check the validity of module-info.java
execute:
./gradlew -PjavaCompatibility=11 build
Note that Travis is configured
to run gradle both with and without the javaCompatibility
project property:
./gradlew -PjavaCompatibility=11 --no-daemon -i -s build
./gradlew --no-daemon -i -s build