Class GitVersionModule

java.lang.Object
com.gtnewhorizons.gtnhgradle.modules.GitVersionModule
All Implemented Interfaces:
GTNHModule

public class GitVersionModule extends Object implements GTNHModule
First checks for a valid git repository in the project, if not found does nothing. Applies the com.palantir.git-version plugin and sets the project version based on the latest git tag and commit hash. Can be disabled by setting a VERSION environment variable.
  • Constructor Details

    • GitVersionModule

      public GitVersionModule()
  • Method Details

    • isEnabled

      public boolean isEnabled(@NotNull @NotNull PropertiesConfiguration configuration)
      Specified by:
      isEnabled in interface GTNHModule
      Parameters:
      configuration - The project configuration
      Returns:
      If this module should be enabled for the input project settings
    • apply

      public void apply(@NotNull GTNHGradlePlugin.GTNHExtension gtnh, @NotNull @NotNull Project project)
      Description copied from interface: GTNHModule
      Activates this module on the given project.
      Specified by:
      apply in interface GTNHModule
      Parameters:
      gtnh - The GTNH extension providing access to various gradle services and configuration
      project - The project to activate the module on