Search in sources :

Example 1 with InvocationResult

use of com.societegenerale.commons.plugin.service.InvokableRules.InvocationResult in project arch-unit-build-plugin-core by societe-generale.

the class RuleInvokerService method invokeConfigurableRules.

private String invokeConfigurableRules(ConfigurableRule rule) {
    if (rule.isSkip()) {
        if (log.isInfoEnabled()) {
            log.info("Skipping rule " + rule.getRule());
        }
        return "";
    }
    InvokableRules invokableRules = InvokableRules.of(rule.getRule(), rule.getChecks(), log);
    String fullPathFromRootTopackage = getPackageNameOnWhichToApplyRules(rule);
    log.info("invoking ConfigurableRule " + rule.toString() + " on " + fullPathFromRootTopackage);
    JavaClasses classes = archUtils.importAllClassesInPackage(new RootClassFolder(""), fullPathFromRootTopackage, excludedPaths);
    InvocationResult result = invokableRules.invokeOn(classes);
    return result.getMessage();
}
Also used : JavaClasses(com.tngtech.archunit.core.domain.JavaClasses) InvocationResult(com.societegenerale.commons.plugin.service.InvokableRules.InvocationResult) RootClassFolder(com.societegenerale.commons.plugin.model.RootClassFolder)

Aggregations

RootClassFolder (com.societegenerale.commons.plugin.model.RootClassFolder)1 InvocationResult (com.societegenerale.commons.plugin.service.InvokableRules.InvocationResult)1 JavaClasses (com.tngtech.archunit.core.domain.JavaClasses)1