Search in sources :

Example 1 with IncludedBuildInternal

use of org.gradle.composite.internal.IncludedBuildInternal in project gradle by gradle.

the class GradleBuildBuilder method convert.

private DefaultGradleBuild convert(Gradle gradle) {
    DefaultGradleBuild model = new DefaultGradleBuild();
    Map<Project, BasicGradleProject> convertedProjects = new LinkedHashMap<Project, BasicGradleProject>();
    Project rootProject = gradle.getRootProject();
    BasicGradleProject convertedRootProject = convert(rootProject, convertedProjects);
    model.setRootProject(convertedRootProject);
    for (Project project : rootProject.getAllprojects()) {
        model.addProject(convertedProjects.get(project));
    }
    for (IncludedBuild includedBuild : gradle.getIncludedBuilds()) {
        Gradle includedGradle = ((IncludedBuildInternal) includedBuild).getConfiguredBuild();
        DefaultGradleBuild convertedIncludedBuild = convert(includedGradle);
        model.addIncludedBuild(convertedIncludedBuild);
    }
    return model;
}
Also used : Project(org.gradle.api.Project) BasicGradleProject(org.gradle.tooling.internal.gradle.BasicGradleProject) IncludedBuildInternal(org.gradle.composite.internal.IncludedBuildInternal) DefaultGradleBuild(org.gradle.tooling.internal.gradle.DefaultGradleBuild) BasicGradleProject(org.gradle.tooling.internal.gradle.BasicGradleProject) Gradle(org.gradle.api.invocation.Gradle) LinkedHashMap(java.util.LinkedHashMap) IncludedBuild(org.gradle.api.initialization.IncludedBuild)

Example 2 with IncludedBuildInternal

use of org.gradle.composite.internal.IncludedBuildInternal in project gradle by gradle.

the class ClientProvidedBuildActionRunner method forceFullConfiguration.

private void forceFullConfiguration(GradleInternal gradle) {
    try {
        gradle.getServices().get(ProjectConfigurer.class).configureHierarchyFully(gradle.getRootProject());
        for (IncludedBuild includedBuild : gradle.getIncludedBuilds()) {
            GradleInternal build = ((IncludedBuildInternal) includedBuild).getConfiguredBuild();
            forceFullConfiguration(build);
        }
    } catch (BuildCancelledException e) {
        throw new InternalBuildCancelledException(e);
    } catch (RuntimeException e) {
        throw new BuildExceptionVersion1(e);
    }
}
Also used : IncludedBuildInternal(org.gradle.composite.internal.IncludedBuildInternal) GradleInternal(org.gradle.api.internal.GradleInternal) BuildExceptionVersion1(org.gradle.tooling.internal.protocol.BuildExceptionVersion1) ProjectConfigurer(org.gradle.execution.ProjectConfigurer) InternalBuildCancelledException(org.gradle.tooling.internal.protocol.InternalBuildCancelledException) BuildCancelledException(org.gradle.api.BuildCancelledException) IncludedBuild(org.gradle.api.initialization.IncludedBuild) InternalBuildCancelledException(org.gradle.tooling.internal.protocol.InternalBuildCancelledException)

Aggregations

IncludedBuild (org.gradle.api.initialization.IncludedBuild)2 IncludedBuildInternal (org.gradle.composite.internal.IncludedBuildInternal)2 LinkedHashMap (java.util.LinkedHashMap)1 BuildCancelledException (org.gradle.api.BuildCancelledException)1 Project (org.gradle.api.Project)1 GradleInternal (org.gradle.api.internal.GradleInternal)1 Gradle (org.gradle.api.invocation.Gradle)1 ProjectConfigurer (org.gradle.execution.ProjectConfigurer)1 BasicGradleProject (org.gradle.tooling.internal.gradle.BasicGradleProject)1 DefaultGradleBuild (org.gradle.tooling.internal.gradle.DefaultGradleBuild)1 BuildExceptionVersion1 (org.gradle.tooling.internal.protocol.BuildExceptionVersion1)1 InternalBuildCancelledException (org.gradle.tooling.internal.protocol.InternalBuildCancelledException)1