/** * Adds the ids to the set of issues to check. */ public void check(String... ids) { for (String id : ids) { check(id); } }
/** * Adds the ids to the set of issues to enable. */ public void disable(String... ids) { for (String id : ids) { disable(id); } }
/** * Adds the ids to the set of issues to enable. */ public void enable(String... ids) { for (String id : ids) { enable(id); } }
if (output == null) { output = new File(flags.isFatalOnly() ? STDERR: STDOUT); } else if (!output.isAbsolute() && !isStdOut(output) && !isStdErr(output)) { output = project.file(output.getPath()); output = validateOutputFile(output); if (isStdOut(output)) { writer = new PrintWriter(System.out, true); closeWriter = false; } else if (isStdErr(output)) { writer = new PrintWriter(System.err, true); closeWriter = false; File output = htmlOutput; if (output == null || flags.isFatalOnly()) { output = createOutputPath(project, variantName, ".html", flags.isFatalOnly()); } else if (!output.isAbsolute()) { output = project.file(output.getPath()); output = validateOutputFile(output); try { flags.getReporters().add(new HtmlReporter(client, output)); File output = xmlOutput; if (output == null || flags.isFatalOnly()) { output = createOutputPath(project, variantName, DOT_XML, flags.isFatalOnly()); } else if (!output.isAbsolute()) { output = project.file(output.getPath());
/** * An optional map of severity overrides. The map maps from issue id's to the corresponding * severity to use, which must be "fatal", "error", "warning", or "ignore". * * @return a map of severity overrides, or null. The severities are one of the constants * {@link #SEVERITY_FATAL}, {@link #SEVERITY_ERROR}, {@link #SEVERITY_WARNING}, * {@link #SEVERITY_INFORMATIONAL}, {@link #SEVERITY_IGNORE} */ @Override @Nullable public Map<String, Integer> getSeverityOverrides() { if (severities == null || severities.isEmpty()) { return null; } Map<String, Integer> map = Maps.newHashMapWithExpectedSize(severities.size()); for (Map.Entry<String,Severity> entry : severities.entrySet()) { map.put(entry.getKey(), convert(entry.getValue())); } return map; }
/** * Adds a severity override for the given issues. */ public void fatal(String... ids) { for (String id : ids) { fatal(id); } }
/** * Adds a severity override for the given issues. */ public void error(String... ids) { for (String id : ids) { error(id); } }
/** * Adds a severity override for the given issues. */ public void ignore(String... ids) { for (String id : ids) { ignore(id); } }
@NonNull public static com.android.builder.model.LintOptions create(@NonNull com.android.builder.model.LintOptions source) { return new LintOptions( source.getDisable(), source.getEnable(), source.getCheck(), source.getLintConfig(), source.getTextReport(), source.getTextOutput(), source.getHtmlReport(), source.getHtmlOutput(), source.getXmlReport(), source.getXmlOutput(), source.isAbortOnError(), source.isAbsolutePaths(), source.isNoLines(), source.isQuiet(), source.isCheckAllWarnings(), source.isIgnoreWarnings(), source.isWarningsAsErrors(), source.isShowAll(), source.isExplainIssues(), source.isCheckReleaseBuilds(), source.getSeverityOverrides() ); }
LintOptions lintOptions = com.android.build.gradle.internal.dsl.LintOptions.create( config.getLintOptions());
if (output == null) { output = new File(flags.isFatalOnly() ? STDERR: STDOUT); } else if (!output.isAbsolute() && !isStdOut(output) && !isStdErr(output)) { output = project.file(output.getPath()); output = validateOutputFile(output); if (isStdOut(output)) { } else if (isStdErr(output)) { File output = htmlOutput; if (output == null || flags.isFatalOnly()) { output = createOutputPath(project, variantName, ".html", reportsDir, flags.isFatalOnly()); } else if (!output.isAbsolute()) { output = project.file(output.getPath()); output = validateOutputFile(output); try { flags.getReporters().add(Reporter.createHtmlReporter(client, output, flags, File output = xmlOutput; if (output == null || flags.isFatalOnly()) { output = createOutputPath(project, variantName, DOT_XML, reportsDir, flags.isFatalOnly()); } else if (!output.isAbsolute()) { output = project.file(output.getPath());
/** * An optional map of severity overrides. The map maps from issue id's to the corresponding * severity to use, which must be "fatal", "error", "warning", or "ignore". * * @return a map of severity overrides, or null. The severities are one of the constants * {@link #SEVERITY_FATAL}, {@link #SEVERITY_ERROR}, {@link #SEVERITY_WARNING}, * {@link #SEVERITY_INFORMATIONAL}, {@link #SEVERITY_IGNORE} */ @Override @Nullable public Map<String, Integer> getSeverityOverrides() { if (severities == null || severities.isEmpty()) { return null; } Map<String, Integer> map = Maps.newHashMapWithExpectedSize(severities.size()); for (Map.Entry<String,Severity> entry : severities.entrySet()) { map.put(entry.getKey(), convert(entry.getValue())); } return map; }
/** * Adds a severity override for the given issues. */ public void fatal(String... ids) { for (String id : ids) { fatal(id); } }
/** * Adds a severity override for the given issues. */ public void error(String... ids) { for (String id : ids) { error(id); } }
/** * Adds a severity override for the given issues. */ public void ignore(String... ids) { for (String id : ids) { ignore(id); } }
@NonNull public static com.android.builder.model.LintOptions create(@NonNull com.android.builder.model.LintOptions source) { return new LintOptions( source.getDisable(), source.getEnable(), source.getCheck(), source.getLintConfig(), source.getTextReport(), source.getTextOutput(), source.getHtmlReport(), source.getHtmlOutput(), source.getXmlReport(), source.getXmlOutput(), source.isAbortOnError(), source.isAbsolutePaths(), source.isNoLines(), source.isQuiet(), source.isCheckAllWarnings(), source.isIgnoreWarnings(), source.isWarningsAsErrors(), source.isShowAll(), source.isExplainIssues(), source.isCheckReleaseBuilds(), source.getBaselineFile(), source.getSeverityOverrides() ); }
LintOptions lintOptions = com.android.build.gradle.internal.dsl.LintOptions.create( config.getLintOptions());
severities.put(entry.getKey(), convert(entry.getValue()));
/** * Adds the ids to the set of issues to enable. */ public void enable(String... ids) { for (String id : ids) { enable(id); } }
/** * Adds the ids to the set of issues to check. */ public void check(String... ids) { for (String id : ids) { check(id); } }