use of org.gradle.api.artifacts.component.BuildIdentifier in project gradle by gradle.
the class IdeaPlugin method allImlArtifactsInComposite.
private List<TaskDependency> allImlArtifactsInComposite(ProjectInternal project, IdeaProject ideaProject) {
List<TaskDependency> dependencies = Lists.newArrayList();
ProjectComponentIdentifier thisProjectId = projectPathRegistry.getProjectComponentIdentifier(project.getIdentityPath());
for (IdeArtifactRegistry.Reference<IdeaModuleMetadata> reference : artifactRegistry.getIdeArtifactMetadata(IdeaModuleMetadata.class)) {
BuildIdentifier otherBuildId = reference.getOwningProject().getBuild();
if (thisProjectId.getBuild().equals(otherBuildId)) {
// IDEA Module for project in current build: don't include any module that has been excluded from project
boolean found = false;
for (IdeaModule ideaModule : ideaProject.getModules()) {
if (reference.get().getFile().equals(ideaModule.getOutputFile())) {
found = true;
break;
}
}
if (!found) {
continue;
}
}
dependencies.add(reference.getBuildDependencies());
}
return dependencies;
}
use of org.gradle.api.artifacts.component.BuildIdentifier in project gradle by gradle.
the class IdeaProject method configureModulePaths.
private void configureModulePaths(Project xmlProject) {
ProjectComponentIdentifier thisProjectId = projectPathRegistry.getProjectComponentIdentifier(((ProjectInternal) project).getIdentityPath());
for (IdeArtifactRegistry.Reference<IdeaModuleMetadata> reference : artifactRegistry.getIdeArtifactMetadata(IdeaModuleMetadata.class)) {
BuildIdentifier otherBuildId = reference.getOwningProject().getBuild();
if (thisProjectId.getBuild().equals(otherBuildId)) {
// IDEA Module for project in current build: handled via `modules` model elements.
continue;
}
xmlProject.addModulePath(reference.get().getFile());
}
}
use of org.gradle.api.artifacts.component.BuildIdentifier 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.artifacts.component.BuildIdentifier in project gradle by gradle.
the class DefaultIncludedBuildExecuter method reportCycle.
private String reportCycle(List<BuildIdentifier> cycle) {
StringBuilder cycleReport = new StringBuilder();
for (BuildIdentifier buildIdentifier : cycle) {
cycleReport.append(buildIdentifier);
cycleReport.append(" -> ");
}
cycleReport.append(cycle.get(0));
return cycleReport.toString();
}
use of org.gradle.api.artifacts.component.BuildIdentifier in project gradle by gradle.
the class IncludedBuildArtifactBuilder method willBuild.
public void willBuild(ComponentArtifactMetadata artifact) {
if (artifact instanceof CompositeProjectComponentArtifactMetadata) {
CompositeProjectComponentArtifactMetadata compositeBuildArtifact = (CompositeProjectComponentArtifactMetadata) artifact;
BuildIdentifier buildId = getBuildIdentifier(compositeBuildArtifact);
addTasksForBuild(buildId, compositeBuildArtifact);
}
}
Aggregations