Class GitHubSourceBuilds
java.lang.Object
io.github.intisy.gradle.github.impl.github.GitHubSourceBuilds
- All Implemented Interfaces:
SourceBuilds
Adapts the host-agnostic
SourceBuilder to the GitHub-specific SourceBuilds
capability by resolving owner/repo to a github.com clone URL before
delegating, so the source-build strategy behaves exactly as it did before SourceBuilder took an explicit clone URL.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildFromGit(String cloneUrl, String ref) Builds any git repository from source, identified by an explicit clone URL rather than a GitHub owner/repo, so hosts other than github.com are equally supported.buildFromSource(String owner, String repo, String branch, String commitSha) Builds a GitHub repository from source, identified by owner and repo.
-
Constructor Details
-
GitHubSourceBuilds
- Parameters:
gitHub- resolves the github.com clone URL (SSH or HTTPS) for a given owner/repo.sourceBuilder- builds and caches the jar once the clone URL is known.
-
-
Method Details
-
buildFromSource
public File buildFromSource(String owner, String repo, String branch, String commitSha) throws IOException Description copied from interface:SourceBuildsBuilds a GitHub repository from source, identified by owner and repo.- Specified by:
buildFromSourcein interfaceSourceBuilds- Parameters:
owner- the repository owner.repo- the repository name.branch- the branch to clone or pull, or null for the current/default branch.commitSha- the commit to build, or null to use the branch's latest commit.- Returns:
- the cached jar for the resolved commit, built only when not already cached.
- Throws:
IOException- if the clone/pull, checkout, or build itself fails.
-
buildFromGit
Description copied from interface:SourceBuildsBuilds any git repository from source, identified by an explicit clone URL rather than a GitHub owner/repo, so hosts other than github.com are equally supported.- Specified by:
buildFromGitin interfaceSourceBuilds- Parameters:
cloneUrl- the exact URL to clone from.ref- the branch, tag, or commit to build, or null for the remote's default branch.- Returns:
- the cached jar for the resolved ref, built only when not already cached.
- Throws:
IOException- if the clone, checkout, or build itself fails.
-