use of org.gradle.internal.composite.IncludedBuildInternal in project gradle by gradle.
the class GradleBuildBuilder method addIncludedBuilds.
private void addIncludedBuilds(GradleInternal gradle, DefaultGradleBuild model, Map<BuildState, DefaultGradleBuild> all) {
for (IncludedBuildInternal reference : gradle.includedBuilds()) {
BuildState target = reference.getTarget();
if (target instanceof IncludedBuildState) {
IncludedBuildState includedBuildState = (IncludedBuildState) target;
DefaultGradleBuild convertedIncludedBuild = convert(includedBuildState, all);
model.addIncludedBuild(convertedIncludedBuild);
} else if (target instanceof RootBuildState) {
DefaultGradleBuild rootBuild = convert(target, all);
model.addIncludedBuild(rootBuild);
} else {
throw new IllegalStateException("Unknown build type: " + reference.getClass().getName());
}
}
}
use of org.gradle.internal.composite.IncludedBuildInternal in project gradle by gradle.
the class IdeaModelBuilder method applyIdeaPlugin.
private void applyIdeaPlugin(ProjectInternal root, List<GradleInternal> alreadyProcessed) {
Set<Project> allProjects = root.getAllprojects();
for (Project p : allProjects) {
p.getPluginManager().apply(IdeaPlugin.class);
}
for (IncludedBuildInternal reference : root.getGradle().includedBuilds()) {
BuildState target = reference.getTarget();
if (target instanceof IncludedBuildState) {
target.ensureProjectsConfigured();
GradleInternal build = target.getMutableModel();
if (!alreadyProcessed.contains(build)) {
alreadyProcessed.add(build);
applyIdeaPlugin(build.getRootProject(), alreadyProcessed);
}
}
}
}
use of org.gradle.internal.composite.IncludedBuildInternal in project gradle by gradle.
the class EclipseModelBuilder method collectAllProjects.
private List<Project> collectAllProjects(List<Project> all, GradleInternal gradle, Set<Gradle> allBuilds) {
all.addAll(gradle.getRootProject().getAllprojects());
for (IncludedBuildInternal reference : gradle.includedBuilds()) {
BuildState target = reference.getTarget();
if (target instanceof IncludedBuildState) {
target.ensureProjectsConfigured();
GradleInternal build = target.getMutableModel();
if (!allBuilds.contains(build)) {
allBuilds.add(build);
collectAllProjects(all, build, allBuilds);
}
}
}
return all;
}
use of org.gradle.internal.composite.IncludedBuildInternal in project gradle by gradle.
the class EclipseModelBuilder method applyEclipsePlugin.
private void applyEclipsePlugin(ProjectInternal root, List<GradleInternal> alreadyProcessed) {
Set<Project> allProjects = root.getAllprojects();
for (Project p : allProjects) {
p.getPluginManager().apply(EclipsePlugin.class);
}
for (IncludedBuildInternal reference : root.getGradle().includedBuilds()) {
BuildState target = reference.getTarget();
if (target instanceof IncludedBuildState) {
target.ensureProjectsConfigured();
GradleInternal build = target.getMutableModel();
if (!alreadyProcessed.contains(build)) {
alreadyProcessed.add(build);
applyEclipsePlugin(build.getRootProject(), alreadyProcessed);
}
}
}
}
use of org.gradle.internal.composite.IncludedBuildInternal in project gradle by gradle.
the class DefaultIncludedBuildRegistry method ensureConfigured.
@Override
public void ensureConfigured(IncludedBuildState buildToConfigure) {
if (currentlyConfiguring.contains(buildToConfigure)) {
return;
}
currentlyConfiguring.add(buildToConfigure);
buildToConfigure.ensureProjectsConfigured();
GradleInternal gradle = buildToConfigure.getMutableModel();
for (IncludedBuildInternal reference : gradle.includedBuilds()) {
BuildState target = reference.getTarget();
if (target instanceof IncludedBuildState) {
dependencySubstitutionsBuilder.build((IncludedBuildState) target);
}
}
currentlyConfiguring.remove(buildToConfigure);
}
Aggregations