use of org.gradle.internal.build.BuildState 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.build.BuildState in project gradle by gradle.
the class DefaultBuildController method getTarget.
private ToolingModelScope getTarget(@Nullable Object target, ModelIdentifier modelIdentifier, boolean parameter) {
if (target == null) {
return controller.locateBuilderForDefaultTarget(modelIdentifier.getName(), parameter);
} else if (target instanceof GradleProjectIdentity) {
GradleProjectIdentity projectIdentity = (GradleProjectIdentity) target;
BuildState build = findBuild(projectIdentity);
ProjectState project = findProject(build, projectIdentity);
return controller.locateBuilderForTarget(project, modelIdentifier.getName(), parameter);
} else if (target instanceof GradleBuildIdentity) {
GradleBuildIdentity buildIdentity = (GradleBuildIdentity) target;
BuildState build = findBuild(buildIdentity);
return controller.locateBuilderForTarget(build, modelIdentifier.getName(), parameter);
} else {
throw new IllegalArgumentException("Don't know how to build models for " + target);
}
}
use of org.gradle.internal.build.BuildState in project gradle by gradle.
the class DefaultIncludedBuildRegistry method addBuild.
private void addBuild(BuildState build) {
BuildState before = buildsByIdentifier.put(build.getBuildIdentifier(), build);
if (before != null) {
throw new IllegalArgumentException("Build is already registered: " + build.getBuildIdentifier());
}
buildAddedBroadcaster.buildAdded(build);
maybeAddBuildSrcBuild(build);
}
use of org.gradle.internal.build.BuildState in project gradle by gradle.
the class DefaultIncludedBuildRegistry method visitBuilds.
@Override
public void visitBuilds(Consumer<? super BuildState> visitor) {
List<BuildState> ordered = new ArrayList<>(buildsByIdentifier.values());
ordered.sort(Comparator.comparing(BuildState::getIdentityPath));
for (BuildState buildState : ordered) {
visitor.accept(buildState);
}
}
use of org.gradle.internal.build.BuildState 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