Interface GradleUtilsExtension

All Known Subinterfaces:
GradleUtilsExtensionForProject

public sealed interface GradleUtilsExtension permits GradleUtilsExtensionForProject (not exhaustive)
Contains various utilities for working with Gradle scripts.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    A closure for the Forge maven to be passed into RepositoryHandler.maven(Closure).
    static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    A closure for the Forge releases maven to be passed into RepositoryHandler.maven(Closure).
    static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    A closure for the Minecraft libraries maven to be passed into RepositoryHandler.maven(Closure).
    static final String
    The name for this extension.
  • Method Summary

    Modifier and Type
    Method
    Description
    Utilities for working with a MavenPom for publishing artifacts.
    default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(String fallbackPublishingEndpoint)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(String fallbackPublishingEndpoint, Object defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(String fallbackPublishingEndpoint, org.gradle.api.file.Directory defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(String fallbackPublishingEndpoint, org.gradle.api.provider.Provider<?> defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(org.gradle.api.file.Directory defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository>
    getPublishingForgeMaven(org.gradle.api.provider.Provider<?> defaultFolder)
    Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.
    default <T> T
    unpack(org.gradle.api.provider.Provider<T> value)
    Unpacks a provider's value.
    default <T> T
    unpack(org.gradle.api.provider.ProviderConvertible<T> value)
    Unpacks a provider convertible's provided value.
  • Field Details

    • NAME

      static final String NAME
      The name for this extension.
      See Also:
    • forgeMaven

      static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> forgeMaven
      A closure for the Forge maven to be passed into RepositoryHandler.maven(Closure).
      
       repositories {
           maven fg.forgeMaven
       }
       
    • forgeReleaseMaven

      static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> forgeReleaseMaven
      A closure for the Forge releases maven to be passed into RepositoryHandler.maven(Closure).
      
       repositories {
           maven fg.forgeReleaseMaven
       }
       
      See Also:
    • minecraftLibsMaven

      static final org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> minecraftLibsMaven
      A closure for the Minecraft libraries maven to be passed into RepositoryHandler.maven(Closure).
      
       repositories {
           maven fg.minecraftLibsMaven
       }
       
  • Method Details

    • getPublishingForgeMaven

      default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven()

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.

      Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be a local folder named repo on the root of the build directory.

      If the MAVEN_URL_RELEASE variable is not set, the Forge releases repository will be used (https://maven.minecraftforge.net/releases).

      Returns:
      The closure
    • getPublishingForgeMaven

      org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.

      Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be a local folder named repo on the root of the build directory.

      If the MAVEN_URL_RELEASE variable is not set, the passed in fallback URL will be used for the release repository.

      Parameters:
      fallbackPublishingEndpoint - The fallback URL for the release repository
      Returns:
      The closure
    • getPublishingForgeMaven

      org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, Object defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block. Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL(_RELEASE) variable is not set, the passed in fallback URL will be used for the release repository.

      Parameters:
      fallbackPublishingEndpoint - The fallback URL for the release repository
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(File defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.

      Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL_RELEASE variable is not set, the Forge releases repository will be used (https://maven.minecraftforge.net/releases).

      Parameters:
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block. Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL(_RELEASE) variable is not set, the passed in fallback URL will be used for the release repository.

      Parameters:
      fallbackPublishingEndpoint - The fallback URL for the release repository
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(org.gradle.api.file.Directory defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.

      Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL_RELEASE variable is not set, the Forge releases repository will be used (https://maven.minecraftforge.net/releases).

      Parameters:
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, org.gradle.api.file.Directory defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block. Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL(_RELEASE) variable is not set, the passed in fallback URL will be used for the release repository.

      Parameters:
      fallbackPublishingEndpoint - The fallback URL for the release repository
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      default org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(org.gradle.api.provider.Provider<?> defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block.

      Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL_RELEASE variable is not set, the Forge releases repository will be used (https://maven.minecraftforge.net/releases).

      Parameters:
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPublishingForgeMaven

      org.gradle.api.Action<org.gradle.api.artifacts.repositories.MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, org.gradle.api.provider.Provider<?> defaultFolder)

      Get a configuring closure to be passed into RepositoryHandler.maven(Closure) in a publishing block. Important: The following environment variables must be set for this to work:

      • MAVEN_USER: Containing the username to use for authentication
      • MAVEN_PASSWORD: Containing the password to use for authentication

      The following environment variables are optional:

      • MAVEN_URL(_RELEASE): Containing the URL to use for the release repository
      • Please note that since Forge does not have a snapshot repository, snapshot maven publishing via GradleUtils is no longer supported as of 3.0.0.

      If the required environment variables are not present, the output Maven will be set to the given default folder.

      If the MAVEN_URL(_RELEASE) variable is not set, the passed in fallback URL will be used for the release repository.

      Parameters:
      fallbackPublishingEndpoint - The fallback URL for the release repository
      defaultFolder - The default folder if the required maven information is not set
      Returns:
      The closure
    • getPom

      PomUtils getPom()
      Utilities for working with a MavenPom for publishing artifacts.
      Returns:
      The POM utilities
      See Also:
    • unpack

      default <T> T unpack(org.gradle.api.provider.Provider<T> value)

      Unpacks a provider's value.

      Since buildscripts are dynamically compiled, this allows buildscript authors to use this method with version catalog entries. On compilation, either this method or unpack(ProviderConvertible) will be used depending on what the input is. This prevents the need to arbitrarily call Provider.get() on values which could either be a Provider or ProviderConvertible based on circumstance.

      Type Parameters:
      T - The type of value held by the provider
      Parameters:
      value - The value to unpack
      Returns:
      The unpacked value
      See Also:
    • unpack

      default <T> T unpack(org.gradle.api.provider.ProviderConvertible<T> value)

      Unpacks a provider convertible's provided value.

      Since buildscripts are dynamically compiled, this allows buildscript authors to use this method with version catalog entries. On compilation, either this method or unpack(Provider) will be used depending on what the input is. This prevents the need to arbitrarily call ProviderConvertible.asProvider() -> Provider.get() on values which could either be a Provider or ProviderConvertible based on circumstance.

      Type Parameters:
      T - The type of value held by the provider
      Parameters:
      value - The value to unpack
      Returns:
      The unpacked value
      See Also: