Package org.gradle.tooling.provider.model

Examples of org.gradle.tooling.provider.model.ToolingModelBuilder


            // Currently need to force everything to be configured
            gradle.getServices().get(ProjectConfigurer.class).configureHierarchy(gradle.getRootProject());
        }

        ToolingModelBuilderRegistry builderRegistry = getToolingModelBuilderRegistry(gradle);
        ToolingModelBuilder builder;
        try {
            builder = builderRegistry.getBuilder(modelName);
        } catch (UnknownModelException e) {
            throw (InternalUnsupportedModelException)new InternalUnsupportedModelException().initCause(e);
        }

        Object result;
        if (builder instanceof ProjectSensitiveToolingModelBuilder) {
            result = ((ProjectSensitiveToolingModelBuilder) builder).buildAll(modelName, gradle.getDefaultProject(), true);
        } else {
            result = builder.buildAll(modelName, gradle.getDefaultProject());
        }

        PayloadSerializer payloadSerializer = gradle.getServices().get(PayloadSerializer.class);
        return new BuildActionResult(payloadSerializer.serialize(result), null);
    }
View Full Code Here


        } else {
            throw new IllegalArgumentException("Don't know how to build models for " + target);
        }
        modelBuilderRegistry = project.getServices().get(ToolingModelBuilderRegistry.class);

        ToolingModelBuilder builder;
        try {
            builder = modelBuilderRegistry.getBuilder(modelIdentifier.getName());
        } catch (UnknownModelException e) {
            throw (InternalUnsupportedModelException) (new InternalUnsupportedModelException()).initCause(e);
        }
        Object model;
        if (builder instanceof ProjectSensitiveToolingModelBuilder) {
            model = ((ProjectSensitiveToolingModelBuilder) builder).buildAll(modelIdentifier.getName(), project, isImplicitProject);
        } else {
            model = builder.buildAll(modelIdentifier.getName(), project);
        }
        return new ProviderBuildResult<Object>(model);
    }
View Full Code Here

    public void register(ToolingModelBuilder builder) {
        builders.add(builder);
    }

    public ToolingModelBuilder getBuilder(String modelName) throws UnsupportedOperationException {
        ToolingModelBuilder match = null;
        for (ToolingModelBuilder builder : builders) {
            if (builder.canBuild(modelName)) {
                if (match != null) {
                    throw new UnsupportedOperationException(String.format("Multiple builders are available to build a model of type '%s'.", modelName));
                }
View Full Code Here

TOP

Related Classes of org.gradle.tooling.provider.model.ToolingModelBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.