Class ModrinthExtension


public class ModrinthExtension extends DependencyDSL
Class defining the extension used for configuring TaskModrinthUpload. This is done via the modrinth {...} block in the buildscript.
  • Field Details

    • gameVersions

      public final org.gradle.api.provider.ListProperty<String> gameVersions
    • loaders

      public final org.gradle.api.provider.ListProperty<String> loaders
    • DEFAULT_API_URL

      public static final String DEFAULT_API_URL
      The default API URL in use for uploading. Exposed as a fallback utility.
      See Also:
    • STAGING_API_URL

      public static final String STAGING_API_URL
      The staging API URL if desired for testing.
      See Also:
    • DEFAULT_TOKEN

      @Deprecated public static final String DEFAULT_TOKEN
      Deprecated.
      The default token in use for uploading. Exposed as a fallback utility.
    • DEFAULT_CHANGELOG

      public static final String DEFAULT_CHANGELOG
      The default changelog if one was not provided. Exposed as a fallback utility.
      See Also:
    • DEFAULT_VERSION_TYPE

      public static final String DEFAULT_VERSION_TYPE
      The default release type if one was not provided. Exposed as a fallback utility.
      See Also:
  • Constructor Details

    • ModrinthExtension

      public ModrinthExtension(org.gradle.api.Project project)
      Parameters:
      project - The Gradle project that the extension is applied to
  • Method Details

    • additionalFiles

      public void additionalFiles(org.gradle.api.Action<? super AdditionalFileDSL> action)
    • getAdditionalFileDsl

      public AdditionalFileDSL getAdditionalFileDsl()
    • getApiUrl

      public org.gradle.api.provider.Property<String> getApiUrl()
      This should not be changed unless you know what you're doing. Its main use case is for debug, development, or advanced user configurations.
      Returns:
      The URL used for communicating with Modrinth.
    • getToken

      public org.gradle.api.provider.Property<String> getToken()
      Make sure you keep this private!
      Returns:
      The API token used to communicate with Modrinth.
    • getProjectId

      public org.gradle.api.provider.Property<String> getProjectId()
      Returns:
      The ID of the project to upload the file to.
    • getVersionNumber

      public org.gradle.api.provider.Property<String> getVersionNumber()
      Returns:
      The version number of the project being uploaded.
    • getVersionName

      public org.gradle.api.provider.Property<String> getVersionName()
      Returns:
      The version name of the project being uploaded. Defaults to the version number.
    • getChangelog

      public org.gradle.api.provider.Property<String> getChangelog()
      Returns:
      A list or summary of each of the changes made to the project since the last update.
    • getUploadFile

      public org.gradle.api.provider.Property<Object> getUploadFile()
      Returns:
      The upload artifact file. This can be any object type that is resolvable by Util.resolveFile(Project, Object).
    • getFile

      public org.gradle.api.file.RegularFileProperty getFile()
      The upload artifact file.
      Returns:
      file property
    • getAdditionalFiles

      public org.gradle.api.provider.ListProperty<Object> getAdditionalFiles()
      Returns:
      Any additional files to be uploaded to the new version.
    • getVersionType

      public org.gradle.api.provider.Property<String> getVersionType()
      Returns:
      The version type for the project. See ProjectVersion.VersionType.
    • getGameVersions

      public org.gradle.api.provider.ListProperty<String> getGameVersions()
      Returns:
      The game versions of the game the version supports.
    • getLoaders

      public org.gradle.api.provider.ListProperty<String> getLoaders()
      Returns:
      The mod loaders of the game the version supports.
    • getDependencies

      public org.gradle.api.provider.ListProperty<Dependency> getDependencies()
      Returns:
      The dependencies of the version.
    • getFailSilently

      public org.gradle.api.provider.Property<Boolean> getFailSilently()
      Returns:
      Whether the build should continue even if the upload failed.
    • getDetectLoaders

      public org.gradle.api.provider.Property<Boolean> getDetectLoaders()
      Returns:
      Whether the plugin will try to define loaders based on other plugins in the project environment.
    • getDebugMode

      public org.gradle.api.provider.Property<Boolean> getDebugMode()
      Returns:
      Whether the plugin is in debug mode. Debug mode does not actually upload any files.
    • getSyncBodyFrom

      public org.gradle.api.provider.Property<String> getSyncBodyFrom()
      Returns:
      The file to sync the project's body description from
    • getAutoAddDependsOn

      public org.gradle.api.provider.Property<Boolean> getAutoAddDependsOn()
      Returns:
      Whether to automatically add the `dependsOn` information for upload files