Search in sources :

Example 1 with RuleHelper

use of com.buschmais.jqassistant.core.rule.api.RuleHelper in project jqa-maven-plugin by jQAssistant.

the class AvailableRulesMojo method aggregate.

@Override
public void aggregate(MavenProject rootModule, List<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
    getLog().info("Available rules for '" + rootModule.getName() + "'.");
    RuleSet ruleSet = readRules(rootModule);
    RuleHelper ruleHelper = new RuleHelper(LOGGER);
    try {
        ruleHelper.printRuleSet(ruleSet);
    } catch (RuleException e) {
        throw new MojoExecutionException("Cannot print available rules.", e);
    }
}
Also used : RuleSet(com.buschmais.jqassistant.core.rule.api.model.RuleSet) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) RuleHelper(com.buschmais.jqassistant.core.rule.api.RuleHelper) RuleException(com.buschmais.jqassistant.core.rule.api.model.RuleException)

Example 2 with RuleHelper

use of com.buschmais.jqassistant.core.rule.api.RuleHelper in project jqa-maven-plugin by jQAssistant.

the class EffectiveRulesMojo method aggregate.

@Override
public void aggregate(MavenProject rootModule, List<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
    getLog().info("Effective rules for '" + rootModule.getName() + "'.");
    RuleSet ruleSet = readRules(rootModule);
    RuleSelection ruleSelection = RuleSelection.select(ruleSet, groups, constraints, concepts);
    RuleHelper ruleHelper = new RuleHelper(LOGGER);
    try {
        ruleHelper.printRuleSet(ruleSet, ruleSelection);
    } catch (RuleException e) {
        throw new MojoExecutionException("Cannot print effective rules.", e);
    }
}
Also used : RuleSet(com.buschmais.jqassistant.core.rule.api.model.RuleSet) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) RuleSelection(com.buschmais.jqassistant.core.rule.api.model.RuleSelection) RuleHelper(com.buschmais.jqassistant.core.rule.api.RuleHelper) RuleException(com.buschmais.jqassistant.core.rule.api.model.RuleException)

Example 3 with RuleHelper

use of com.buschmais.jqassistant.core.rule.api.RuleHelper in project jqa-maven-plugin by jQAssistant.

the class AvailableRulesMojo method aggregate.

@Override
public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException {
    getLog().info("Available rules for '" + mojoExecutionContext.getRootModule().getName() + "'.");
    RuleSet ruleSet = readRules(mojoExecutionContext);
    RuleHelper ruleHelper = new RuleHelper(LOGGER);
    try {
        ruleHelper.printRuleSet(ruleSet, mojoExecutionContext.getConfiguration().analyze().rule());
    } catch (RuleException e) {
        throw new MojoExecutionException("Cannot print available rules.", e);
    }
}
Also used : RuleSet(com.buschmais.jqassistant.core.rule.api.model.RuleSet) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) RuleHelper(com.buschmais.jqassistant.core.rule.api.RuleHelper) RuleException(com.buschmais.jqassistant.core.rule.api.model.RuleException)

Example 4 with RuleHelper

use of com.buschmais.jqassistant.core.rule.api.RuleHelper in project jqa-maven-plugin by jQAssistant.

the class EffectiveRulesMojo method aggregate.

@Override
public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException {
    getLog().info("Effective rules for '" + mojoExecutionContext.getRootModule().getName() + "'.");
    Analyze analyze = mojoExecutionContext.getConfiguration().analyze();
    RuleSet ruleSet = readRules(mojoExecutionContext);
    RuleSelection ruleSelection = RuleSelection.select(ruleSet, analyze.groups(), analyze.constraints(), analyze.concepts());
    RuleHelper ruleHelper = new RuleHelper(LOGGER);
    try {
        ruleHelper.printRuleSet(ruleSet, ruleSelection, analyze.rule());
    } catch (RuleException e) {
        throw new MojoExecutionException("Cannot print effective rules.", e);
    }
}
Also used : RuleSet(com.buschmais.jqassistant.core.rule.api.model.RuleSet) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) RuleSelection(com.buschmais.jqassistant.core.rule.api.model.RuleSelection) RuleHelper(com.buschmais.jqassistant.core.rule.api.RuleHelper) RuleException(com.buschmais.jqassistant.core.rule.api.model.RuleException) Analyze(com.buschmais.jqassistant.core.analysis.api.configuration.Analyze)

Example 5 with RuleHelper

use of com.buschmais.jqassistant.core.rule.api.RuleHelper in project jqa-commandline-tool by jQAssistant.

the class AbstractTask method initialize.

@Override
public void initialize(PluginRepository pluginRepository, Map<String, Object> pluginProperties) {
    this.outputDirectory = new File(DEFAULT_OUTPUT_DIRECTORY);
    this.pluginRepository = pluginRepository;
    this.pluginProperties = pluginProperties;
    this.ruleHelper = new RuleHelper(LOGGER);
}
Also used : RuleHelper(com.buschmais.jqassistant.core.rule.api.RuleHelper) File(java.io.File)

Aggregations

RuleHelper (com.buschmais.jqassistant.core.rule.api.RuleHelper)5 RuleException (com.buschmais.jqassistant.core.rule.api.model.RuleException)4 RuleSet (com.buschmais.jqassistant.core.rule.api.model.RuleSet)4 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 RuleSelection (com.buschmais.jqassistant.core.rule.api.model.RuleSelection)2 Analyze (com.buschmais.jqassistant.core.analysis.api.configuration.Analyze)1 File (java.io.File)1