Skip to content

Commit

Permalink
Fix GradleUtils range
Browse files Browse the repository at this point in the history
Explicitly set compression ratio on resulting jar files (#2)
  • Loading branch information
LexManos committed Oct 6, 2024
1 parent 6324f7c commit 604df9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
with:
java: 8
java: 21
gradle_tasks: "publish"
artifact_name: "jarsplitter"
secrets:
Expand Down
15 changes: 7 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.minecraftforge.gradleutils.PomUtils

plugins {
id 'java'
id 'eclipse'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.minecraftforge.gradleutils' version '2.+'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'net.minecraftforge.gradleutils' version '[2.3,2.4)'
}

group = 'net.minecraftforge'
version = gradleutils.getTagOffsetVersion()
version = gradleutils.tagOffsetVersion
println "Version: $version"

java {
Expand Down Expand Up @@ -71,17 +70,17 @@ publishing {
description = 'Splits a jar file into classes and data, used in the Forge installer'
url = 'https://github.com/MinecraftForge/JarSplitter'

PomUtils.setGitHubDetails(pom, 'JarSplitter')
gradleutils.pom.setGitHubDetails(pom, 'JarSplitter')

license PomUtils.Licenses.LGPLv2_1
license gradleutils.pom.Licenses.LGPLv2_1

developers {
developer PomUtils.Developers.LexManos
developer gradleutils.pom.Developers.LexManos
}
}
}

repositories {
maven gradleutils.getPublishingForgeMaven()
maven gradleutils.publishingForgeMaven
}
}
5 changes: 5 additions & 0 deletions src/main/java/net/minecraftforge/jarsplitter/ConsoleTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public static void main(String[] args) throws IOException {
ZipOutputStream zslim = new ZipOutputStream(slim == null ? NULL_OUTPUT : new FileOutputStream(slim));
ZipOutputStream zdata = new ZipOutputStream(data == null ? NULL_OUTPUT : new FileOutputStream(data));
ZipOutputStream zextra = new ZipOutputStream(extra == null ? NULL_OUTPUT : new FileOutputStream(extra))) {
// Explicitly set compression level because of potential differences based on environment.
// See https://github.com/MinecraftForge/JarSplitter/pull/2
zslim.setLevel(6);
zdata.setLevel(6);
zextra.setLevel(6);

ZipEntry entry;
while ((entry = zinput.getNextEntry()) != null) {
Expand Down

0 comments on commit 604df9b

Please sign in to comment.