Search in sources :

Example 1 with ExtractedRuleSource

use of org.gradle.model.internal.inspect.ExtractedRuleSource in project gradle by gradle.

the class RuleBasedPluginApplicator method applyRules.

public void applyRules(@Nullable String pluginId, Class<?> clazz) {
    ModelRegistry modelRegistry = target.getModelRegistry();
    Iterable<Class<? extends RuleSource>> declaredSources = ruleDetector.getDeclaredSources(clazz);
    for (Class<? extends RuleSource> ruleSource : declaredSources) {
        ExtractedRuleSource<?> rules = ruleInspector.extract(ruleSource);
        for (Class<?> dependency : rules.getRequiredPlugins()) {
            target.getPluginManager().apply(dependency);
        }
        modelRegistry.getRoot().applyToSelf(rules);
    }
}
Also used : RuleSource(org.gradle.model.RuleSource) ExtractedRuleSource(org.gradle.model.internal.inspect.ExtractedRuleSource) ModelRegistry(org.gradle.model.internal.registry.ModelRegistry)

Aggregations

RuleSource (org.gradle.model.RuleSource)1 ExtractedRuleSource (org.gradle.model.internal.inspect.ExtractedRuleSource)1 ModelRegistry (org.gradle.model.internal.registry.ModelRegistry)1