Search in sources :

Example 1 with JvmLibraryResolveContext

use of org.gradle.jvm.internal.resolve.JvmLibraryResolveContext 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);
}
Also used : DefaultLibraryBinaryIdentifier(org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier) LibraryBinaryIdentifier(org.gradle.api.artifacts.component.LibraryBinaryIdentifier) DefaultLibraryBinaryIdentifier(org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier) JvmLibraryResolveContext(org.gradle.jvm.internal.resolve.JvmLibraryResolveContext)

Aggregations

LibraryBinaryIdentifier (org.gradle.api.artifacts.component.LibraryBinaryIdentifier)1 DefaultLibraryBinaryIdentifier (org.gradle.internal.component.local.model.DefaultLibraryBinaryIdentifier)1 JvmLibraryResolveContext (org.gradle.jvm.internal.resolve.JvmLibraryResolveContext)1