From d12eb2ac2981eb7d74cb6323136591a7ba5dd003 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 17 Jun 2024 22:40:35 +0100 Subject: [PATCH] build: ensure fabric jar is correctly remapped --- fabric-1.20.1/build.gradle | 20 +++++++++++++++----- fabric-1.20.6/build.gradle | 20 +++++++++++++++----- gradle.properties | 2 +- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/fabric-1.20.1/build.gradle b/fabric-1.20.1/build.gradle index b896dcc..1caf98d 100644 --- a/fabric-1.20.1/build.gradle +++ b/fabric-1.20.1/build.gradle @@ -1,12 +1,10 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'java-library' id 'maven-publish' } dependencies { - shadow project(path: ':common') - minecraft 'com.mojang:minecraft:1.20.1' mappings 'net.fabricmc:yarn:1.20.1+build.10:v2' @@ -14,9 +12,10 @@ dependencies { modCompileOnly 'net.fabricmc.fabric-api:fabric-api:0.92.2+1.20.1' modImplementation include('me.lucko:fabric-permissions-api:0.3.1') - compileOnly 'org.projectlombok:lombok:1.18.32' - + modCompileOnly 'org.projectlombok:lombok:1.18.32' annotationProcessor 'org.projectlombok:lombok:1.18.32' + + shadow project(path: ':common') } loom { @@ -25,10 +24,21 @@ loom { shadowJar { configurations = [project.configurations.shadow] + destinationDirectory.set(file("$projectDir/build/libs")) exclude('net.fabricmc:.*') exclude('net.kyori:.*') exclude '/mappings/*' } +remapJar { + dependsOn tasks.shadowJar + mustRunAfter tasks.shadowJar + inputFile = shadowJar.archiveFile.get() + addNestedDependencies = true + + destinationDirectory.set(file("$rootDir/target/")) + archiveClassifier.set('') +} + shadowJar.finalizedBy(remapJar) \ No newline at end of file diff --git a/fabric-1.20.6/build.gradle b/fabric-1.20.6/build.gradle index 2722a06..83ee44b 100644 --- a/fabric-1.20.6/build.gradle +++ b/fabric-1.20.6/build.gradle @@ -1,12 +1,10 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'java-library' id 'maven-publish' } dependencies { - shadow project(path: ':common') - minecraft 'com.mojang:minecraft:1.20.6' mappings 'net.fabricmc:yarn:1.20.6+build.3:v2' @@ -14,9 +12,10 @@ dependencies { modCompileOnly 'net.fabricmc.fabric-api:fabric-api:0.100.0+1.20.6' modImplementation include('me.lucko:fabric-permissions-api:0.3.1') - compileOnly 'org.projectlombok:lombok:1.18.32' - + modCompileOnly 'org.projectlombok:lombok:1.18.32' annotationProcessor 'org.projectlombok:lombok:1.18.32' + + shadow project(path: ':common') } loom { @@ -25,10 +24,21 @@ loom { shadowJar { configurations = [project.configurations.shadow] + destinationDirectory.set(file("$projectDir/build/libs")) exclude('net.fabricmc:.*') exclude('net.kyori:.*') exclude '/mappings/*' } +remapJar { + dependsOn tasks.shadowJar + mustRunAfter tasks.shadowJar + inputFile = shadowJar.archiveFile.get() + addNestedDependencies = true + + destinationDirectory.set(file("$rootDir/target/")) + archiveClassifier.set('') +} + shadowJar.finalizedBy(remapJar) \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 03b6d84..276146f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ javaVersion=17 org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.daemon=true -library_version=1.1 +library_version=1.1.1 library_archive=uniform library_description=Cross-platform wrapper for making Brigadier commands, based on BrigadierWrapper by Tofaa2, itself inspired by emortalmcs command system. \ No newline at end of file