Search in sources :

Example 1 with TextResource

use of org.gradle.api.resources.TextResource in project gradle by gradle.

the class CheckstylePlugin method configureTaskConventionMapping.

private void configureTaskConventionMapping(Configuration configuration, Checkstyle task) {
    ConventionMapping taskMapping = task.getConventionMapping();
    taskMapping.map("checkstyleClasspath", Callables.returning(configuration));
    taskMapping.map("config", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getConfig();
        }
    });
    taskMapping.map("configProperties", new Callable<Map<String, Object>>() {

        @Override
        public Map<String, Object> call() {
            return extension.getConfigProperties();
        }
    });
    taskMapping.map("ignoreFailures", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isIgnoreFailures();
        }
    });
    taskMapping.map("showViolations", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isShowViolations();
        }
    });
    taskMapping.map("maxErrors", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getMaxErrors();
        }
    });
    taskMapping.map("maxWarnings", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getMaxWarnings();
        }
    });
}
Also used : TextResource(org.gradle.api.resources.TextResource) ConventionMapping(org.gradle.api.internal.ConventionMapping) Map(java.util.Map)

Example 2 with TextResource

use of org.gradle.api.resources.TextResource in project gradle by gradle.

the class CodeNarcPlugin method configureTaskConventionMapping.

private void configureTaskConventionMapping(Configuration configuration, CodeNarc task) {
    ConventionMapping taskMapping = task.getConventionMapping();
    taskMapping.map("codenarcClasspath", Callables.returning(configuration));
    taskMapping.map("config", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getConfig();
        }
    });
    taskMapping.map("maxPriority1Violations", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getMaxPriority1Violations();
        }
    });
    taskMapping.map("maxPriority2Violations", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getMaxPriority2Violations();
        }
    });
    taskMapping.map("maxPriority3Violations", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getMaxPriority3Violations();
        }
    });
    taskMapping.map("ignoreFailures", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isIgnoreFailures();
        }
    });
}
Also used : TextResource(org.gradle.api.resources.TextResource) ConventionMapping(org.gradle.api.internal.ConventionMapping)

Example 3 with TextResource

use of org.gradle.api.resources.TextResource in project gradle by gradle.

the class FindBugsPlugin method configureTaskConventionMapping.

private void configureTaskConventionMapping(Configuration configuration, FindBugs task) {
    ConventionMapping taskMapping = task.getConventionMapping();
    taskMapping.map("findbugsClasspath", Callables.returning(configuration));
    taskMapping.map("ignoreFailures", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isIgnoreFailures();
        }
    });
    taskMapping.map("effort", new Callable<String>() {

        @Override
        public String call() {
            return extension.getEffort();
        }
    });
    taskMapping.map("reportLevel", new Callable<String>() {

        @Override
        public String call() {
            return extension.getReportLevel();
        }
    });
    taskMapping.map("visitors", new Callable<Collection<String>>() {

        @Override
        public Collection<String> call() {
            return extension.getVisitors();
        }
    });
    taskMapping.map("omitVisitors", new Callable<Collection<String>>() {

        @Override
        public Collection<String> call() {
            return extension.getOmitVisitors();
        }
    });
    taskMapping.map("excludeFilterConfig", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getExcludeFilterConfig();
        }
    });
    taskMapping.map("includeFilterConfig", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getIncludeFilterConfig();
        }
    });
    taskMapping.map("excludeBugsFilterConfig", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getExcludeBugsFilterConfig();
        }
    });
    taskMapping.map("extraArgs", new Callable<Collection<String>>() {

        @Override
        public Collection<String> call() {
            return extension.getExtraArgs();
        }
    });
}
Also used : TextResource(org.gradle.api.resources.TextResource) Collection(java.util.Collection) FileCollection(org.gradle.api.file.FileCollection) ConventionMapping(org.gradle.api.internal.ConventionMapping)

Example 4 with TextResource

use of org.gradle.api.resources.TextResource in project gradle by gradle.

the class PmdPlugin method configureTaskConventionMapping.

private void configureTaskConventionMapping(Configuration configuration, Pmd task) {
    ConventionMapping taskMapping = task.getConventionMapping();
    taskMapping.map("pmdClasspath", Callables.returning(configuration));
    taskMapping.map("ruleSets", new Callable<List<String>>() {

        @Override
        public List<String> call() {
            return extension.getRuleSets();
        }
    });
    taskMapping.map("ruleSetConfig", new Callable<TextResource>() {

        @Override
        public TextResource call() {
            return extension.getRuleSetConfig();
        }
    });
    taskMapping.map("ruleSetFiles", new Callable<FileCollection>() {

        @Override
        public FileCollection call() {
            return extension.getRuleSetFiles();
        }
    });
    taskMapping.map("ignoreFailures", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isIgnoreFailures();
        }
    });
    taskMapping.map("rulePriority", new Callable<Integer>() {

        @Override
        public Integer call() {
            return extension.getRulePriority();
        }
    });
    taskMapping.map("consoleOutput", new Callable<Boolean>() {

        @Override
        public Boolean call() {
            return extension.isConsoleOutput();
        }
    });
    taskMapping.map("targetJdk", new Callable<TargetJdk>() {

        @Override
        public TargetJdk call() {
            return extension.getTargetJdk();
        }
    });
}
Also used : TextResource(org.gradle.api.resources.TextResource) FileCollection(org.gradle.api.file.FileCollection) ConventionMapping(org.gradle.api.internal.ConventionMapping) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ConventionMapping (org.gradle.api.internal.ConventionMapping)4 TextResource (org.gradle.api.resources.TextResource)4 FileCollection (org.gradle.api.file.FileCollection)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 Map (java.util.Map)1