public class SourcesExtension
extends java.lang.Object
github { }).
sources {
git {
url = "https://gitlab.com/me/lib.git"
ref = "main"
into = "implementation"
}
jar {
url = "https://nexus.internal/libs/foo-1.0.jar"
header "Authorization", "Bearer ${myToken}"
sha256 = "..."
into = "implementation"
}
}
Both git { } and jar { } are repeatable.
| Constructor and Description |
|---|
SourcesExtension() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<GitSourceEntry> |
getGitSources() |
java.util.List<JarSourceEntry> |
getJarSources() |
void |
git(org.gradle.api.Action<? super GitSourceEntry> action)
Declares a git repository dependency, configured by the given Gradle action.
|
void |
git(groovy.lang.Closure<?> closure)
Declares a git repository dependency, configured by the given Groovy closure.
|
void |
jar(org.gradle.api.Action<? super JarSourceEntry> action)
Declares a direct jar URL dependency, configured by the given Gradle action.
|
void |
jar(groovy.lang.Closure<?> closure)
Declares a direct jar URL dependency, configured by the given Groovy closure.
|
public java.util.List<GitSourceEntry> getGitSources()
git { } entry, in declaration order.public java.util.List<JarSourceEntry> getJarSources()
jar { } entry, in declaration order.public void git(org.gradle.api.Action<? super GitSourceEntry> action)
action - action that configures a GitSourceEntry.public void git(groovy.lang.Closure<?> closure)
git { ... }closure - closure that configures a GitSourceEntry.public void jar(org.gradle.api.Action<? super JarSourceEntry> action)
action - action that configures a JarSourceEntry.public void jar(groovy.lang.Closure<?> closure)
jar { ... }closure - closure that configures a JarSourceEntry.