Class PublishExtension

java.lang.Object
io.github.intisy.gradle.github.extension.PublishExtension

public class PublishExtension extends Object
Extension for configuring the publishGithub task. Register it in your build.gradle inside a publish { } block:
 github {
     publish {
         owner   = "my-org"
         repo    = "my-repo"
         version = "2.0.0"
         jar     = file("build/libs/my-fat.jar")
     }
 }
 
Every field is optional and falls back to auto-detection when null:
  • owner / repo — parsed from the git remote origin URL
  • version — taken from project.version
  • jar — the shadow/fat JAR in build/libs/, or the first regular JAR
  • Constructor Details

    • PublishExtension

      public PublishExtension()
  • Method Details

    • setOwner

      public void setOwner(String owner)
      Override the GitHub repository owner. When null (default) the owner is auto-detected from the git remote origin.
      Parameters:
      owner - the repository owner
    • getOwner

      public String getOwner()
      Returns:
      the overridden owner, or null to auto-detect
    • setRepo

      public void setRepo(String repo)
      Override the GitHub repository name. When null (default) the repo name is auto-detected from the git remote origin.
      Parameters:
      repo - the repository name
    • getRepo

      public String getRepo()
      Returns:
      the overridden repo name, or null to auto-detect
    • setVersion

      public void setVersion(String version)
      Override the release version tag. When null (default) the version is taken from project.version.
      Parameters:
      version - the version tag to use for the GitHub release
    • getVersion

      public String getVersion()
      Returns:
      the overridden version, or null to use project.version
    • setJar

      public void setJar(File jar)
      Override the JAR file to upload. When null (default) the task auto-selects the shadow/fat JAR from build/libs/, or falls back to the first regular JAR found there.
      Parameters:
      jar - the JAR file to upload
    • getJar

      public File getJar()
      Returns:
      the overridden JAR file, or null to auto-select