ArtifactRepositoryContainer

A ResolverContainer is responsible for managing a set of ArtifactRepository instances. Repositories are arranged in a sequence.

You can obtain a ResolverContainer instance by calling getRepositories or using the repositories property in your build script.

The resolvers in a container are accessible as read-only properties of the container, using the name of the resolver as the property name. For example:

repositories.maven { name = 'myResolver' }
repositories.myResolver.url = uri('some-url')

A dynamic method is added for each resolver which takes a configuration closure. This is equivalent to calling getByName. For example:

repositories.maven { name = 'myResolver' }
repositories.myResolver {
    url = uri('some-url')
}

Inheritors

Properties

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

Functions

Link copied to clipboard
abstract fun add(p: Int, p1: E)

abstract fun add(repository: ArtifactRepository): Boolean
Adds a repository to this container, at the end of the repository sequence.
Link copied to clipboard
abstract fun addAll(c: Collection<out T>): Boolean
Link copied to clipboard
abstract fun addAllLater(provider: Provider<out Iterable<T>>)
Link copied to clipboard
abstract fun addFirst(repository: ArtifactRepository)
Adds a repository to this container, at the start of the repository sequence.
Link copied to clipboard
abstract fun addLast(repository: ArtifactRepository)
Adds a repository to this container, at the end of the repository sequence.
Link copied to clipboard
abstract fun addLater(provider: Provider<out T>)
Link copied to clipboard
abstract fun addRule(rule: Rule): Rule
Link copied to clipboard
abstract fun all(action: Action<in T>)
Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract fun configure(cl: Closure): T
Link copied to clipboard
abstract fun configureEach(action: Action<in T>)
Link copied to clipboard
abstract fun contains(p: Any): Boolean
Link copied to clipboard
abstract fun containsAll(p: Collection<out Any>): Boolean
Link copied to clipboard
open fun <E> copyOf(coll: Collection<out E>): List<E>
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun findAll(spec: Closure): Collection<T>
abstract fun findAll(spec: Closure): List<T>
Link copied to clipboard
abstract fun findByName(name: String): T
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard
abstract fun get(p: Int): E
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.

Link copied to clipboard
abstract fun getAsMap(): SortedMap<String, T>
Link copied to clipboard
abstract fun getAt(name: String): ArtifactRepository
Link copied to clipboard
abstract fun getByName(name: String): ArtifactRepository
abstract fun getByName(name: String, @DelegatesTo(value = ArtifactRepository::class) configureClosure: Closure): ArtifactRepository
abstract fun getByName(name: String, configureAction: Action<in ArtifactRepository>): ArtifactRepository
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.

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.

Link copied to clipboard
Link copied to clipboard
abstract fun getNamer(): Namer<T>
Link copied to clipboard
abstract fun getNames(): SortedSet<String>
Link copied to clipboard
abstract fun getRules(): List<Rule>
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun indexOf(p: Any): Int
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract fun iterator(): Iterator<T>
abstract fun iterator(): Iterator<E>
Link copied to clipboard
abstract fun lastIndexOf(p: Any): Int
Link copied to clipboard
abstract fun listIterator(): ListIterator<E>
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>
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>
Link copied to clipboard

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>, 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.

Link copied to clipboard
open fun <E> of(): List<E>
Link copied to clipboard
open fun parallelStream(): Stream<E>
Link copied to clipboard

Allows a NamedDomainObjectCollection to be used as a property delegate.

Link copied to clipboard
abstract fun remove(p: Int): E
abstract fun remove(p: Any): Boolean
Link copied to clipboard
abstract fun removeAll(p: Collection<out Any>): Boolean
Link copied to clipboard
open fun removeIf(filter: Predicate<in E>): Boolean
Link copied to clipboard
open fun replaceAll(operator: UnaryOperator<E>)
Link copied to clipboard
abstract fun retainAll(p: Collection<out Any>): Boolean
Link copied to clipboard
abstract fun set(p: Int, p1: E): E
Link copied to clipboard
abstract fun size(): Int
Link copied to clipboard
open fun sort(c: Comparator<in E>)
Link copied to clipboard
Link copied to clipboard
open fun stream(): Stream<E>
Link copied to clipboard
abstract fun subList(p: Int, p1: Int): List<E>
Link copied to clipboard
abstract fun toArray(): Array<Any>
abstract fun <T> toArray(p: Array<T>): Array<T>
Link copied to clipboard
abstract fun whenObjectAdded(action: Closure)
abstract fun whenObjectAdded(action: Action<in T>): Action<in T>
Link copied to clipboard
abstract fun whenObjectRemoved(action: Closure)
abstract fun whenObjectRemoved(action: Action<in T>): Action<in T>
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>
Link copied to clipboard

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>, configureAction: Action<in S>): DomainObjectCollection<S>

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

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

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