Class RefreshVersionsManifestTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
net.fabricmc.loom.task.AbstractLoomTask
net.fabricmc.loom.task.RefreshVersionsManifestTask
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>

@DisableCachingByDefault public abstract class RefreshVersionsManifestTask extends AbstractLoomTask
强制刷新 Minecraft 版本清单缓存.

配置期只在清单超过 maxAge(一天)时才尝试联网,且失败时降级用本地副本 (见 MinecraftMetadataProvider)。因此拉取失败不会阻塞构建,代价是清单可能长期停在旧版本。 本任务提供显式入口:拿得到就刷新,拿不到就明确报错,而不是默默继续用旧的。

典型用法:

  • 刚发布新 MC 版本、想让它出现在版本清单里;
  • 怀疑本地清单太旧导致选错了客户端/服务端。

不参与任何其他任务的依赖图,只由人手动调用。

  • Nested Class Summary

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

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

    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
    abstract org.gradle.api.provider.Property<Integer>
    刷新使用的连接超时(秒).
    void
     

    Methods inherited from class net.fabricmc.loom.task.AbstractLoomTask

    getExtension, getModPlatform

    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
  • Constructor Details

    • RefreshVersionsManifestTask

      public RefreshVersionsManifestTask()
  • Method Details

    • getConnectTimeoutSeconds

      @Input public abstract org.gradle.api.provider.Property<Integer> getConnectTimeoutSeconds()
      刷新使用的连接超时(秒).

      比配置期宽容:这是人主动等的一次性操作,不需要「快速失败」。

    • refresh

      public void refresh() throws IOException
      Throws:
      IOException