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 Details

  • Method Details

    • getPublishingForgeMaven

      default Action<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

      Action<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

      Action<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 Action<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

      Action<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 Action<MavenArtifactRepository> getPublishingForgeMaven(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

      Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, 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 Action<MavenArtifactRepository> getPublishingForgeMaven(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

      Action<MavenArtifactRepository> getPublishingForgeMaven(String fallbackPublishingEndpoint, 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(Provider<T> value)
      Unpacks a deferred value.
      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(ProviderConvertible<T> value)
      Unpacks a deferred value.
      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(Closure<T> value)
      Unpacks a deferred value.
      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(Callable<T> value)
      Unpacks a deferred value.
      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(kotlin.jvm.functions.Function0<T> value)
      Unpacks a deferred value.
      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(Supplier<T> value)
      Unpacks a deferred value.
      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(Object value)

      Unpacks a deferred value.

      Since buildscripts are dynamically compiled, this allows buildscript authors to use this method with version catalog entries, other provider-like objects. This prevents the need to arbitrarily call Provider.get() (or similar) on values which may or may not be deferred based on circumstance.

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