Class ArtifactEntry
java.lang.Object
io.github.intisy.gradle.github.extension.ArtifactEntry
A single JAR artifact to include in a GitHub release.
Configure multiple entries inside a publishGithub { artifacts { } } block:
publishGithub {
artifacts {
artifact {
jar = file("build/libs/my-lib.jar")
classifier = "" // default artifact — uploaded as repo.jar
}
artifact {
jar = file("build/libs/my-lib-api.jar")
classifier = "api" // uploaded as repo-api.jar
}
}
}
A blank or null classifier produces the asset name repo.jar.
Any other classifier produces repo-CLASSIFIER.jar.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetJar()booleanvoidsetClassifier(String classifier) Sets the classifier that distinguishes this artifact from others in the same release.voidSets the JAR file to upload for this artifact.voidsetModules(boolean modules) When true, this entry expands to one asset per subproject (<repo>-<module>.jar) instead of uploadinggetJar(); thejarandclassifierfields are then ignored.
-
Constructor Details
-
ArtifactEntry
public ArtifactEntry()
-
-
Method Details
-
setJar
Sets the JAR file to upload for this artifact.- Parameters:
jar- the JAR file
-
getJar
- Returns:
- the JAR file to upload, or null if not set
-
setClassifier
Sets the classifier that distinguishes this artifact from others in the same release. A blank or null classifier makes this the default artifact (repo.jar).- Parameters:
classifier- the classifier string, e.g."api","fat"
-
getClassifier
- Returns:
- the classifier, or an empty string for the default artifact
-
setModules
public void setModules(boolean modules) When true, this entry expands to one asset per subproject (<repo>-<module>.jar) instead of uploadinggetJar(); thejarandclassifierfields are then ignored. Lets a multi-module library publish all its modules alongside any regular classified jars in one release.- Parameters:
modules- whether this entry represents all subproject modules
-
isModules
public boolean isModules()- Returns:
- whether this entry expands to all subproject modules
-