use of org.gradle.api.artifacts.ClientModule in project gradle by gradle.
the class ModuleFactoryDelegateTest method module.
@Test
public void module() {
final String clientModuleNotation = "someNotation";
final Closure configureClosure = TestUtil.toClosure("{}");
final ClientModule clientModuleDummy = context.mock(ClientModule.class);
context.checking(new Expectations() {
{
allowing(dependencyFactoryStub).createModule(clientModuleNotation, configureClosure);
will(returnValue(clientModuleDummy));
}
});
moduleFactoryDelegate.module(clientModuleNotation, configureClosure);
assertThat(this.clientModule.getDependencies(), Matchers.equalTo(WrapUtil.<ModuleDependency>toSet(clientModuleDummy)));
}
use of org.gradle.api.artifacts.ClientModule 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) {
MutableModuleComponentResolveMetadata clientModuleMetaData = ((ModuleComponentResolveMetadata) result.getMetaData()).asMutable();
addClientModuleDependencies(clientModule, clientModuleMetaData);
setClientModuleArtifact(clientModuleMetaData);
result.setMetaData(clientModuleMetaData.asImmutable());
}
}
Aggregations