diff options
author | Tor Norbye <tnorbye@google.com> | 2012-02-28 12:02:46 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2012-02-28 12:02:46 -0800 |
commit | fd9fe37e806b8f14b2944d29f307cd050ecb419c (patch) | |
tree | c359698378b29eb16cda128043e6bc013bc4a710 /lint/cli | |
parent | 8c89972f765412b93834b18f43e93a77269bd2e7 (diff) | |
download | sdk-fd9fe37e806b8f14b2944d29f307cd050ecb419c.zip sdk-fd9fe37e806b8f14b2944d29f307cd050ecb419c.tar.gz sdk-fd9fe37e806b8f14b2944d29f307cd050ecb419c.tar.bz2 |
Fix configuration information for library projects
This changeset fixes one more bug related to lint configurations and
library projects (see issue 26029).
Some lint checks, such as the MergeRootFrameLayoutDetector, computes
the warnings at the end of processing all files. At that point, the
context points to the master project, so any errors which were
actually found in a library project will instead be using the master
project's configuration. That means that any suppress rules applies to
the lint.xml in the library project will be ignored.
This changeset fixes this by moving the logic which looks up the
severity for a warning out of the lint clients and into the
context. Now it checks the current projects being scanned and looks up
the corresponding project for each file (based on the file prefix),
and retrieves the configuration that way.
This changeset also makes one more fix: It now consults *both* the
library project *and* the master project to see if a rule should be
ignored. This means that if you turn off a given check in your master
project, you will no longer see those warnings from library projects
either, which seems desirable.
Change-Id: Icb5cdf7696b4908b0553f86896793515cb06f29c
Diffstat (limited to 'lint/cli')
-rw-r--r-- | lint/cli/src/com/android/tools/lint/Main.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java index 2621d0a..6cf2863 100644 --- a/lint/cli/src/com/android/tools/lint/Main.java +++ b/lint/cli/src/com/android/tools/lint/Main.java @@ -842,14 +842,14 @@ public class Main extends LintClient { } @Override - public void report(Context context, Issue issue, Location location, String message, - Object data) { + public void report(Context context, Issue issue, Severity severity, Location location, + String message, Object data) { assert context.isEnabled(issue); - Severity severity = context.getConfiguration().getSeverity(issue); if (severity == Severity.IGNORE) { return; } + if (severity == Severity.FATAL) { mFatal = true; // From here on, treat the fatal error as an error such that we don't display |