public class SourceBuilder
extends java.lang.Object
GitHub carries a single ResourceSettings, hence a single repository
identity, so a fresh GitHub is built per buildFromSource call (which buildFromGit(java.lang.String, java.lang.String) also goes through), scoped to
the exact cloneUrl requested, rather than accepting one pre-built GitHub that
could only ever be correctly configured for one repository.| Constructor and Description |
|---|
SourceBuilder(GitHubConfig config,
GitHubLogger logger,
java.io.File cacheDir,
BuildInvoker invoker) |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
buildFromGit(java.lang.String cloneUrl,
java.lang.String ref) |
java.util.List<java.io.File> |
buildFromGit(java.lang.String cloneUrl,
java.lang.String ref,
java.lang.String gradleDir,
java.util.List<java.lang.String> modules) |
java.io.File |
buildFromSource(java.lang.String cloneUrl,
java.lang.String owner,
java.lang.String repo,
java.lang.String branch,
java.lang.String commitSha) |
public SourceBuilder(GitHubConfig config, GitHubLogger logger, java.io.File cacheDir, BuildInvoker invoker)
config - the access token and auth/cli/resilience settings used to clone/pull each checkout.logger - receives diagnostic output.cacheDir - the directory built jars are cached under, keyed by owner, repo, and resolved commit.invoker - runs the actual build against a checkout; injected so it can be stubbed in tests.public java.io.File buildFromGit(java.lang.String cloneUrl,
java.lang.String ref)
throws java.io.IOException
cloneUrl - the exact URL to clone from; any git host, not just github.com.ref - the branch, tag, or commit to build, or null for the remote's default branch.java.io.IOException - if the clone, checkout, or build itself fails.public java.util.List<java.io.File> buildFromGit(java.lang.String cloneUrl,
java.lang.String ref,
java.lang.String gradleDir,
java.util.List<java.lang.String> modules)
throws java.io.IOException
cloneUrl - the exact URL to clone from; any git host, not just github.com.ref - the branch, tag, or commit to build, or null for the remote's default branch.gradleDir - the gradle project directory relative to the checkout root, or null when the
build lives at the root.modules - the module names whose jars to take, or empty for the root project's own jar.modules order.java.io.IOException - if the clone, checkout, or build itself fails.public java.io.File buildFromSource(java.lang.String cloneUrl,
java.lang.String owner,
java.lang.String repo,
java.lang.String branch,
java.lang.String commitSha)
throws java.io.IOException
cloneUrl - the exact URL to clone from; any git host, not just github.com.owner - an identity for the repository, used only for the checkout/cache directory
and jar naming, never for URL construction.repo - an identity for the repository, used only for the checkout/cache directory
and jar naming, never for URL construction.branch - the branch to clone or pull, or null for the current/default branch.commitSha - the commit to check out, or null to use the branch's latest commit.java.io.IOException - if the clone/pull, checkout, or build itself fails.