From e223ae3294f4e21bd347924d746f5c7184055161 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:02:34 -0500 Subject: [PATCH] Apply additional Gradle changes from Konica --- build.gradle | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index fa7f8359..789a751c 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ import net.fabricmc.loom.task.RemapJarTask plugins { id 'com.github.johnrengelman.shadow' version '7.0.0' - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.0-SNAPSHOT' id 'java' id 'maven-publish' } @@ -94,16 +94,21 @@ tasks.withType(JavaCompile) { options.encoding = "UTF-8" } -// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task -// if it is present. -// If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() } shadowJar { configurations = [project.configurations.shadow] + relocate("org.bstats", "org.geysermc.floodgate.shadow.org.bstats") + + exclude { + FileTreeElement e -> + e.name.startsWith("com.google") && !e.name.startsWith("com.google.inject") // Guava and Gson + } } task remappedShadowJar(type: RemapJarTask) { @@ -124,19 +129,12 @@ artifacts { publishing { publications { mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } + from components.java } } // select the repositories you want to publish to repositories { - // uncomment to publish to the local maven mavenLocal() } }