Search in sources :

Example 1 with ToolingModelBuilderRegistry

use of org.gradle.tooling.provider.model.ToolingModelBuilderRegistry in project gradle by gradle.

the class DefaultBuildController method getToolingModelBuilder.

private ToolingModelBuilder getToolingModelBuilder(ProjectInternal project, ModelIdentifier modelIdentifier) {
    ToolingModelBuilderRegistry modelBuilderRegistry = project.getServices().get(ToolingModelBuilderRegistry.class);
    ToolingModelBuilder builder;
    try {
        builder = modelBuilderRegistry.getBuilder(modelIdentifier.getName());
    } catch (UnknownModelException e) {
        throw (InternalUnsupportedModelException) (new InternalUnsupportedModelException()).initCause(e);
    }
    return builder;
}
Also used : InternalUnsupportedModelException(org.gradle.tooling.internal.protocol.InternalUnsupportedModelException) ToolingModelBuilderRegistry(org.gradle.tooling.provider.model.ToolingModelBuilderRegistry) UnknownModelException(org.gradle.tooling.provider.model.UnknownModelException) ToolingModelBuilder(org.gradle.tooling.provider.model.ToolingModelBuilder)

Aggregations

InternalUnsupportedModelException (org.gradle.tooling.internal.protocol.InternalUnsupportedModelException)1 ToolingModelBuilder (org.gradle.tooling.provider.model.ToolingModelBuilder)1 ToolingModelBuilderRegistry (org.gradle.tooling.provider.model.ToolingModelBuilderRegistry)1 UnknownModelException (org.gradle.tooling.provider.model.UnknownModelException)1