From 5958ffa437e93b887a2dbe07cdf5d0d079163295 Mon Sep 17 00:00:00 2001 From: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:08:13 -0300 Subject: [PATCH] Reintroduce source JARs, fix eternal ticks --- build.gradle | 4 ++++ buildSrc/src/main/groovy/mod_conventions.gradle | 12 ++++++++++++ .../zoom/transitions/LinearTransitionMode.java | 2 +- .../zoom/transitions/SmoothTransitionMode.java | 2 +- fabric/build.gradle | 6 ++++++ norge/build.gradle | 7 +++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index d703edf5..770920cf 100644 --- a/build.gradle +++ b/build.gradle @@ -7,3 +7,7 @@ plugins { tasks.named('jar').configure { it.enabled = false } + +tasks.named('sourcesJar').configure { + it.enabled = false +} diff --git a/buildSrc/src/main/groovy/mod_conventions.gradle b/buildSrc/src/main/groovy/mod_conventions.gradle index 4bb77d6d..818dc1c5 100644 --- a/buildSrc/src/main/groovy/mod_conventions.gradle +++ b/buildSrc/src/main/groovy/mod_conventions.gradle @@ -6,6 +6,10 @@ String createVersionString() { version = createVersionString() group = 'io.github.ennuil.ok_zoomer' +java { + withSourcesJar() +} + tasks.named('jar').configure { inputs.files('LICENSE.md') @@ -14,6 +18,14 @@ tasks.named('jar').configure { } } +tasks.named('sourcesJar').configure { + inputs.files('LICENSE.md') + + it.from(rootDir.toPath().resolve('LICENSE.md')) { + it.rename { "LICENSE_ok_zoomer.md" } + } +} + tasks.withType(JavaCompile).configureEach { it.options.release.set(21) } diff --git a/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/LinearTransitionMode.java b/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/LinearTransitionMode.java index 588df759..e4dbff56 100644 --- a/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/LinearTransitionMode.java +++ b/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/LinearTransitionMode.java @@ -24,7 +24,7 @@ public LinearTransitionMode(double minimumLinearStep, double maximumLinearStep) @Override public boolean getActive() { - return this.active || this.internalMultiplier != 1.0F || this.internalFade != 1.0F; + return this.active || this.internalMultiplier != 1.0F || this.internalFade != 0.0F; } @Override diff --git a/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/SmoothTransitionMode.java b/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/SmoothTransitionMode.java index 9ea95b11..1e408d2a 100644 --- a/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/SmoothTransitionMode.java +++ b/common/src/main/java/io/github/ennuil/ok_zoomer/zoom/transitions/SmoothTransitionMode.java @@ -25,7 +25,7 @@ public SmoothTransitionMode() { @Override public boolean getActive() { - return this.active || this.internalMultiplier != 1.0F || this.internalFade != 1.0F; + return this.active || this.internalMultiplier != 1.0F || this.internalFade != 0.0F; } @Override diff --git a/fabric/build.gradle b/fabric/build.gradle index f3e38a34..7105736e 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -97,4 +97,10 @@ tasks.named('jar').configure { from(zipTree(project(':common').tasks.named('jar').get().archiveFile)) } +tasks.named('sourcesJar').configure { + it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + from(zipTree(project(':common').tasks.named('sourcesJar').get().archiveFile)) +} + remapJar.getDestinationDirectory().set(layout.buildDirectory.dir('libs')) diff --git a/norge/build.gradle b/norge/build.gradle index 1303b978..cb4185b9 100644 --- a/norge/build.gradle +++ b/norge/build.gradle @@ -56,6 +56,13 @@ tasks.withType(ProcessResources).matching(notNorgeTask).configureEach { tasks.jar.getDestinationDirectory().set(layout.buildDirectory.dir('libs')) +// This will likely explode somehow.. +tasks.named('sourcesJar').configure { + it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + from(zipTree(project(':common').tasks.named('sourcesJar').get().archiveFile)) +} + neoForge { version = libs.versions.neoforge