use of org.gradle.internal.build.IncludedBuildState 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.build.IncludedBuildState 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.IncludedBuildState in project gradle by gradle.
the class ChildBuildRegisteringSettingsLoader method findAndLoadSettings.
@Override
public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
SettingsInternal settings = delegate.findAndLoadSettings(gradle);
// Add included builds defined in settings
List<IncludedBuildSpec> includedBuilds = settings.getIncludedBuilds();
if (!includedBuilds.isEmpty()) {
Set<IncludedBuildInternal> children = new LinkedHashSet<>(includedBuilds.size());
RootBuildState rootBuild = buildRegistry.getRootBuild();
for (IncludedBuildSpec includedBuildSpec : includedBuilds) {
if (!includedBuildSpec.rootDir.equals(rootBuild.getBuildRootDir())) {
IncludedBuildState includedBuild = buildIncluder.includeBuild(includedBuildSpec);
children.add(includedBuild.getModel());
} else {
buildRegistry.registerSubstitutionsForRootBuild();
children.add(buildRegistry.getRootBuild().getModel());
}
}
// Set the visible included builds
gradle.setIncludedBuilds(children);
} else {
gradle.setIncludedBuilds(Collections.emptyList());
}
return settings;
}
use of org.gradle.internal.build.IncludedBuildState in project gradle by gradle.
the class ProjectReportTask method generate.
@Override
protected void generate(Project project) {
BuildClientMetaData metaData = getClientMetaData();
StyledTextOutput textOutput = getRenderer().getTextOutput();
render(project, new GraphRenderer(textOutput), true, textOutput);
if (project.getChildProjects().isEmpty()) {
textOutput.withStyle(Info).text("No sub-projects");
textOutput.println();
}
if (project == project.getRootProject()) {
int i = 0;
Collection<? extends IncludedBuildState> includedBuilds = getBuildStateRegistry().getIncludedBuilds();
if (!includedBuilds.isEmpty()) {
GraphRenderer renderer = new GraphRenderer(textOutput);
textOutput.println();
textOutput.text("Included builds");
textOutput.println();
renderer.startChildren();
for (IncludedBuildState includedBuildState : includedBuilds) {
renderer.visit(text -> {
textOutput.text("Included build '" + includedBuildState.getIdentityPath() + "'");
}, (i + 1) == includedBuilds.size());
i++;
}
renderer.completeChildren();
}
}
textOutput.println();
textOutput.text("To see a list of the tasks of a project, run ");
metaData.describeCommand(textOutput.withStyle(UserInput), "<project-path>:" + ProjectInternal.TASKS_TASK);
textOutput.println();
textOutput.text("For example, try running ");
Project exampleProject = project.getChildProjects().isEmpty() ? project : getChildren(project).get(0);
metaData.describeCommand(textOutput.withStyle(UserInput), exampleProject.absoluteProjectPath(ProjectInternal.TASKS_TASK));
textOutput.println();
if (project != project.getRootProject()) {
textOutput.println();
textOutput.text("To see a list of all the projects in this build, run ");
metaData.describeCommand(textOutput.withStyle(UserInput), project.getRootProject().absoluteProjectPath(ProjectInternal.PROJECTS_TASK));
textOutput.println();
}
}
use of org.gradle.internal.build.IncludedBuildState in project gradle by gradle.
the class DefaultIncludedBuildRegistry method finalizeIncludedBuilds.
@Override
public void finalizeIncludedBuilds() {
while (!pendingIncludedBuilds.isEmpty()) {
IncludedBuildState build = pendingIncludedBuilds.removeFirst();
assertNameDoesNotClashWithRootSubproject(build);
}
}
Aggregations