# service

@Incubating
abstract fun <T : SettingsService?> service(serviceType: Class<T>): T(source)

Looks up a service provided by Gradle for use in this build.

The services available for lookup are the Gradle types that implement SettingsService.

This method does not provide access to shared build services; use getSharedServices to access those.

#### Return

the service instance. Never returns null.

#### Since

9.8.0

#### Parameters

serviceType

the type of the service to look up

<T>

the service type

#### Throws

org.gradle.api.InvalidUserDataException

when the given type is not one of the services available in this scope