Class GithubPackagesRepositoryDsl
java.lang.Object
io.github.duckasteroid.gradle.githubpackages.GithubPackagesRepositoryDsl
DSL entrypoint for use inside a repositories block within build scripts.
repositories {
gitHubPackages {
owner = "duckAsteroid"
repo = "testing"
// Optional: pick a named credential profile instead of the unqualified gpr.user/gpr.key
// profile = "personal"
// Optional: override credentials outright
// username = "my-user"
// token = "ghp_xxx"
}
}
Credential Resolution: If username/token are not explicitly provided, they are resolved using a three-tier fallback:
- Gradle properties:
gpr.user/gpr.key, orgpr.<profile>.user/gpr.<profile>.keywhenprofileis set - Environment variables:
GH_PACKAGES_READ_USER/GH_PACKAGES_READ_TOKEN - Environment variables:
GITHUB_ACTOR/GITHUB_TOKEN
Target repository handler: when invoked as gitHubPackages { ... }
from within a repositories { } block, the repository is added to whichever
RepositoryHandler actually delegates that block (e.g. project.repositories,
publishing.repositories, or pluginManagement.repositories), resolved from the
closure's lexical owner at call time. The handler passed to the constructor is only used as a
fallback when that can't be determined (e.g. the Action-based entry point, which has no
enclosing closure to inspect).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionGithubPackagesRepositoryDsl(org.gradle.api.artifacts.dsl.RepositoryHandler fallbackRepositories, org.gradle.api.provider.ProviderFactory providers) -
Method Summary
Modifier and TypeMethodDescriptionvoidcall(groovy.lang.Closure<?> closure) voidcall(org.gradle.api.Action<? super GithubPackagesRepositoryDsl.GithubPackagesRepositorySpec> action)
-
Constructor Details
-
GithubPackagesRepositoryDsl
public GithubPackagesRepositoryDsl(org.gradle.api.artifacts.dsl.RepositoryHandler fallbackRepositories, org.gradle.api.provider.ProviderFactory providers)
-
-
Method Details
-
call
public void call(groovy.lang.Closure<?> closure) -
call
public void call(org.gradle.api.Action<? super GithubPackagesRepositoryDsl.GithubPackagesRepositorySpec> action)
-