Class GitHub
java.lang.Object
io.github.intisy.gradle.inno.impl.GitHub
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 -
Method Summary
Modifier and TypeMethodDescriptiondownload()Downloads (and caches) the latest release ZIP and unpacks it.voiddownloadFile(String fileUrl, File outputFile) Downloads a remote file to a local path.org.gradle.internal.impldep.com.google.gson.JsonObjectgetLatestReleaseZip(String apiUrl) Retrieves JSON metadata for the latest release from a GitHub API endpoint.static voidunzipAndFlatten(File zipFilePath, File outputDirectory) Unzips the given ZIP file into the output directory while flattening the top-level folder.
-
Constructor Details
-
GitHub
Constructs a new helper for a specific GitHub releases API URL.- Parameters:
releaseUrl- GitHub API URL to query for the latest releaselogger- logger to use for logging messages
-
-
Method Details
-
download
Downloads (and caches) the latest release ZIP and unpacks it.- Returns:
- path where the ZIP content was unpacked, or null on failure
-
unzipAndFlatten
Unzips the given ZIP file into the output directory while flattening the top-level folder.- Parameters:
zipFilePath- path to the downloaded ZIP fileoutputDirectory- 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
Downloads a remote file to a local path.- Parameters:
fileUrl- URL to downloadoutputFile- destination file- Throws:
Exception- if the download fails
-