use of org.gradle.internal.build.RootBuildState 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.build.RootBuildState 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;
}
Aggregations