gradle
8.4

# BuildServiceRegistry

interface BuildServiceRegistry(source)

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

A registry is available using getSharedServices.

## 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
abstract fun <T : BuildService<P>?, P : BuildServiceParameters?> registerIfAbsent(name: String, implementationType: Class<T>, configureAction: Action<out Any>): 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>, configureAction: Action<in BuildServiceSpec<P>>): Provider<T>

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