Class TaskModrinthUpload

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.modrinth.minotaur.TaskModrinthUpload
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>

public abstract class TaskModrinthUpload extends org.gradle.api.DefaultTask
A task used to communicate with Modrinth for the purpose of uploading build artifacts.
  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    masecla.modrinth4j.model.version.ProjectVersion
    The response from the API when the file was uploaded successfully.
    Deprecated.
    Please use newVersion instead

    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
    Defines what to do when the Modrinth upload task is invoked.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Input property used to add automatic task dependencies.
    boolean
    Deprecated.
    This check should be done manually

    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, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, 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, getConvention, notCompatibleWithConfigurationCache
  • Field Details

    • newVersion

      @Nullable public masecla.modrinth4j.model.version.ProjectVersion newVersion
      The response from the API when the file was uploaded successfully.
    • uploadInfo

      @Nullable @Deprecated @ScheduledForRemoval(inVersion="3.0.0") public ResponseUpload uploadInfo
      Deprecated.
      Please use newVersion instead
      The response from the API when the file was uploaded successfully.
  • Constructor Details

    • TaskModrinthUpload

      public TaskModrinthUpload()
  • Method Details

    • wasUploadSuccessful

      @Deprecated @ScheduledForRemoval(inVersion="3.0.0") public boolean wasUploadSuccessful()
      Deprecated.
      This check should be done manually
      Checks if the upload was successful or not.
      Returns:
      Whether the file was successfully uploaded.
    • getWiredInputFiles

      @InputFiles @Optional @Internal public abstract org.gradle.api.file.ConfigurableFileCollection getWiredInputFiles()
      Input property used to add automatic task dependencies.
      Returns:
      property
    • apply

      public void apply()
      Defines what to do when the Modrinth upload task is invoked.
      1. Attempts to automatically resolve various metadata items if not specified, throwing an exception if some things still don't have anything set
      2. Resolves each file or task to be uploaded, ensuring they're all valid
      3. Uploads these files to the Modrinth API under a new version
      This is all in a try/catch block so that, if ModrinthExtension.getFailSilently() is enabled, it won't fail the build if it fails to upload the version to Modrinth.