# RepositoryHandler

interface RepositoryHandler : ArtifactRepositoryContainer(source)

A `RepositoryHandler` manages a set of repositories, allowing repositories to be defined and queried.

## Properties

DEFAULT_MAVEN_CENTRAL_REPO_NAME
Link copied to clipboard
val DEFAULT_MAVEN_CENTRAL_REPO_NAME: String = "MavenRepo"
DEFAULT_MAVEN_LOCAL_REPO_NAME
Link copied to clipboard
val DEFAULT_MAVEN_LOCAL_REPO_NAME: String = "MavenLocal"
GOOGLE_URL
Link copied to clipboard
val GOOGLE_URL: String = "https://dl.google.com/dl/android/maven2/"
MAVEN_CENTRAL_URL
Link copied to clipboard
val MAVEN_CENTRAL_URL: String = "https://repo.maven.apache.org/maven2/"

## Functions

add
Link copied to clipboard
abstract fun add(p: Int, p1: E)
abstract fun add(repository: ArtifactRepository): Boolean
addAll
Link copied to clipboard
abstract fun addAll(c: Collection<out T>): Boolean
addAllLater
Link copied to clipboard
abstract fun addAllLater(provider: Provider<out Iterable<T>>)
addFirst
Link copied to clipboard
abstract fun addFirst(repository: ArtifactRepository)
addLast
Link copied to clipboard
abstract fun addLast(repository: ArtifactRepository)
addLater
Link copied to clipboard
abstract fun addLater(provider: Provider<out T>)
addRule
Link copied to clipboard
abstract fun addRule(rule: Rule): Rule
all
Link copied to clipboard
abstract fun all(action: Action<in T>)
clear
Link copied to clipboard
abstract fun clear()
configure
Link copied to clipboard
abstract fun configure(cl: Closure): T
configureEach
Link copied to clipboard
abstract fun configureEach(action: Action<in T>)
contains
Link copied to clipboard
abstract fun contains(p: Any): Boolean
containsAll
Link copied to clipboard
abstract fun containsAll(p: Collection<out Any>): Boolean
copyOf
Link copied to clipboard
open fun <E> copyOf(coll: Collection<out E>): List<E>
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
exclusiveContent
Link copied to clipboard
abstract fun exclusiveContent(action: Action<in ExclusiveContentRepository>)
Declares exclusive content repositories.
findAll
Link copied to clipboard
abstract fun findAll(spec: Closure): Collection<T>
abstract fun findAll(spec: Closure): List<T>
findByName
Link copied to clipboard
abstract fun findByName(name: String): T
flatDir
Link copied to clipboard
abstract fun flatDir(@DelegatesTo(value = FlatDirectoryArtifactRepository::class) configureClosure: Closure): FlatDirectoryArtifactRepository
abstract fun flatDir(action: Action<in FlatDirectoryArtifactRepository>): FlatDirectoryArtifactRepository
Adds and configures a repository which will look for dependencies in a number of local directories.
abstract fun flatDir(args: Map<String, out Any>): FlatDirectoryArtifactRepository
Adds a resolver that looks into a number of directories for artifacts.
flatDir
Link copied to clipboard
inline fun RepositoryHandler.flatDir(vararg args: Pair<String, Any?>): FlatDirectoryArtifactRepository

Kotlin extension function for org.gradle.api.artifacts.dsl.RepositoryHandler.flatDir.

forEach
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
get
Link copied to clipboard
abstract fun get(p: Int): E
get
Link copied to clipboard
operator fun <T : Any> NamedDomainObjectCollection<T>.get(name: String): T

Locates an object by name, failing if there is no such object.

getAsMap
Link copied to clipboard
abstract fun getAsMap(): SortedMap<String, T>
getAt
Link copied to clipboard
abstract fun getAt(name: String): T
abstract fun getAt(name: String): ArtifactRepository
getByName
Link copied to clipboard
abstract fun getByName(name: String): T
abstract fun getByName(name: String): ArtifactRepository
getByName
Link copied to clipboard
inline fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String): T

Locates an object by name and casts it to the expected type T.

inline fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, configure: T.() -> Unit): T

Locates an object by name and casts it to the expected type T then configures it.

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, type: KClass<T>): T

Locates an object by name and casts it to the expected type.

