getVersion in Mod.java, source publishing to Maven

This commit is contained in:
Natty 2022-04-06 15:06:26 +02:00
parent d0f250752e
commit 6cbd3133e7
No known key found for this signature in database
GPG Key ID: 40AB22FA416C7019
6 changed files with 23 additions and 10 deletions

View File

@ -1,4 +1,4 @@
## Features targeted for 22.0.0.0-alpha.1 ## Features targeted for 22.1.0.0-alpha.0
* `[PlutoGUI]` Initial implementation of the new font renderer * `[PlutoGUI]` Initial implementation of the new font renderer
* Full rewrite * Full rewrite
* High quality font rendering * High quality font rendering
@ -7,7 +7,7 @@
* Improve upon the support of thread-local Pluto instances * Improve upon the support of thread-local Pluto instances
* The long term goal is to allow an unlimited amount of Pluto applications at any given time * The long term goal is to allow an unlimited amount of Pluto applications at any given time
## Features targeted for 22.0.0.0-alpha.2 ## Features targeted for 22.2.0.0-alpha.0
* The stage subsystem * The stage subsystem
* A "stage", in this context, is a set of assets bound together * A "stage", in this context, is a set of assets bound together
by programming logic, not necessarily a game level. by programming logic, not necessarily a game level.

View File

@ -1,3 +1,7 @@
## 22.2.0.0-alpha.1
* `[SDK]` Jar sources and JavaDoc are now published
* `[PlutoRuntime]` `Mod` objects now properly contain the version number
## 22.2.0.0-alpha.0 ## 22.2.0.0-alpha.0
* Version bumped to 2022 * Version bumped to 2022
* `[SDK]` Maven version is now properly set again * `[SDK]` Maven version is now properly set again

View File

@ -22,7 +22,7 @@ object Versions {
const val isPrerelease = true const val isPrerelease = true
const val prereleaseName = "alpha" const val prereleaseName = "alpha"
const val prerealeaseUpdate = 0 const val prerealeaseUpdate = 1
val versionFull = val versionFull =
if (isPrerelease) if (isPrerelease)

View File

@ -30,6 +30,9 @@ subprojects {
configure<JavaPluginExtension> { configure<JavaPluginExtension> {
sourceCompatibility = Versions.javaTargetVersion sourceCompatibility = Versions.javaTargetVersion
targetCompatibility = Versions.javaTargetVersion targetCompatibility = Versions.javaTargetVersion
withJavadocJar()
withSourcesJar()
} }
configure<SourceSetContainer> { configure<SourceSetContainer> {

View File

@ -32,25 +32,26 @@ import java.util.Objects;
public class Mod implements Comparable<Mod> public class Mod implements Comparable<Mod>
{ {
private final VirtualAddress id; private final VirtualAddress id;
private final String version;
private final Class<?>[] dependencies;
private Class<?> mainClass; private Class<?> mainClass;
private Class<?>[] dependencies;
private ModManifest manifest; private ModManifest manifest;
private ResourceManager resourceManager; private ResourceManager resourceManager;
private Mod(VirtualAddress id) public Mod(VirtualAddress id, String version, Class<?>[] dependencies)
{ {
this.id = id; this.id = id;
this.version = version;
this.dependencies = dependencies;
} }
static Mod from(VirtualAddress modID, Class<?>[] dependencies, Class<?> mainClass) static Mod from(VirtualAddress modID, Class<?>[] dependencies, String version, Class<?> mainClass)
{ {
var mod = new Mod(modID); var mod = new Mod(modID, version, dependencies);
mod.mainClass = mainClass; mod.mainClass = mainClass;
mod.dependencies = dependencies;
var modIDStr = mod.id.toString(); var modIDStr = mod.id.toString();
@ -109,6 +110,11 @@ public class Mod implements Comparable<Mod>
return this.mainClass; return this.mainClass;
} }
public String getVersion()
{
return this.version;
}
public Class<?>[] getDependencies() public Class<?>[] getDependencies()
{ {
return this.dependencies; return this.dependencies;

View File

@ -102,7 +102,7 @@ public final class ModLoader extends PlutoLocalComponent
return; return;
} }
var mod = Mod.from(modID, modInterface.dependencies(), modClass); var mod = Mod.from(modID, modInterface.dependencies(), modInterface.version(), modClass);
this.modNameLookup.put(modID, mod); this.modNameLookup.put(modID, mod);
this.modLookup.put(modClass, mod); this.modLookup.put(modClass, mod);