Fix issues with Spigot mapping generation
Also make build reproducible by removing mavenLocal() as the necessary fixes are now deployed to the remote repos.
This commit is contained in:
parent
f3b6069723
commit
5978cca674
3 changed files with 12 additions and 21 deletions
|
@ -13,9 +13,7 @@ group = "io.papermc.paperweight"
|
|||
version = "1.0.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
maven("https://files.minecraftforge.net/maven/")
|
||||
}
|
||||
|
@ -31,8 +29,8 @@ dependencies {
|
|||
implementation("org.ow2.asm:asm:8.0.1")
|
||||
|
||||
// Cadix
|
||||
implementation("org.cadixdev:lorenz:0.5.4-SNAPSHOT")
|
||||
implementation("org.cadixdev:lorenz-asm:0.5.3")
|
||||
implementation("org.cadixdev:lorenz:0.5.5")
|
||||
implementation("org.cadixdev:lorenz-asm:0.5.5")
|
||||
implementation("org.cadixdev:atlas:0.2.0")
|
||||
implementation("org.cadixdev:at:0.1.0-SNAPSHOT")
|
||||
|
||||
|
|
|
@ -94,7 +94,8 @@ fun ControllableOutputTask.applyGitPatches(git: Git, target: String, outputDir:
|
|||
}
|
||||
git("am", "--abort").runSilently(silenceErr = true)
|
||||
|
||||
val patches = patchDir.listFiles { _, name -> name.endsWith(".patch") } ?: run {
|
||||
val patches = patchDir.listFiles { _, name -> name.endsWith(".patch") } ?: emptyArray()
|
||||
if (patches.isEmpty()) {
|
||||
if (printOutput) {
|
||||
println("No patches found")
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ class SpigotPackageMergerHandler(private val newPackage: String) : MappingSetMer
|
|||
): MergeResult<TopLevelClassMapping?> {
|
||||
// If both are provided, keep spigot
|
||||
return MergeResult(
|
||||
target.createTopLevelClassMapping(prependPackage(left.obfuscatedName), prependPackage(left.deobfuscatedName)),
|
||||
target.createTopLevelClassMapping(left.obfuscatedName, prependPackage(left.deobfuscatedName)),
|
||||
right
|
||||
)
|
||||
}
|
||||
|
@ -155,26 +155,19 @@ class SpigotPackageMergerHandler(private val newPackage: String) : MappingSetMer
|
|||
target: MappingSet,
|
||||
context: MergeContext
|
||||
): MergeResult<TopLevelClassMapping?> {
|
||||
return MergeResult(
|
||||
target.createTopLevelClassMapping(prependPackage(left.obfuscatedName), prependPackage(left.deobfuscatedName))
|
||||
)
|
||||
throw IllegalStateException("Unexpectedly add class from Spigot: $left")
|
||||
}
|
||||
override fun addRightTopLevelClassMapping(
|
||||
right: TopLevelClassMapping,
|
||||
target: MappingSet,
|
||||
context: MergeContext
|
||||
): MergeResult<TopLevelClassMapping?> {
|
||||
// We know we don't need client mappings
|
||||
return if (right.deobfuscatedName.contains("/client/")) {
|
||||
MergeResult(null)
|
||||
} else {
|
||||
// This is a mapping Spigot is totally missing, but Spigot maps all classes without a package to
|
||||
// /net/minecraft regardless if there are mappings for the classes or not
|
||||
MergeResult(
|
||||
target.createTopLevelClassMapping(prependPackage(right.obfuscatedName), right.obfuscatedName),
|
||||
right
|
||||
)
|
||||
}
|
||||
// This is a mapping Spigot is totally missing, but Spigot maps all classes without a package to
|
||||
// /net/minecraft regardless if there are mappings for the classes or not
|
||||
return MergeResult(
|
||||
target.createTopLevelClassMapping(right.obfuscatedName, prependPackage(right.obfuscatedName)),
|
||||
right
|
||||
)
|
||||
}
|
||||
|
||||
override fun mergeInnerClassMappings(
|
||||
|
@ -215,7 +208,6 @@ class SpigotPackageMergerHandler(private val newPackage: String) : MappingSetMer
|
|||
): FieldMapping {
|
||||
throw IllegalStateException("Unexpectedly merged field: $left")
|
||||
}
|
||||
|
||||
override fun mergeDuplicateFieldMappings(
|
||||
left: FieldMapping,
|
||||
strictRightDuplicate: FieldMapping?,
|
||||
|
|
Loading…
Reference in a new issue