use of org.gradle.api.initialization.IncludedBuild 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;
}
use of org.gradle.api.initialization.IncludedBuild in project gradle by gradle.
the class DefaultCompositeContextBuilder method addToCompositeContext.
@Override
public void addToCompositeContext(Iterable<IncludedBuild> includedBuilds) {
IncludedBuildDependencySubstitutionsBuilder contextBuilder = new IncludedBuildDependencySubstitutionsBuilder(context);
for (IncludedBuild includedBuild : includedBuilds) {
allIncludedBuilds.registerBuild(includedBuild);
doAddToCompositeContext((IncludedBuildInternal) includedBuild, contextBuilder);
}
}
use of org.gradle.api.initialization.IncludedBuild in project gradle by gradle.
the class CompositeBuildSettingsLoader method findAndLoadSettings.
@Override
public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
SettingsInternal settings = delegate.findAndLoadSettings(gradle);
Collection<IncludedBuild> includedBuilds = getIncludedBuilds(gradle.getStartParameter(), settings);
if (!includedBuilds.isEmpty()) {
gradle.setIncludedBuilds(includedBuilds);
if (gradle.getStartParameter().isContinuous()) {
LOGGER.warn("[composite-build] Warning: continuous build doesn't detect changes in included builds.");
}
CompositeContextBuilder compositeContextBuilder = buildServices.get(CompositeContextBuilder.class);
compositeContextBuilder.addToCompositeContext(includedBuilds);
}
return settings;
}
use of org.gradle.api.initialization.IncludedBuild in project gradle by gradle.
the class CompositeBuildTaskDelegate method executeTasksInOtherBuild.
@TaskAction
public void executeTasksInOtherBuild() {
IncludedBuilds includedBuilds = getServices().get(IncludedBuilds.class);
IncludedBuildExecuter builder = getServices().get(IncludedBuildExecuter.class);
IncludedBuild includedBuild = includedBuilds.getBuild(build);
BuildIdentifier buildId = new DefaultBuildIdentifier(includedBuild.getName());
// sourceBuild is currently always root build in a composite
builder.execute(new DefaultBuildIdentifier(":", true), buildId, tasks);
}
use of org.gradle.api.initialization.IncludedBuild 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);
}
}
Aggregations