Class ArtifactEntry

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

public class ArtifactEntry extends Object
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 Details

    • ArtifactEntry

      public ArtifactEntry()
  • Method Details

    • setJar

      public void setJar(File jar)
      Sets the JAR file to upload for this artifact.
      Parameters:
      jar - the JAR file
    • getJar

      public File getJar()
      Returns:
      the JAR file to upload, or null if not set
    • setClassifier

      public void setClassifier(String classifier)
      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

      public String getClassifier()
      Returns:
      the classifier, or an empty string for the default artifact