fun <T : Any> NamedDomainObjectCollection<out Any>.getByName(name: String, type: KClass<T>, configure: T.() -> Unit): T

Locates an object by name and casts it to the expected type then configures it.

getCollectionSchema
Link copied to clipboard
abstract fun getCollectionSchema(): NamedDomainObjectCollectionSchema
getNamer
Link copied to clipboard
abstract fun getNamer(): Namer<T>
getNames
Link copied to clipboard
abstract fun getNames(): SortedSet<String>
getRules
Link copied to clipboard
abstract fun getRules(): List<Rule>
google
Link copied to clipboard
abstract fun google(): MavenArtifactRepository
abstract fun google(action: Action<in MavenArtifactRepository>): MavenArtifactRepository
Adds a repository which looks in Google's Maven repository for dependencies.
gradlePluginPortal
Link copied to clipboard
abstract fun gradlePluginPortal(): ArtifactRepository
abstract fun gradlePluginPortal(action: Action<in ArtifactRepository>): ArtifactRepository
Adds a repository which looks in Gradle Central Plugin Repository for dependencies.
hashCode
Link copied to clipboard
abstract fun hashCode(): Int
indexOf
Link copied to clipboard
abstract fun indexOf(p: Any): Int
isEmpty
Link copied to clipboard
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
abstract fun iterator(): Iterator<T>
abstract fun iterator(): Iterator<E>
ivy
Link copied to clipboard
abstract fun ivy(@DelegatesTo(value = IvyArtifactRepository::class) closure: Closure): IvyArtifactRepository
abstract fun ivy(action: Action<in IvyArtifactRepository>): IvyArtifactRepository
Adds and configures an Ivy repository.
ivy
Link copied to clipboard
fun RepositoryHandler.ivy(url: Any): IvyArtifactRepository
fun RepositoryHandler.ivy(url: Any, action: IvyArtifactRepository.() -> Unit): IvyArtifactRepository

Adds and configures an Ivy repository.

jcenter
Link copied to clipboard
abstract fun jcenter(): MavenArtifactRepository
abstract fun jcenter(action: Action<in MavenArtifactRepository>): MavenArtifactRepository
Adds a repository which looks in Bintray's JCenter repository for dependencies.
lastIndexOf
Link copied to clipboard
abstract fun lastIndexOf(p: Any): Int
listIterator
Link copied to clipboard
abstract fun listIterator(): ListIterator<E>
matching
Link copied to clipboard
abstract fun matching(spec: Spec<in T>): DomainObjectCollection<T>
abstract fun matching(spec: Spec<in T>): NamedDomainObjectCollection<T>
abstract fun matching(spec: Spec<in T>): NamedDomainObjectList<T>
maven
Link copied to clipboard
abstract fun maven(@DelegatesTo(value = MavenArtifactRepository::class) closure: Closure): MavenArtifactRepository
abstract fun maven(action: Action<in MavenArtifactRepository>): MavenArtifactRepository
Adds and configures a Maven repository.
maven
Link copied to clipboard
fun RepositoryHandler.maven(url: Any): MavenArtifactRepository
fun RepositoryHandler.maven(url: Any, action: MavenArtifactRepository.() -> Unit): MavenArtifactRepository

Adds and configures a Maven repository.

mavenCentral
Link copied to clipboard
abstract fun mavenCentral(): MavenArtifactRepository
abstract fun mavenCentral(args: Map<String, out Any>): MavenArtifactRepository
abstract fun mavenCentral(action: Action<in MavenArtifactRepository>): MavenArtifactRepository
Adds a repository which looks in the Maven central repository for dependencies.
mavenCentral
Link copied to clipboard
inline fun RepositoryHandler.mavenCentral(vararg args: Pair<String, Any?>): MavenArtifactRepository

Kotlin extension function for org.gradle.api.artifacts.dsl.RepositoryHandler.mavenCentral.

mavenLocal
Link copied to clipboard
abstract fun mavenLocal(): MavenArtifactRepository
abstract fun mavenLocal(action: Action<in MavenArtifactRepository>): MavenArtifactRepository
Adds a repository which looks in the local Maven cache for dependencies.
named
Link copied to clipboard
abstract fun named(name: String): NamedDomainObjectProvider<T>
open fun named(nameFilter: Spec<String>): NamedDomainObjectCollection<T>
abstract fun <S : T?> named(name: String, type: Class<S>): NamedDomainObjectProvider<S>
abstract fun named(nameFilter: Spec<String>): NamedDomainObjectList<T>
named
Link copied to clipboard
inline fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String): NamedDomainObjectProvider<T>
fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String, type: KClass<T>): NamedDomainObjectProvider<T>

