Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 20 additions & 2 deletions api/src/main/java/org/applecommander/bastools/api/BasTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading