Search in sources :

Example 1 with ModuleDependencyMetadata

use of org.gradle.internal.component.external.model.ModuleDependencyMetadata in project gradle by gradle.

the class ClientModuleResolver method resolve.

public void resolve(ComponentIdentifier identifier, ComponentOverrideMetadata componentOverrideMetadata, BuildableComponentResolveResult result) {
    resolver.resolve(identifier, componentOverrideMetadata, result);
    if (result.getFailure() != null) {
        return;
    }
    ClientModule clientModule = componentOverrideMetadata.getClientModule();
    if (clientModule != null) {
        ModuleComponentResolveMetadata originalMetadata = (ModuleComponentResolveMetadata) result.getMetadata();
        List<ModuleDependencyMetadata> clientModuleDependencies = createClientModuleDependencies(identifier, clientModule);
        ModuleComponentArtifactMetadata clientModuleArtifact = createClientModuleArtifact(originalMetadata);
        ClientModuleComponentResolveMetadata clientModuleMetaData = new ClientModuleComponentResolveMetadata(originalMetadata, clientModuleArtifact, clientModuleDependencies);
        result.setMetadata(clientModuleMetaData);
    }
}
Also used : ModuleComponentResolveMetadata(org.gradle.internal.component.external.model.ModuleComponentResolveMetadata) ModuleDependencyMetadata(org.gradle.internal.component.external.model.ModuleDependencyMetadata) ModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata) ClientModule(org.gradle.api.artifacts.ClientModule)

Example 2 with ModuleDependencyMetadata

use of org.gradle.internal.component.external.model.ModuleDependencyMetadata in project gradle by gradle.

the class ClientModuleResolver method createClientModuleDependencies.

private List<ModuleDependencyMetadata> createClientModuleDependencies(ComponentIdentifier identifier, ClientModule clientModule) {
    List<ModuleDependencyMetadata> dependencies = Lists.newArrayList();
    for (ModuleDependency moduleDependency : clientModule.getDependencies()) {
        ModuleDependencyMetadata dependencyMetadata = createDependencyMetadata(identifier, moduleDependency);
        dependencies.add(dependencyMetadata);
    }
    return dependencies;
}
Also used : ModuleDependency(org.gradle.api.artifacts.ModuleDependency) ModuleDependencyMetadata(org.gradle.internal.component.external.model.ModuleDependencyMetadata)

Example 3 with ModuleDependencyMetadata

use of org.gradle.internal.component.external.model.ModuleDependencyMetadata in project gradle by gradle.

the class AbstractDependencyMetadataAdapter method version.

@Override
public T version(Action<? super MutableVersionConstraint> configureAction) {
    DefaultMutableVersionConstraint mutableVersionConstraint = new DefaultMutableVersionConstraint(getVersionConstraint());
    configureAction.execute(mutableVersionConstraint);
    ModuleDependencyMetadata dependencyMetadata = getOriginalMetadata().withRequestedVersion(mutableVersionConstraint);
    updateMetadata(dependencyMetadata);
    return Cast.uncheckedCast(this);
}
Also used : DefaultMutableVersionConstraint(org.gradle.api.internal.artifacts.dependencies.DefaultMutableVersionConstraint) ModuleDependencyMetadata(org.gradle.internal.component.external.model.ModuleDependencyMetadata)

Aggregations

ModuleDependencyMetadata (org.gradle.internal.component.external.model.ModuleDependencyMetadata)3 ClientModule (org.gradle.api.artifacts.ClientModule)1 ModuleDependency (org.gradle.api.artifacts.ModuleDependency)1 DefaultMutableVersionConstraint (org.gradle.api.internal.artifacts.dependencies.DefaultMutableVersionConstraint)1 ModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata)1 ModuleComponentResolveMetadata (org.gradle.internal.component.external.model.ModuleComponentResolveMetadata)1