Locates an object by name and type, without triggering its creation or configuration, failing if there is no such object.

inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.named(name: String, type: KClass<S>): NamedDomainObjectProvider<S>
inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.named(name: String, type: KClass<S>, configurationAction: Action<in S>): NamedDomainObjectProvider<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectCollection.named.

inline fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String, noinline configuration: T.() -> Unit): NamedDomainObjectProvider<T>
fun <T : Any> NamedDomainObjectCollection<out Any>.named(name: String, type: KClass<T>, configuration: T.() -> Unit): NamedDomainObjectProvider<T>

Configures an object by name and type, without triggering its creation or configuration, failing if there is no such object.

of
Link copied to clipboard
open fun <E> of(): List<E>
parallelStream
Link copied to clipboard
open fun parallelStream(): Stream<E>
provideDelegate
Link copied to clipboard
operator fun <T : Any> NamedDomainObjectCollection<T>.provideDelegate(thisRef: Any?, property: KProperty<*>): NamedDomainObjectProvider<T>

Allows a NamedDomainObjectCollection to be used as a property delegate.

remove
Link copied to clipboard
abstract fun remove(p: Int): E
abstract fun remove(p: Any): Boolean
removeAll
Link copied to clipboard
abstract fun removeAll(p: Collection<out Any>): Boolean
removeIf
Link copied to clipboard
open fun removeIf(filter: Predicate<in E>): Boolean
replaceAll
Link copied to clipboard
open fun replaceAll(operator: UnaryOperator<E>)
retainAll
Link copied to clipboard
abstract fun retainAll(p: Collection<out Any>): Boolean
set
Link copied to clipboard
abstract fun set(p: Int, p1: E): E
size
Link copied to clipboard
abstract fun size(): Int
sort
Link copied to clipboard
open fun sort(c: Comparator<in E>)
spliterator
Link copied to clipboard
open fun spliterator(): Spliterator<T>
open fun spliterator(): Spliterator<E>
stream
Link copied to clipboard
open fun stream(): Stream<E>
subList
Link copied to clipboard
abstract fun subList(p: Int, p1: Int): List<E>
toArray
Link copied to clipboard
abstract fun toArray(): Array<Any>
abstract fun <T> toArray(p: Array<T>): Array<T>
whenObjectAdded
Link copied to clipboard
abstract fun whenObjectAdded(action: Closure)
abstract fun whenObjectAdded(action: Action<in T>): Action<in T>
whenObjectRemoved
Link copied to clipboard
abstract fun whenObjectRemoved(action: Closure)
abstract fun whenObjectRemoved(action: Action<in T>): Action<in T>
withType
Link copied to clipboard
abstract fun <S : T?> withType(type: Class<S>): DomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>): NamedDomainObjectCollection<S>
abstract fun <S : T?> withType(type: Class<S>): NamedDomainObjectList<S>
withType
Link copied to clipboard
inline fun <S : Any> DomainObjectCollection<in S>.withType(): DomainObjectCollection<S>
inline fun <S : Any> NamedDomainObjectCollection<in S>.withType(): NamedDomainObjectCollection<S>

Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

inline fun <S : Any> DomainObjectCollection<in S>.withType(noinline configuration: S.() -> Unit): DomainObjectCollection<S>

Returns a collection containing the objects in this collection of the given type. Equivalent to calling `withType(type).all(configureAction)`.

inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>): DomainObjectCollection<S>
inline fun <S : T, T : Any> DomainObjectCollection<T>.withType(type: KClass<S>, configureAction: Action<in S>): DomainObjectCollection<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.DomainObjectCollection.withType.

inline fun <S : T, T : Any> NamedDomainObjectCollection<T>.withType(type: KClass<S>): NamedDomainObjectCollection<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectCollection.withType.

inline fun <S : T, T : Any> NamedDomainObjectList<T>.withType(type: KClass<S>): NamedDomainObjectList<S>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.NamedDomainObjectList.withType.