Interface GradleUtilsExtension.ForProject

All Superinterfaces:
GradleUtilsExtension
Enclosing interface:
GradleUtilsExtension

public static sealed interface GradleUtilsExtension.ForProject extends GradleUtilsExtension

The GradleUtils extension for projects, which include additional utilities that are only available for them.

When applied, GradleUtils will

  • Create a referenceable PomUtils instance in getPom().
  • Register the generateActionsWorkflow task to the project for generating a default template GitHub Actions workflow.
  • Register the configureTeamCity task to the project for working with TeamCity CI pipelines.
See Also:
  • Method Details

    • getPom

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

      default Closure getPublishingForgeMaven()

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

      This closure respects the current project's version in regard to publishing to a release or snapshot repository.

      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
      • MAVEN_URL_SNAPSHOT: Containing the URL to use for the snapshot repository

      If the required environment variables are not present, the output Maven will be a local folder named repo on the root of the project 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

      Closure getPublishingForgeMaven(String fallbackPublishingEndpoint)

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

      This closure respects the current project's version in regard to publishing to a release or snapshot repository.

      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
      • MAVEN_URL_SNAPSHOT: Containing the URL to use for the snapshot repository

      If the required environment variables are not present, the output Maven will be a local folder named repo on the root of the project 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

      default Closure getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder)

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

      This closure respects the current project's version in regard to publishing to a release or snapshot repository.

      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
      • MAVEN_URL_SNAPSHOT: Containing the URL to use for the snapshot repository

      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

      Closure getPublishingForgeMaven(String fallbackPublishingEndpoint, File defaultFolder, File defaultSnapshotFolder)

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

      This closure respects the current project's version in regard to publishing to a release or snapshot repository.

      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
      • MAVEN_URL_SNAPSHOT: Containing the URL to use for the snapshot repository

      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
      defaultSnapshotFolder - The default folder for the snapshot repository if the required maven information is not set
      Returns:
      The closure