From 0303d2f2d5fe2169ad68a1fb6344d4198afd8da1 Mon Sep 17 00:00:00 2001 From: a2geek Date: Sat, 10 Oct 2026 18:18:48 -0500 Subject: [PATCH 1/2] Bumping version. --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d189d5a..45caea0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Universal bastools version number. Used for: # - Naming JAR file. # - The build will insert this into a file that is read at run time as well. -version=5.2 +version=5.3 # Maven Central Repository G and A of GAV coordinate. :-) group=org.applecommander From c65b85bd518a9ca4e6bb576ff699401f2ecab234 Mon Sep 17 00:00:00 2001 From: a2geek Date: Sat, 10 Oct 2026 18:19:11 -0500 Subject: [PATCH 2/2] Updating to set VERSION and TITLE for Java module system. --- api/build.gradle | 5 +++++ .../applecommander/bastools/api/BasTools.java | 22 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index 749a0da..afc568c 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -26,6 +26,11 @@ jar { } } +tasks.withType(JavaCompile).configureEach { + options.compilerArgs += ['--module-path', classpath.asPath] + options.javaModuleVersion = project.version.toString() +} + javadoc { title = "bastools ${version}" source = sourceSets.main.allJava diff --git a/api/src/main/java/org/applecommander/bastools/api/BasTools.java b/api/src/main/java/org/applecommander/bastools/api/BasTools.java index e2e867b..96b0d81 100644 --- a/api/src/main/java/org/applecommander/bastools/api/BasTools.java +++ b/api/src/main/java/org/applecommander/bastools/api/BasTools.java @@ -25,8 +25,26 @@ public class BasTools { public static final String VERSION; public static final String TITLE; static { - TITLE = BasTools.class.getPackage().getImplementationTitle(); - VERSION = BasTools.class.getPackage().getImplementationVersion(); + String title = BasTools.class.getPackage().getImplementationTitle(); + if (title == null) { + title = "B/BAS Tools API"; + } + TITLE = title; + + String version = BasTools.class.getPackage().getImplementationVersion(); + if (version == null && BasTools.class.getModule().getDescriptor() != null) { + // When run under the Java Module system (JPMS) we need to get it a different way. + version = BasTools.class.getModule() + .getDescriptor() + .version() + .map(Object::toString) + .orElse("Development Build"); + } + // For unit tests, the descriptor (apparently) doesn't exist, so we skip it. + if (version == null) { + version = "Unit Testing"; + } + VERSION = version; } private BasTools() {}