use of org.gradle.internal.service.ServiceCreationException in project gradle by gradle.
the class DefaultExceptionAnalyser method collectFailures.
@Override
public void collectFailures(Throwable exception, Collection<? super Throwable> failures) {
if (exception instanceof ProjectConfigurationException) {
ProjectConfigurationException projectConfigurationException = (ProjectConfigurationException) exception;
List<Throwable> additionalFailures = new ArrayList<>();
for (Throwable cause : projectConfigurationException.getCauses()) {
// TODO: remove this special case
if (cause instanceof GradleScriptException) {
failures.add(transform(cause));
} else {
additionalFailures.add(cause);
}
}
if (!additionalFailures.isEmpty()) {
projectConfigurationException.initCauses(additionalFailures);
failures.add(transform(projectConfigurationException));
}
} else if (exception instanceof ServiceCreationException) {
failures.add(transform(new InitializationException(exception)));
} else {
failures.add(transform(exception));
}
}
use of org.gradle.internal.service.ServiceCreationException in project gradle by gradle.
the class NativeServices method initialize.
/**
* Initializes the native services to use the given user home directory to store native libs and other resources. Does nothing if already initialized.
*
* @param requestedFeatures Whether to initialize additional native libraries like jansi and file-events.
*/
private void initialize(File userHomeDir, EnumSet<NativeFeatures> requestedFeatures) {
if (!initialized) {
try {
initializeNativeIntegrations(userHomeDir);
initialized = true;
initializeFeatures(requestedFeatures);
} catch (RuntimeException e) {
throw new ServiceCreationException("Could not initialize native services.", e);
}
}
}
Aggregations