Class GenerateForgePatchedIntermediateJarTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
net.fabricmc.loom.pipeline.GenerateForgePatchedIntermediateJarTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@CacheableTask public abstract class GenerateForgePatchedIntermediateJarTask extends org.gradle.api.DefaultTask
L3 流水线:生产 Forge 打补丁后的中间 Minecraft jar(minecraft-<type>-<ns>-patched.jar).

它取代的是 MinecraftPatchedProvider.provide() 里那段配置期同步执行的 producePatchedIntermediate:binpatcher 打补丁 → 补出缺失的类 → 删掉 vignette 参数名 → (非 official 的 Forge 系)修补参数注解 → 原子落位。

生产逻辑不在这里

真正的生产仍由 MinecraftPatchedProvider.producePatchedIntermediateForTask(java.nio.file.Path, java.nio.file.Path, java.nio.file.Path, dev.architectury.loom.forge.tool.ForgeExternalToolService.Options, boolean, java.util.function.Consumer<java.lang.String>, java.util.function.Consumer<java.lang.String>) 持有: 配置期路径与执行期任务共用它,因此两条路径的 binpatcher 命令行、类改写顺序与产物逐字节一致。

输入为什么是这些

  • getPrePatchJar():binpatcher 的 {clean},也是补出缺失类的来源;
  • getPatches():binpatcher 的 {patch}(配置期由 type.patches 解析成路径);
  • getBinpatcherTool():工具 classpath、主类与参数模板(惰性,见 MinecraftPatchedProvider.createBinpatcherTool());
  • getFixParameterAnnotations():配置期算好的纯值,判据与旧路径逐字一致 (isForgeLikeAndNotOfficial() && !isUnobfuscatedForge())。
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    任务名:消费侧(本仓库的测试与诊断)按它引用产出任务.

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    abstract org.gradle.api.provider.Property<ForgeExternalToolService.Options>
    binpatcher 工具的声明式选项.
    abstract org.gradle.api.provider.Property<Boolean>
    是否在打补丁后修补参数注解(非 official 的 Forge 系).
    abstract org.gradle.api.file.RegularFileProperty
    产物:打补丁后的中间 jar(与配置期同一条路径).
    abstract org.gradle.api.file.RegularFileProperty
    补丁 jar,即 binpatcher 的 {patch}.
    abstract org.gradle.api.file.RegularFileProperty
    待打补丁的 pre-patch jar,即 binpatcher 的 {clean}.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Field Details

    • NAME

      public static final String NAME
      任务名:消费侧(本仓库的测试与诊断)按它引用产出任务.
      See Also:
  • Constructor Details

    • GenerateForgePatchedIntermediateJarTask

      public GenerateForgePatchedIntermediateJarTask()
  • Method Details

    • getPrePatchJar

      @InputFile @PathSensitive(NONE) public abstract org.gradle.api.file.RegularFileProperty getPrePatchJar()
      待打补丁的 pre-patch jar,即 binpatcher 的 {clean}.
    • getPatches

      @InputFile @PathSensitive(NONE) public abstract org.gradle.api.file.RegularFileProperty getPatches()
      补丁 jar,即 binpatcher 的 {patch}.
    • getBinpatcherTool

      public abstract org.gradle.api.provider.Property<ForgeExternalToolService.Options> getBinpatcherTool()
      binpatcher 工具的声明式选项.
    • getFixParameterAnnotations

      @Input public abstract org.gradle.api.provider.Property<Boolean> getFixParameterAnnotations()
      是否在打补丁后修补参数注解(非 official 的 Forge 系).
    • getOutputJar

      @OutputFile public abstract org.gradle.api.file.RegularFileProperty getOutputJar()
      产物:打补丁后的中间 jar(与配置期同一条路径).
    • generate

      public void generate() throws Exception
      Throws:
      Exception