Release v1.0.2
Added:
- Builder API for ConsoleProgressBar and ConsoleSpinner — readable configuration via
builder().total(100).style(Style.BLOCKS).build() - AutoCloseable — try-with-resources support for both classes
- AnsiColor — a utility class for ANSI RGB codes has been extracted;
duplicate gradient logic has been removed ConsoleSpinner.isRunning()— checking the spinner's status from outsideConsoleSpinner.setMessage()— changing the message while the spinner is runningConsoleProgressBar.getPercentage()— retrieves the current percentage- JUnit 5 Tests — 35 unit tests for ConsoleProgressBar, ConsoleSpinner, and AnsiColor
- LICENSE — MIT license file added
Fixed:
- Main.java has been removed from the JAR, the demo class has been moved to
src/test/java;
mainClass has been removed from the maven-jar-plugin, and the published JAR no longer contains an entry point - Division by zero — added validation for
total > 0andbarLength > 0in constructors, resulting in anIllegalArgumentException - CENTER position — the percentage is now correctly centered on the bar without any visual artifacts
- Arrow style at 0% — the incorrect gradient color for the empty arrow has been removed
ConsoleSpinner.stop()— the length of the string to be cleared is calculated dynamically instead of usingmessage.length() + 20- GPG plugin — moved to the release Maven profile;
mvn installnow works without a GPG key - maven-compiler-plugin — uses
--release 21instead of source/target for strict compatibility - Thread safety —
update()andfinish()in ConsoleProgressBar andstart()andstop()in ConsoleSpinner are synchronized;
themessagein ConsoleSpinner is marked asvolatile
Full Changelog: v1.0.1...v1.0.2