use of org.gradle.api.artifacts.ComponentModuleMetadataDetails in project gradle by gradle.
the class ComponentModuleMetadataContainer method module.
public ComponentModuleMetadataDetails module(final Object sourceModule) {
final NotationParser<Object, ModuleIdentifier> parser = parser(moduleIdentifierFactory);
final ModuleIdentifier source = parser.parseNotation(sourceModule);
return new ComponentModuleMetadataDetails() {
@Override
public void replacedBy(Object moduleNotation) {
replacedBy(moduleNotation, null);
}
@Override
public void replacedBy(final Object targetModule, @Nullable String reason) {
ModuleIdentifier target = parser.parseNotation(targetModule);
detectCycles(replacements, source, target);
replacements.put(source, new Replacement(target, reason));
targets.add(target);
}
@Override
public ModuleIdentifier getId() {
return source;
}
@Override
public ModuleIdentifier getReplacedBy() {
return unwrap(replacements.get(source));
}
};
}
Aggregations