Search in sources :

Example 1 with ForeignBuildIdentifier

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());
}
Also used : ForeignBuildIdentifier(org.gradle.api.internal.artifacts.ForeignBuildIdentifier) DefaultProjectComponentIdentifier(org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier)

Aggregations

DefaultProjectComponentIdentifier (org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier)1 ForeignBuildIdentifier (org.gradle.api.internal.artifacts.ForeignBuildIdentifier)1