As with many Gradle projects, a Gradle wrapper is included. Replace ./gradlew
with .\gradlew.bat
if you're using Windows.
To run the engine (for UCI communication), run:
./gradlew compileJava && java -cp engine/build/libs/*.jar com.vmardones.tealchess.uci.UciLauncher
The game can be easily started like this:
./gradlew run
To generate a JAR with every dependency included, the Gradle Shadow Plugin can be used:
./gradlew shadowJar
The generated JAR can be found in desktop/build/libs/teal-chess.jar
. No other
file is required to run the program.
The JAR requires JRE (or JDK) version 17 or higher. To start the program, run:
java -jar desktop/build/libs/teal-chess.jar
To check other command line options, run:
java -jar desktop/build/libs/teal-chess.jar --help
The example below uses Linux and generates an RPM installer. Depending on your
platform, you may need to reconfigure the plugin in build.gradle
to produce a
different output. Also, make sure that you've installed the proper packaging
tools for your platform.
To package the application with JRE for your platform, run:
./gradlew jpackage
The platform-specific installer can be found in
desktop/build/jpackage/teal-chess-0.0-1.x86_64.rpm
.
To install the RPM, you can run:
sudo rpm -i desktop/build/jpackage/teal-chess-0.0-1.x86_64.rpm
Then the installed program can be run like:
/opt/teal-chess/bin/teal-chess
And that's it! You can add it to your PATH if you want to run it more easily.
To reinstall the RPM, run:
sudo rpm -e teal-chess-0.0-1.x86_64
sudo rpm -i desktop/build/jpackage/teal-chess-0.0-1.x86_64.rpm
This will first uninstall and then reinstall the RPM, which shouldn't cause problems due to it not having dependencies. The next sections aren't platform-specific.
To clean all build
directories, run:
./gradlew clean
The code is automatically formatted every time the project is compiled. To apply it manually, run:
./gradlew spotlessApply
To run every unit test, run:
./gradlew test
A JaCoCo test coverage report is generated
after running the tests, which can be found at
engine/build/reports/jacoco/test
. This generates HTML, XML and CSV reports
containing the results.
Perft and integration tests are skipped by default. To include them, run:
./gradlew test -PincludeIntegration
To run mutation tests, run:
./gradlew pitest
A Pitest report is generated after running this task.
The report can be found at engine/build/reports/pitest
.
To generate Javadocs for the project's code and see what files are missing documentation, run:
./gradlew javadoc
The generated Javadocs can be found at engine/build/docs/javadoc
,
core/build/docs/javadoc
and desktop/build/docs/javadoc
.
For checking code quality and security, the Gradle SonarQube Plugin is included. I suggest reading the documentation to learn how to use it.