use of org.gradle.api.internal.artifacts.ForeignBuildIdentifier in project gradle by gradle.
the class AbstractCompositeParticipantBuildState method idToReferenceProjectFromAnotherBuild.
@Override
public ProjectComponentIdentifier idToReferenceProjectFromAnotherBuild(ProjectComponentIdentifier identifier) {
// Need to use a 'foreign' build id to make BuildIdentifier.isCurrentBuild and BuildIdentifier.name work in dependency results
DefaultProjectComponentIdentifier original = (DefaultProjectComponentIdentifier) identifier;
String name = getIdentityPath().getName();
if (name == null) {
name = getBuildIdentifier().getName();
}
return new DefaultProjectComponentIdentifier(new ForeignBuildIdentifier(getBuildIdentifier().getName(), name), original.getIdentityPath(), original.projectPath(), original.getProjectName());
}
Aggregations