use of org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier in project gradle by gradle.
the class JvmTestSuiteBasePlugin method createResolveContext.
private static JvmLibraryResolveContext createResolveContext(JvmTestSuiteBinarySpecInternal testBinary, ModelSchema<? extends JvmTestSuiteBinarySpec> schema, ImmutableModuleIdentifierFactory moduleIdentifierFactory) {
// TODO:Cedric find out why if we use the same ID directly, it fails resolution by trying to get the artifacts
// from the resolving metadata instead of the resolved metadata
LibraryBinaryIdentifier id = testBinary.getId();
LibraryBinaryIdentifier thisId = new DefaultLibraryBinaryIdentifier(id.getProjectPath(), id.getLibraryName() + "Test", id.getVariant());
return new JvmLibraryResolveContext(thisId, DefaultVariantsMetaData.extractFrom(testBinary, schema), runtimeDependencies(testBinary), UsageKind.RUNTIME, testBinary.getDisplayName(), moduleIdentifierFactory);
}
use of org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier in project gradle by gradle.
the class ComponentIdentifierSerializer method read.
@Override
public ComponentIdentifier 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 DefaultProjectComponentIdentifier(buildIdentifier, Path.ROOT, Path.ROOT, projectName);
} else if (Implementation.ROOT_BUILD_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
Path projectPath = Path.path(decoder.readString());
return new DefaultProjectComponentIdentifier(buildIdentifier, projectPath, projectPath, projectPath.getName());
} else if (Implementation.OTHER_BUILD_ROOT_PROJECT.getId() == id) {
BuildIdentifier buildIdentifier = buildIdentifierSerializer.read(decoder);
Path identityPath = Path.path(decoder.readString());
return new DefaultProjectComponentIdentifier(buildIdentifier, identityPath, Path.ROOT, identityPath.getName());
} 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 DefaultProjectComponentIdentifier(buildIdentifier, identityPath, projectPath, identityPath.getName());
} else if (Implementation.MODULE.getId() == id) {
return new DefaultModuleComponentIdentifier(DefaultModuleIdentifier.newId(decoder.readString(), decoder.readString()), decoder.readString());
} else if (Implementation.SNAPSHOT.getId() == id) {
return new MavenUniqueSnapshotComponentIdentifier(DefaultModuleIdentifier.newId(decoder.readString(), decoder.readString()), decoder.readString(), decoder.readString());
} else if (Implementation.LIBRARY.getId() == id) {
return new DefaultLibraryBinaryIdentifier(decoder.readString(), decoder.readString(), decoder.readString());
} else if (Implementation.OPAQUE.getId() == id) {
return new OpaqueComponentArtifactIdentifier(new File(decoder.readString()));
}
throw new IllegalArgumentException("Unable to find component identifier type with id: " + id);
}
Aggregations