public class PublishExtension
extends java.lang.Object
publishGithub task.
All fields are optional and fall back to auto-detection when null:
owner / repo — parsed from the git remote origin URLversion — taken from project.versionjar — the shadow/fat JAR in build/libs/, or the first regular JARSingle-JAR shorthand (backward-compatible):
publishGithub {
owner = "my-org"
repo = "my-repo"
version = "2.0.0"
jar = file("build/libs/my-lib.jar")
}
Multi-JAR with classifiers:
publishGithub {
artifacts {
artifact { classifier = ""; jar = file("build/libs/my-lib.jar") }
artifact { classifier = "api"; jar = file("build/libs/my-lib-api.jar") }
artifact { classifier = "fat"; jar = file("build/libs/my-lib-fat.jar") }
}
}
| Constructor and Description |
|---|
PublishExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
artifact(org.gradle.api.Action<? super ArtifactEntry> action)
Adds a single artifact entry, configured by the given Gradle action.
|
void |
artifact(groovy.lang.Closure<?> closure)
Adds a single artifact entry, configured by the given Groovy closure.
|
void |
artifacts(org.gradle.api.Action<? super PublishExtension> action)
Opens a configuration block in which multiple
artifact(org.gradle.api.Action<? super io.github.intisy.gradle.github.plugin.extension.ArtifactEntry>) calls can be made. |
void |
artifacts(groovy.lang.Closure<?> closure)
Opens a Groovy-DSL configuration block for multiple artifact entries.
|
java.util.List<ArtifactEntry> |
getArtifacts()
Returns the list of explicit artifacts to upload.
|
java.io.File |
getJar() |
java.lang.String |
getOwner() |
java.lang.String |
getReleaseName() |
java.lang.String |
getRepo() |
java.lang.String |
getTag() |
java.lang.String |
getVersion() |
void |
setJar(java.io.File jar)
Override the single JAR file to upload.
|
void |
setOwner(java.lang.String owner)
Override the GitHub repository owner.
|
void |
setReleaseName(java.lang.String releaseName)
Override the human-readable release title shown on GitHub.
|
void |
setRepo(java.lang.String repo)
Override the GitHub repository name.
|
void |
setTag(java.lang.String tag)
Override the git tag pushed to GitHub for this release.
|
void |
setVersion(java.lang.String version)
Override the release version tag.
|
public void setOwner(java.lang.String owner)
owner - the repository ownerpublic java.lang.String getOwner()
public void setRepo(java.lang.String repo)
repo - the repository namepublic java.lang.String getRepo()
public void setVersion(java.lang.String version)
project.version.version - the version tag to use for the GitHub releasepublic java.lang.String getVersion()
project.versionpublic void setTag(java.lang.String tag)
getVersion() (after fallback to project.version).
Use this to prefix or format the tag independently of the version string,
e.g. tag = "v1.0" while version = "1.0".tag - the tag name, e.g. "v2.0.0"public java.lang.String getTag()
public void setReleaseName(java.lang.String releaseName)
releaseName = "Release 1.0".releaseName - the release titlepublic java.lang.String getReleaseName()
public void setJar(java.io.File jar)
getArtifacts() is non-empty.
When null (default) the task auto-selects the shadow/fat JAR from
build/libs/, or falls back to the first regular JAR found there.jar - the JAR file to uploadpublic java.io.File getJar()
public java.util.List<ArtifactEntry> getArtifacts()
getJar() field.ArtifactEntry instancespublic void artifact(org.gradle.api.Action<? super ArtifactEntry> action)
action - action that receives and configures an ArtifactEntrypublic void artifact(groovy.lang.Closure<?> closure)
closure - closure that configures an ArtifactEntrypublic void artifacts(org.gradle.api.Action<? super PublishExtension> action)
artifact(org.gradle.api.Action<? super io.github.intisy.gradle.github.plugin.extension.ArtifactEntry>) calls can be made.
This is a convenience wrapper so users can write artifacts { artifact { } }.action - action that calls artifact(org.gradle.api.Action<? super io.github.intisy.gradle.github.plugin.extension.ArtifactEntry>) one or more times on this extensionpublic void artifacts(groovy.lang.Closure<?> closure)
closure - closure in which artifact { } calls are made