Class GitHubApi
java.lang.Object
io.github.intisy.gradle.github.api.GitHubApi
The single entry point for consuming the GitHub client outside a Gradle build.
Construct one with create(GitHubConfig, ResourceSettings, GitHubLogger) (or the
two-argument overload, which logs to System.err, or the no-argument overload, which
additionally defaults to fully anonymous access), then reach each capability through its
accessor: credentials(), repositories(), releases(),
publishing(), sourceBuilds(), downloads(), resolver().
-
Method Summary
Modifier and TypeMethodDescriptionstatic GitHubApicreate()Same ascreate(GitHubConfig, ResourceSettings, GitHubLogger), defaulting to an anonymousGitHubConfig, a defaultResourceSettings, and logging toSystem.errviaConsoleGitHubLogger.static GitHubApicreate(GitHubConfig config, ResourceSettings resources) Same ascreate(GitHubConfig, ResourceSettings, GitHubLogger), logging toSystem.errviaConsoleGitHubLogger.static GitHubApicreate(GitHubConfig config, ResourceSettings resources, GitHubLogger logger) releases()resolver()
-
Method Details
-
create
public static GitHubApi create(GitHubConfig config, ResourceSettings resources, GitHubLogger logger) - Parameters:
config- the access token and auth/cli/resilience settings.resources- the configured resource repository, if any.logger- receives diagnostic output.- Returns:
- a new client wired to the given configuration and logger.
-
create
Same ascreate(GitHubConfig, ResourceSettings, GitHubLogger), logging toSystem.errviaConsoleGitHubLogger.- Parameters:
config- the access token and auth/cli/resilience settings.resources- the configured resource repository, if any.- Returns:
- a new client wired to the given configuration, logging to
System.err.
-
create
Same ascreate(GitHubConfig, ResourceSettings, GitHubLogger), defaulting to an anonymousGitHubConfig, a defaultResourceSettings, and logging toSystem.errviaConsoleGitHubLogger.- Returns:
- a new client for fully anonymous, unauthenticated access.
-
credentials
- Returns:
- the resolved API token and SSH key for this client's configuration.
-
repositories
- Returns:
- the client's checkout-cloning, pulling and inspection capability.
-
releases
- Returns:
- the client's release lookup and jar download capability.
-
publishing
- Returns:
- the client's release creation and asset upload capability.
-
sourceBuilds
- Returns:
- the client's build-from-source capability, backed by a shared cache directory whose entries are keyed by owner, repo, and resolved commit (or, for an arbitrary clone URL, a derived identity and resolved ref).
-
downloads
- Returns:
- the client's jar-download capability, for a URL with no repository or git host involved, backed by a shared cache directory whose entries are keyed by a hash of the URL.
-
resolver
- Returns:
- the client's
ResolutionRequest-based resolver, dispatching toreleases(),sourceBuilds(), ordownloads()by the request's own strategy.
-