Class GitHub

java.lang.Object
io.github.intisy.gradle.inno.impl.GitHub

public class GitHub extends Object
Helper for retrieving and caching the latest Inno Setup release from GitHub.

Fetches release metadata via the GitHub API, downloads the ZIP artifact to the Gradle cache, and unpacks it into a flattened directory usable by the InnoSetup build process.

  • Constructor Summary

    Constructors
    Constructor
    Description
    GitHub(String releaseUrl, Logger logger)
    Constructs a new helper for a specific GitHub releases API URL.
  • Method Summary

    Modifier and Type
    Method
    Description
    Downloads (and caches) the latest release ZIP and unpacks it.
    void
    downloadFile(String fileUrl, File outputFile)
    Downloads a remote file to a local path.
    org.gradle.internal.impldep.com.google.gson.JsonObject
    Retrieves JSON metadata for the latest release from a GitHub API endpoint.
    static void
    unzipAndFlatten(File zipFilePath, File outputDirectory)
    Unzips the given ZIP file into the output directory while flattening the top-level folder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GitHub

      public GitHub(String releaseUrl, Logger logger)
      Constructs a new helper for a specific GitHub releases API URL.
      Parameters:
      releaseUrl - GitHub API URL to query for the latest release
      logger - logger to use for logging messages
  • Method Details

    • download

      public Path download()
      Downloads (and caches) the latest release ZIP and unpacks it.
      Returns:
      path where the ZIP content was unpacked, or null on failure
    • unzipAndFlatten

      public static void unzipAndFlatten(File zipFilePath, File outputDirectory) throws IOException
      Unzips the given ZIP file into the output directory while flattening the top-level folder.
      Parameters:
      zipFilePath - path to the downloaded ZIP file
      outputDirectory - directory to extract into
      Throws:
      IOException - if extraction fails
    • getLatestReleaseZip

      public org.gradle.internal.impldep.com.google.gson.JsonObject getLatestReleaseZip(String apiUrl) throws Exception
      Retrieves JSON metadata for the latest release from a GitHub API endpoint.
      Parameters:
      apiUrl - GitHub API URL
      Returns:
      parsed JSON object or null on failure
      Throws:
      Exception - if the request or parse fails
    • downloadFile

      public void downloadFile(String fileUrl, File outputFile) throws Exception
      Downloads a remote file to a local path.
      Parameters:
      fileUrl - URL to download
      outputFile - destination file
      Throws:
      Exception - if the download fails