Search in sources :

Example 1 with AmbiguousBindingReporter

use of org.gradle.model.internal.report.AmbiguousBindingReporter in project gradle by gradle.

the class ModelBinding method onBind.

public final void onBind(ModelNodeInternal node) {
    if (boundTo != null) {
        ModelRuleDescriptor creatorDescriptor = node.getDescriptor();
        ModelPath path = node.getPath();
        throw new InvalidModelRuleException(referrer, new ModelRuleBindingException(new AmbiguousBindingReporter(predicate.getReference(), boundTo.getPath(), boundTo.getDescriptor(), path, creatorDescriptor).asString()));
    }
    doOnBind(node);
}
Also used : InvalidModelRuleException(org.gradle.model.InvalidModelRuleException) ModelPath(org.gradle.model.internal.core.ModelPath) ModelRuleBindingException(org.gradle.model.ModelRuleBindingException) AmbiguousBindingReporter(org.gradle.model.internal.report.AmbiguousBindingReporter) ModelRuleDescriptor(org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor)

Aggregations

InvalidModelRuleException (org.gradle.model.InvalidModelRuleException)1 ModelRuleBindingException (org.gradle.model.ModelRuleBindingException)1 ModelPath (org.gradle.model.internal.core.ModelPath)1 ModelRuleDescriptor (org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor)1 AmbiguousBindingReporter (org.gradle.model.internal.report.AmbiguousBindingReporter)1