use of org.gradle.api.services.internal.BuildServiceRegistryInternal in project gradle by gradle.
the class AbstractTask method getSharedResources.
@Override
public List<ResourceLock> getSharedResources() {
if (requiredServices == null) {
return Collections.emptyList();
}
ImmutableList.Builder<ResourceLock> locks = ImmutableList.builder();
BuildServiceRegistryInternal serviceRegistry = getServices().get(BuildServiceRegistryInternal.class);
for (Provider<? extends BuildService<?>> service : requiredServices) {
SharedResource resource = serviceRegistry.forService(service);
if (resource.getMaxUsages() > 0) {
locks.add(resource.getResourceLock());
}
}
return locks.build();
}
Aggregations