Class IndraGitService

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.gradle.api.services.BuildService<IndraGitService.Parameters>

    public abstract class IndraGitService
    extends java.lang.Object
    implements org.gradle.api.services.BuildService<IndraGitService.Parameters>, java.lang.AutoCloseable
    A build service providing the most relevant git repository for any project in the build.
    Since:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      IndraGitService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      @Nullable org.eclipse.jgit.api.Git git​(java.io.File projectDir, @NotNull java.lang.String displayName)
      Get the git repository for this build.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.gradle.api.services.BuildService

        getParameters
    • Constructor Detail

      • IndraGitService

        public IndraGitService()
    • Method Detail

      • git

        @Nullable
        public @Nullable org.eclipse.jgit.api.Git git​(java.io.File projectDir,
                                                      @NotNull
                                                      @NotNull java.lang.String displayName)
        Get the git repository for this build.

        If this project is not managed by git, this will return null.

        Parameters:
        projectDir - the project directory to locate a git repo in
        displayName - the display name for the context being queried
        Returns:
        the build's git repository.
        Since:
        2.0.0
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable