Class PublishExtension
java.lang.Object
io.github.intisy.gradle.github.extension.PublishExtension
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 remoteoriginURLversion— taken fromproject.versionjar— the shadow/fat JAR inbuild/libs/, or the first regular JAR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetJar()getOwner()getRepo()voidOverride the JAR file to upload.voidOverride the GitHub repository owner.voidOverride the GitHub repository name.voidsetVersion(String version) Override the release version tag.
-
Constructor Details
-
PublishExtension
public PublishExtension()
-
-
Method Details
-
setOwner
Override the GitHub repository owner. When null (default) the owner is auto-detected from the git remote origin.- Parameters:
owner- the repository owner
-
getOwner
- Returns:
- the overridden owner, or null to auto-detect
-
setRepo
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
- Returns:
- the overridden repo name, or null to auto-detect
-
setVersion
Override the release version tag. When null (default) the version is taken fromproject.version.- Parameters:
version- the version tag to use for the GitHub release
-
getVersion
- Returns:
- the overridden version, or null to use
project.version
-
setJar
Override the JAR file to upload. When null (default) the task auto-selects the shadow/fat JAR frombuild/libs/, or falls back to the first regular JAR found there.- Parameters:
jar- the JAR file to upload
-
getJar
- Returns:
- the overridden JAR file, or null to auto-select
-