From 47ce3628a25746fba734176350b77e8764792a71 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:21:22 -0800 Subject: [PATCH] Remove unused feather dep, move jgit dep to core as it's not needed by userdev --- .../src/main/kotlin/config-kotlin.gradle.kts | 7 ------- .../src/main/kotlin/config-publish.gradle.kts | 6 ------ gradle/libs.versions.toml | 4 ---- paperweight-core/build.gradle.kts | 4 +++- .../core/taskcontainers/PatchingTasks.kt | 4 ++-- .../core/taskcontainers/ServerPatchingTasks.kt | 4 ++-- .../core/taskcontainers/SoftSpoonTasks.kt | 2 +- .../paperweight/core/tasks/FilterRepo.kt | 1 - .../paperweight/core/tasks/ForkSetup.kt | 1 - .../paperweight/core/tasks}/SetupVanilla.kt | 7 +------ .../core/tasks/patching}/ApplyFilePatches.kt | 2 +- .../tasks/patching}/ApplyFilePatchesFuzzy.kt | 2 +- .../core/tasks}/ApplyFilePatchesTest.kt | 3 ++- .../apply_patches/input/base/Test.java | 0 .../input/patches/Test.java.patch | 0 .../apply_patches/output/source/Test.java | 0 paperweight-lib/build.gradle.kts | 18 ++++++++++++++---- 17 files changed, 27 insertions(+), 38 deletions(-) rename {paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache => paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks}/SetupVanilla.kt (97%) rename {paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon => paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching}/ApplyFilePatches.kt (99%) rename {paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon => paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching}/ApplyFilePatchesFuzzy.kt (96%) rename {paperweight-lib/src/test/kotlin/io/papermc/paperweight/tasks/softspoon => paperweight-core/src/test/kotlin/io/papermc/paperweight/core/tasks}/ApplyFilePatchesTest.kt (94%) rename {paperweight-lib => paperweight-core}/src/test/resources/apply_patches/input/base/Test.java (100%) rename {paperweight-lib => paperweight-core}/src/test/resources/apply_patches/input/patches/Test.java.patch (100%) rename {paperweight-lib => paperweight-core}/src/test/resources/apply_patches/output/source/Test.java (100%) diff --git a/buildSrc/src/main/kotlin/config-kotlin.gradle.kts b/buildSrc/src/main/kotlin/config-kotlin.gradle.kts index fd30d02ca..e8e4e8e0e 100644 --- a/buildSrc/src/main/kotlin/config-kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/config-kotlin.gradle.kts @@ -40,13 +40,6 @@ repositories { includeGroupAndSubgroups("io.papermc") } } - maven("https://maven.parchmentmc.org") { - name = "ParchmentMC" - mavenContent { - releasesOnly() - includeGroupAndSubgroups("org.parchmentmc") - } - } maven("https://maven.neoforged.net/releases") { name = "NeoForged" mavenContent { diff --git a/buildSrc/src/main/kotlin/config-publish.gradle.kts b/buildSrc/src/main/kotlin/config-publish.gradle.kts index 17c226e71..cbf87bd1d 100644 --- a/buildSrc/src/main/kotlin/config-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/config-publish.gradle.kts @@ -80,12 +80,6 @@ val shadowJar by tasks.existing(ShadowJar::class) { /* -> */ "org.apache.commons", "org.cadixdev", /* -> */ "me.jamiemansfield", - "org.parchmentmc.feather", - /* -> */ "com.google.common", - /* ----> */ "com.google.j2objc", - /* ----> */ "com.google.thirdparty", - /* ----> */ "org.checkerframework", - /* ----> */ "javax.annotation", "org.eclipse.jgit", /* -> */ "com.googlecode.javaewah", /* -> */ "com.googlecode.javaewah32", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e2e790c48..1944725b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,6 @@ asm = "9.7.1" lorenz = "0.5.8" hypo = "1.2.4" serialize = "1.5.1" -feather = "1.1.0" jst = "1.0.68+paper.2-SNAPSHOT" tinyRemapper = "0.10.4" @@ -33,9 +32,6 @@ hypo-mappings = { module = "dev.denwav.hypo:hypo-mappings", version.ref = "hypo" lorenzTiny = "net.fabricmc:lorenz-tiny:3.0.0" jbsdiff = "io.sigpipe:jbsdiff:1.0" -feather-core = { module = "org.parchmentmc:feather", version.ref = "feather" } -feather-gson = { module = "org.parchmentmc.feather:io-gson", version.ref = "feather" } - diffpatch = "codechicken:DiffPatch:1.5.0.30" serialize-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialize" } diff --git a/paperweight-core/build.gradle.kts b/paperweight-core/build.gradle.kts index 0cadfc019..cc389426c 100644 --- a/paperweight-core/build.gradle.kts +++ b/paperweight-core/build.gradle.kts @@ -11,7 +11,9 @@ dependencies { implementation(variantOf(libs.diffpatch) { classifier("all") }) { isTransitive = false } - implementation(libs.jgit) + shade(libs.jgit) + + testImplementation(project(":paperweight-lib", "testClassesJar")) } gradlePlugin { diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/PatchingTasks.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/PatchingTasks.kt index 9521bde26..1eeac482c 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/PatchingTasks.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/PatchingTasks.kt @@ -22,10 +22,10 @@ package io.papermc.paperweight.core.taskcontainers +import io.papermc.paperweight.core.tasks.patching.ApplyFilePatches +import io.papermc.paperweight.core.tasks.patching.ApplyFilePatchesFuzzy import io.papermc.paperweight.tasks.* import io.papermc.paperweight.tasks.softspoon.ApplyFeaturePatches -import io.papermc.paperweight.tasks.softspoon.ApplyFilePatches -import io.papermc.paperweight.tasks.softspoon.ApplyFilePatchesFuzzy import io.papermc.paperweight.tasks.softspoon.FixupFilePatches import io.papermc.paperweight.tasks.softspoon.RebuildFilePatches import io.papermc.paperweight.util.* diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/ServerPatchingTasks.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/ServerPatchingTasks.kt index 72fa59cba..869c6d026 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/ServerPatchingTasks.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/ServerPatchingTasks.kt @@ -24,10 +24,10 @@ package io.papermc.paperweight.core.taskcontainers import io.papermc.paperweight.core.extension.ForkConfig import io.papermc.paperweight.core.tasks.ForkSetup +import io.papermc.paperweight.core.tasks.patching.ApplyFilePatches +import io.papermc.paperweight.core.tasks.patching.ApplyFilePatchesFuzzy import io.papermc.paperweight.tasks.* import io.papermc.paperweight.tasks.softspoon.ApplyFeaturePatches -import io.papermc.paperweight.tasks.softspoon.ApplyFilePatches -import io.papermc.paperweight.tasks.softspoon.ApplyFilePatchesFuzzy import io.papermc.paperweight.tasks.softspoon.FixupFilePatches import io.papermc.paperweight.tasks.softspoon.ImportLibraryFiles import io.papermc.paperweight.tasks.softspoon.RebuildFilePatches diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/SoftSpoonTasks.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/SoftSpoonTasks.kt index 32b23df61..df6fd7bdc 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/SoftSpoonTasks.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/taskcontainers/SoftSpoonTasks.kt @@ -24,10 +24,10 @@ package io.papermc.paperweight.core.taskcontainers import io.papermc.paperweight.core.coreExt import io.papermc.paperweight.core.extension.ForkConfig +import io.papermc.paperweight.core.tasks.SetupVanilla import io.papermc.paperweight.tasks.* import io.papermc.paperweight.tasks.mache.DecompileJar import io.papermc.paperweight.tasks.mache.RemapJar -import io.papermc.paperweight.tasks.mache.SetupVanilla import io.papermc.paperweight.tasks.softspoon.ImportLibraryFiles import io.papermc.paperweight.tasks.softspoon.IndexLibraryFiles import io.papermc.paperweight.tasks.softspoon.SetupPaperScript diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/FilterRepo.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/FilterRepo.kt index 2795ec705..af0ec6379 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/FilterRepo.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/FilterRepo.kt @@ -23,7 +23,6 @@ package io.papermc.paperweight.core.tasks import io.papermc.paperweight.tasks.* -import io.papermc.paperweight.tasks.mache.commitAndTag import io.papermc.paperweight.util.* import io.papermc.paperweight.util.constants.* import org.eclipse.jgit.api.Git diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/ForkSetup.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/ForkSetup.kt index f2fbbb304..68d03d96d 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/ForkSetup.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/ForkSetup.kt @@ -23,7 +23,6 @@ package io.papermc.paperweight.core.tasks import io.papermc.paperweight.tasks.* -import io.papermc.paperweight.tasks.mache.commitAndTag import io.papermc.paperweight.tasks.softspoon.ApplySourceATs import io.papermc.paperweight.util.* import kotlin.io.path.* diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/SetupVanilla.kt similarity index 97% rename from paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt rename to paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/SetupVanilla.kt index 9ae8827f5..148dc8ebb 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/mache/SetupVanilla.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/SetupVanilla.kt @@ -20,7 +20,7 @@ * USA */ -package io.papermc.paperweight.tasks.mache +package io.papermc.paperweight.core.tasks import codechicken.diffpatch.cli.PatchOperation import codechicken.diffpatch.util.LoggingOutputStream @@ -30,7 +30,6 @@ import io.papermc.paperweight.tasks.softspoon.ApplySourceATs import io.papermc.paperweight.util.* import java.nio.file.Path import java.util.function.Predicate -import javax.inject.Inject import kotlin.io.path.* import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.ResetCommand @@ -43,7 +42,6 @@ import org.gradle.api.logging.LogLevel import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.kotlin.dsl.* -import org.gradle.workers.WorkerExecutor abstract class SetupVanilla : JavaLauncherTask() { @@ -69,9 +67,6 @@ abstract class SetupVanilla : JavaLauncherTask() { @get:InputDirectory abstract val macheOld: DirectoryProperty - @get:Inject - abstract val workerExecutor: WorkerExecutor - @get:Nested val ats: ApplySourceATs = objects.newInstance() diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatches.kt similarity index 99% rename from paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt rename to paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatches.kt index 393f06fc3..d2daa0c23 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatches.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatches.kt @@ -20,7 +20,7 @@ * USA */ -package io.papermc.paperweight.tasks.softspoon +package io.papermc.paperweight.core.tasks.patching import codechicken.diffpatch.cli.PatchOperation import codechicken.diffpatch.match.FuzzyLineMatcher diff --git a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesFuzzy.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatchesFuzzy.kt similarity index 96% rename from paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesFuzzy.kt rename to paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatchesFuzzy.kt index 445d4eba0..a84ad8805 100644 --- a/paperweight-lib/src/main/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesFuzzy.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplyFilePatchesFuzzy.kt @@ -20,7 +20,7 @@ * USA */ -package io.papermc.paperweight.tasks.softspoon +package io.papermc.paperweight.core.tasks.patching import codechicken.diffpatch.util.PatchMode import org.gradle.api.provider.Property import org.gradle.api.tasks.Input diff --git a/paperweight-lib/src/test/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesTest.kt b/paperweight-core/src/test/kotlin/io/papermc/paperweight/core/tasks/ApplyFilePatchesTest.kt similarity index 94% rename from paperweight-lib/src/test/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesTest.kt rename to paperweight-core/src/test/kotlin/io/papermc/paperweight/core/tasks/ApplyFilePatchesTest.kt index 74e775c9d..1fdf77e61 100644 --- a/paperweight-lib/src/test/kotlin/io/papermc/paperweight/tasks/softspoon/ApplyFilePatchesTest.kt +++ b/paperweight-core/src/test/kotlin/io/papermc/paperweight/core/tasks/ApplyFilePatchesTest.kt @@ -20,8 +20,9 @@ * USA */ -package io.papermc.paperweight.tasks.softspoon +package io.papermc.paperweight.core.tasks +import io.papermc.paperweight.core.tasks.patching.ApplyFilePatches import io.papermc.paperweight.tasks.* import java.nio.file.Path import kotlin.test.BeforeTest diff --git a/paperweight-lib/src/test/resources/apply_patches/input/base/Test.java b/paperweight-core/src/test/resources/apply_patches/input/base/Test.java similarity index 100% rename from paperweight-lib/src/test/resources/apply_patches/input/base/Test.java rename to paperweight-core/src/test/resources/apply_patches/input/base/Test.java diff --git a/paperweight-lib/src/test/resources/apply_patches/input/patches/Test.java.patch b/paperweight-core/src/test/resources/apply_patches/input/patches/Test.java.patch similarity index 100% rename from paperweight-lib/src/test/resources/apply_patches/input/patches/Test.java.patch rename to paperweight-core/src/test/resources/apply_patches/input/patches/Test.java.patch diff --git a/paperweight-lib/src/test/resources/apply_patches/output/source/Test.java b/paperweight-core/src/test/resources/apply_patches/output/source/Test.java similarity index 100% rename from paperweight-lib/src/test/resources/apply_patches/output/source/Test.java rename to paperweight-core/src/test/resources/apply_patches/output/source/Test.java diff --git a/paperweight-lib/build.gradle.kts b/paperweight-lib/build.gradle.kts index 0de380767..5ac5cc04d 100644 --- a/paperweight-lib/build.gradle.kts +++ b/paperweight-lib/build.gradle.kts @@ -20,7 +20,6 @@ dependencies { implementation(libs.httpclient) implementation(libs.bundles.kotson) implementation(libs.coroutines) - implementation(libs.jgit) // ASM for inspection implementation(libs.bundles.asm) @@ -30,14 +29,25 @@ dependencies { implementation(libs.lorenzTiny) - implementation(libs.feather.core) - implementation(libs.feather.gson) - implementation(libs.jbsdiff) implementation(variantOf(libs.diffpatch) { classifier("all") }) { isTransitive = false } + testImplementation(libs.jgit) testImplementation(libs.mockk) } + +val testClassesJar = tasks.register("testClassesJar") { + archiveClassifier.set("test-classes") + from(sourceSets.test.get().output.classesDirs) + dependsOn(sourceSets.test.get().classesTaskName) +} +configurations.consumable("testClassesJar") { + attributes { + attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) + } + outgoing.artifact(testClassesJar) +}