diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e814a3..3354ca3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -- Fix NPM exception +- Maintenance update diff --git a/README.md b/README.md index 9be8b0c..e75f74d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ModLoaderPlugin -[![Build status](https://github.com/Xpdustry/ModLoaderPlugin/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/Xpdustry/ModLoaderPlugin/actions/workflows/build.yml) +[![Build status](https://github.com/xpdustry/mod-loader/actions/workflows/build.yml/badge.svg?branch=master&event=push)](https://github.com/xpdustry/mod-loader/actions/workflows/build.yml) [![Mindustry 6.0 | 7.0 ](https://img.shields.io/badge/Mindustry-6.0%20%7C%207.0-ffd37f)](https://github.com/Anuken/Mindustry/releases) -[![Xpdustry latest](https://repo.xpdustry.fr/api/badge/latest/releases/fr/xpdustry/mod-loader-plugin?color=00FFFF&name=ModLoaderPlugin&prefix=v)](https://github.com/Xpdustry/ModLoaderPlugin/releases) +[![Xpdustry latest](https://maven.xpdustry.fr/api/badge/latest/releases/fr/xpdustry/mod-loader-plugin?color=00FFFF&name=mod-loader&prefix=v)](https://github.com/Xpdustry/ModLoaderPlugin/releases) ## Description diff --git a/build.gradle.kts b/build.gradle.kts index aaca66e..58242b5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,46 +1,44 @@ -import fr.xpdustry.toxopid.util.ModMetadata -import fr.xpdustry.toxopid.extension.ModTarget +import fr.xpdustry.toxopid.dsl.mindustryDependencies import net.ltgt.gradle.errorprone.CheckSeverity import net.ltgt.gradle.errorprone.errorprone import java.io.ByteArrayOutputStream plugins { - java - `maven-publish` - id("net.ltgt.errorprone") version "2.0.2" - id("fr.xpdustry.toxopid") version "1.3.2" - id("com.github.ben-manes.versions") version "0.42.0" - id("net.kyori.indra") version "2.1.1" - id("net.kyori.indra.publishing") version "2.1.1" + id("net.kyori.indra") version "3.1.2" + id("net.kyori.indra.publishing") version "3.1.2" + id("com.github.johnrengelman.shadow") version "8.1.1" + id("net.ltgt.errorprone") version "3.1.0" + id("fr.xpdustry.toxopid") version "3.2.0" + id("com.github.ben-manes.versions") version "0.47.0" } -val metadata = ModMetadata(file("${rootProject.rootDir}/plugin.json")) +val metadata = fr.xpdustry.toxopid.spec.ModMetadata.fromJson(file("${rootProject.rootDir}/plugin.json")) group = property("props.project-group").toString() version = metadata.version + if (indraGit.headTag() == null) "-SNAPSHOT" else "" toxopid { - modTarget.set(ModTarget.HEADLESS) - arcCompileVersion.set(metadata.minGameVersion) - mindustryCompileVersion.set(metadata.minGameVersion) + compileVersion.set("v${metadata.minGameVersion}") + platforms.add(fr.xpdustry.toxopid.spec.ModPlatform.HEADLESS) } repositories { mavenCentral() + maven("https://maven.xpdustry.com/anuken") { + name = "xpdustry-anuken" + mavenContent { releasesOnly() } + } } dependencies { - val junit = "5.8.2" - testImplementation("org.junit.jupiter:junit-jupiter-params:$junit") - testImplementation("org.junit.jupiter:junit-jupiter-api:$junit") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit") + mindustryDependencies() - val jetbrains = "23.0.0" + val jetbrains = "24.0.1" compileOnly("org.jetbrains:annotations:$jetbrains") testCompileOnly("org.jetbrains:annotations:$jetbrains") // Static analysis - annotationProcessor("com.uber.nullaway:nullaway:0.9.5") - errorprone("com.google.errorprone:error_prone_core:2.11.0") + annotationProcessor("com.uber.nullaway:nullaway:0.10.11") + errorprone("com.google.errorprone:error_prone_core:2.20.0") } tasks.withType(JavaCompile::class.java).configureEach { @@ -54,6 +52,12 @@ tasks.withType(JavaCompile::class.java).configureEach { } } +tasks.shadowJar { + archiveFileName.set("mod-loader.jar") + archiveClassifier.set("plugin") + from(file("${rootProject.rootDir}/plugin.json")) +} + // Required if you want to use the Release GitHub action tasks.create("getArtifactPath") { doLast { println(tasks.shadowJar.get().archiveFile.get().toString()) } @@ -81,6 +85,10 @@ tasks.create("createRelease") { } } +tasks.build { + dependsOn(tasks.shadowJar) +} + signing { val signingKey: String? by project val signingPassword: String? by project @@ -93,24 +101,29 @@ indra { minimumToolchain(17) } - publishReleasesTo("xpdustry", "https://repo.xpdustry.fr/releases") - publishSnapshotsTo("xpdustry", "https://repo.xpdustry.fr/snapshots") + publishReleasesTo("xpdustry", "https://maven.xpdustry.com/releases") + publishSnapshotsTo("xpdustry", "https://maven.xpdustry.com/snapshots") mitLicense() - if (metadata.repo != null) { - val repo = metadata.repo!!.split("/") - github(repo[0], repo[1]) { - ci(true) - issues(true) - scm(true) - } + github("xpdustry", "mod-loader") { + ci(true) + issues(true) + scm(true) } configurePublications { pom { + organization { + name.set("Xpdustry") + url.set("https://www.xpdustry.fr") + } + developers { - developer { id.set(metadata.author) } + developer { + id.set("Phinner") + timezone.set("Europe/Brussels") + } } } } diff --git a/gradle.properties b/gradle.properties index 1a356b6..ccca726 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # The project name, used as the artifact name -props.project-name=mod-loader-plugin +props.project-name=mod-loader # Group of the project, usually a domain backwards such as com.google props.project-group=fr.xpdustry # Root package for NullAway diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..84a0b92 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugin.json b/plugin.json index 4452c47..dee79ab 100644 --- a/plugin.json +++ b/plugin.json @@ -1,13 +1,13 @@ { "name": "xpdustry-mod-loader-plugin", - "displayName": "Xpdustry ModLoader", - "author": "Xpdustry", + "displayName": "ModLoader", + "author": "xpdustry", "description": "A custom mod loader plugin for jvm plugins/mods that rely on dependencies. ", - "version": "1.0.1", - "minGameVersion": "v126.2", + "version": "1.0.2", + "minGameVersion": "126", "hidden": true, "java": true, "main": "fr.xpdustry.loader.ModLoaderPlugin", - "repo": "Xpdustry/ModLoaderPlugin", + "repo": "xpdustry/mod-loader", "dependencies": [] } diff --git a/src/main/java/fr/xpdustry/loader/ModLoaderException.java b/src/main/java/fr/xpdustry/loader/ModLoaderException.java index 3cc0bf5..7f95ab7 100644 --- a/src/main/java/fr/xpdustry/loader/ModLoaderException.java +++ b/src/main/java/fr/xpdustry/loader/ModLoaderException.java @@ -1,7 +1,12 @@ package fr.xpdustry.loader; +import java.io.Serial; + public class ModLoaderException extends Exception { + @Serial + private static final long serialVersionUID = -265108231696587650L; + public ModLoaderException(String message) { super(message); }