Skip to content

Commit

Permalink
update MapJarTask and subclasses
Browse files Browse the repository at this point in the history
update CheckTargetVersionExistsTask (will convert to BuildServerice later)
add TargetVersionConsumingTask interface for CheckTargetVersionExistsTask consumers
update CheckUnpickVersionsMatchTask (will convert to BuildServerice later)
add UnpickVersionsMatchConsumingTask for CheckUnpickVersionsMatchTask consumers
separate ExtractTargetMappingJarTask from DownloadTargetMappingJarTask and remove output files that just pointed to individual extracted files
clean up the rest of the diff tasks (still WIP)
move unpickTargetJar from build.gradle to buildSrc and give add a type for it: UnpickTargetJarTask
move remapTargetUnpickDefinitions from build.gradle to buildSrc and add a type for it: RemapTargetUnpickDefinitionsTask
move decompileTargetVineflower from build.gradle to buildSrc and add a type for it: DecompileTargetTask
add more TODOs based on @lukebemish's early review
  • Loading branch information
supersaiyansubtlety committed Oct 4, 2024
1 parent 6391a20 commit f80e79a
Show file tree
Hide file tree
Showing 21 changed files with 546 additions and 249 deletions.
46 changes: 2 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import quilt.internal.tasks.build.AddProposedMappingsTask
import quilt.internal.tasks.build.MappingsV2JarTask
import quilt.internal.tasks.build.TransformJarClassesTask
import quilt.internal.tasks.decompile.DecompileTask
import quilt.internal.tasks.diff.ExtractTargetMappingJarTask
import quilt.internal.tasks.jarmapping.MapPerVersionMappingsJarTask
import quilt.internal.tasks.mappings.EnigmaMappingsTask
import quilt.internal.tasks.unpick.RemapUnpickDefinitionsTask
Expand Down Expand Up @@ -169,6 +170,7 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.constants.allSource
}

// TODO despaghetify this
task unpickHashedJar(type: UnpickJarTask) {
inputFile.set mappings.fileConstants.perVersionMappingsJar
outputFile.set mappings.fileConstants.unpickedJar
Expand Down Expand Up @@ -301,50 +303,6 @@ task decompileVineflower(type: DecompileTask, dependsOn: [mapNamedJar]) {
}
}

task remapTargetUnpickDefinitions(type: RemapUnpickDefinitionsTask) {
dependsOn "checkUnpickVersionsMatch", "downloadTargetMappingsJar"
output.set downloadTargetMappingsJar.targetUnpickRemappedDefinitionsFile
mappings.set downloadTargetMappingsJar.targetMappingsFile
input.set downloadTargetMappingsJar.targetUnpickDefinitionsFile

onlyIf {
checkUnpickVersionsMatch.match
}
}

task unpickTargetJar(type: UnpickJarTask) {
dependsOn "checkUnpickVersionsMatch", "downloadMinecraftLibraries", "remapTargetUnpickDefinitions", "mapPerVersionMappingsJar"

inputFile.set mappings.fileConstants.perVersionMappingsJar
outputFile.set remapTargetMinecraftJar.inputJar
unpickDefinition.set remapTargetUnpickDefinitions.output
unpickConstantsJar.set downloadTargetMappingsJar.targetUnpickConstantsFile

onlyIf {
checkUnpickVersionsMatch.match
}
}

task decompileTargetVineflower(type: DecompileTask, dependsOn: [remapTargetMinecraftJar]) {
input.set remapTargetMinecraftJar.outputJar
output.set file("namedTargetSrc")
decompiler = Decompilers.VINEFLOWER
libraries = files(configurations.decompileClasspath)

doFirst {
file("namedTargetSrc").deleteDir()

def javadocProvider = new MappingsJavadocProvider(downloadTargetMappingsJar.targetMappingsFile.get().getAsFile(), "named")
classJavadocProvider(javadocProvider)
fieldJavadocProvider(javadocProvider)
methodJavadocProvider(javadocProvider)
}

onlyIf {
checkUnpickVersionsMatch.match
}
}

javadoc {
dependsOn genFakeSource
dependsOn downloadMinecraftLibraries
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/java/quilt/internal/MappingsExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import java.io.IOException;

public abstract class MappingsExtension {
// TODO see if this can use a BuildService
/**
* {@link MappingsPlugin} configures all
* {@link quilt.internal.tasks.EnigmaProfileConsumingTask EnigmaProfileConsumingTask}s to use this profile.
*/
public final Provider<EnigmaProfile> enigmaProfile;

private final FileConstants fileConstants;
Expand Down
Loading

0 comments on commit f80e79a

Please sign in to comment.