# BuildServiceRegistry

interface BuildServiceRegistry(source)

A registry of build services. You use this type to register service instances.

A registry is available using getSharedServices.

#### Since

6.1

## Functions

getRegistrations
Link copied to clipboard
abstract fun getRegistrations(): NamedDomainObjectSet<BuildServiceRegistration<out Any, out Any>>
Returns the set of service registrations.
registerIfAbsent
Link copied to clipboard
open fun <T : BuildService<P>?, P : BuildServiceParameters?> registerIfAbsent(name: String, implementationType: Class<T>): Provider<T>
abstract fun <T : BuildService<P>?, P : BuildServiceParameters?> registerIfAbsent(name: String, implementationType: Class<T>, configureAction: Action<in BuildServiceSpec<P>>): Provider<T>
Registers a service, if a service with the given name is not already registered.
registerIfAbsent
Link copied to clipboard
inline fun <T : BuildService<P>, P : BuildServiceParameters> BuildServiceRegistry. registerIfAbsent(name: String, implementationType: KClass<T>): Provider<T>
inline fun <T : BuildService<P>, P : BuildServiceParameters> BuildServiceRegistry. registerIfAbsent(name: String, implementationType: KClass<T>, configureAction: Action<in BuildServiceSpec<P>>): Provider<T>

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.services.BuildServiceRegistry.registerIfAbsent.