Class GitHubConfig.Builder
java.lang.Object
io.github.intisy.gradle.github.api.config.GitHubConfig.Builder
- Enclosing interface:
- GitHubConfig
Assembles an immutable
GitHubConfig by composing AuthSettings,
CliSettings and ResilienceSettings, the same settings types the Gradle DSL
configures.- Implementation Note:
- Each
build()call snapshots this builder's current state into fresh copies of the three settings objects, and the built config hands out a fresh copy from every getter call in turn. So further calls to this builder never affect an already-built config, and mutating a settings object obtained from a built config never affects that config either.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()cliEnabled(boolean enabled) cliFallback(boolean fallback) skipOnRateLimit(boolean skipOnRateLimit)
-
Method Details
-
token
- Parameters:
token- a GitHub Personal Access Token, used for REST calls and HTTPS git operations.- Returns:
- this builder.
-
tokenFile
- Parameters:
tokenFile- a file whose contents are a GitHub token, used whentoken(String)is not set.- Returns:
- this builder.
-
sshKey
- Parameters:
sshKey- the SSH private key file used for git clone/pull over SSH.- Returns:
- this builder.
-
cliEnabled
- Parameters:
enabled- whether to route GitHub REST calls through the localghCLI.- Returns:
- this builder.
-
cliFallback
- Parameters:
fallback- whether to fall back to HTTP whenghis unavailable or fails.- Returns:
- this builder.
-
skipOnRateLimit
- Parameters:
skipOnRateLimit- whether to degrade gracefully (rather than fail) when the rate limit is hit.- Returns:
- this builder.
-
build
- Returns:
- an immutable
GitHubConfigsnapshot of this builder's current state.
-