use of org.gradle.internal.component.local.model.DefaultLibraryComponentSelector in project gradle by gradle.
the class ComponentSelectorSerializer method read.
@Override
public ComponentSelector read(Decoder decoder) throws IOException {
byte id = decoder.readByte();
if (Implementation.ROOT_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
String projectName = decoder.readString();
return new DefaultProjectComponentSelector(buildIdentifier, Path.ROOT, Path.ROOT, projectName, readAttributes(decoder), readCapabilities(decoder));
} else if (Implementation.ROOT_BUILD_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
Path projectPath = Path.path(decoder.readString());
return new DefaultProjectComponentSelector(buildIdentifier, projectPath, projectPath, projectPath.getName(), readAttributes(decoder), readCapabilities(decoder));
} else if (Implementation.OTHER_BUILD_ROOT_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
Path identityPath = Path.path(decoder.readString());
return new DefaultProjectComponentSelector(buildIdentifier, identityPath, Path.ROOT, identityPath.getName(), readAttributes(decoder), readCapabilities(decoder));
} else if (Implementation.OTHER_BUILD_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
Path identityPath = Path.path(decoder.readString());
Path projectPath = Path.path(decoder.readString());
return new DefaultProjectComponentSelector(buildIdentifier, identityPath, projectPath, projectPath.getName(), readAttributes(decoder), readCapabilities(decoder));
} else if (Implementation.MODULE.getId() == id) {
return DefaultModuleComponentSelector.newSelector(DefaultModuleIdentifier.newId(decoder.readString(), decoder.readString()), readVersionConstraint(decoder), readAttributes(decoder), readCapabilities(decoder));
} else if (Implementation.LIBRARY.getId() == id) {
return new DefaultLibraryComponentSelector(decoder.readString(), decoder.readNullableString(), decoder.readNullableString());
}
throw new IllegalArgumentException("Unable to find component selector with id: " + id);
}
use of org.gradle.internal.component.local.model.DefaultLibraryComponentSelector in project gradle by gradle.
the class DefaultLibraryLocalComponentMetadata method projectDependencyMetadata.
// TODO: projectDependency should be transformed based on defaultProject (and other context) elsewhere.
private LocalOriginDependencyMetadata projectDependencyMetadata(ProjectDependencySpec projectDependency, String defaultProject, String usageConfigurationName) {
String projectPath = projectDependency.getProjectPath();
if (isNullOrEmpty(projectPath)) {
projectPath = defaultProject;
}
String libraryName = projectDependency.getLibraryName();
ComponentSelector selector = new DefaultLibraryComponentSelector(projectPath, libraryName);
return dependencyMetadataFor(selector, usageConfigurationName, usageConfigurationName);
}
use of org.gradle.internal.component.local.model.DefaultLibraryComponentSelector in project gradle by gradle.
the class DefaultLibraryLocalComponentMetadata method binaryDependencyMetadata.
private LocalOriginDependencyMetadata binaryDependencyMetadata(LibraryBinaryDependencySpec binarySpec, String usageConfigurationName) {
String projectPath = binarySpec.getProjectPath();
String libraryName = binarySpec.getLibraryName();
ComponentSelector selector = new DefaultLibraryComponentSelector(projectPath, libraryName, binarySpec.getVariant());
return dependencyMetadataFor(selector, usageConfigurationName, usageConfigurationName);
}
Aggregations