aboutsummaryrefslogtreecommitdiffstats
path: root/lint/cli
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-02-20 08:57:56 -0800
committerTor Norbye <tnorbye@google.com>2012-02-21 09:17:02 -0800
commite0281950ddcd517c9ef4c6ed118f33a9fd063cec (patch)
tree3d2d09a32bf479ae34d5263de15c7f4f1904ae68 /lint/cli
parent556b907792f0658a6c3f676e23469b83175e3431 (diff)
downloadsdk-e0281950ddcd517c9ef4c6ed118f33a9fd063cec.zip
sdk-e0281950ddcd517c9ef4c6ed118f33a9fd063cec.tar.gz
sdk-e0281950ddcd517c9ef4c6ed118f33a9fd063cec.tar.bz2
Use lint error mechanism for config issues like no classes found
If Lint cannot find the .class files for a project, it cannot run any of the class-file based checks (such as the NewApi check). This changeset adds a new category and issue id, "Lint Error", for these types of issues. In HTML reports, these errors are listed at the top. The issue explanation states that these errors don't represent bugs in the user's code, but that lint was not able to check certain things for the reasons given. In the case of no .class files found, it asks whether the project needs to be built first. It also uses these lint errors to emit errors in processing lint.xml configuration files. (Note that if you don't want to see these types of errors, you can suppress it via --disable LintError.) Change-Id: Ifc2f55566f3a0cd20189d43e4205201bc21ee280
Diffstat (limited to 'lint/cli')
-rw-r--r--lint/cli/src/com/android/tools/lint/Main.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java
index 1484a1d..629c932 100644
--- a/lint/cli/src/com/android/tools/lint/Main.java
+++ b/lint/cli/src/com/android/tools/lint/Main.java
@@ -16,6 +16,8 @@
package com.android.tools.lint;
+import static com.android.tools.lint.client.api.IssueRegistry.LINT_ERROR;
+import static com.android.tools.lint.client.api.IssueRegistry.PARSER_ERROR;
import static com.android.tools.lint.detector.api.LintConstants.DOT_XML;
import static com.android.tools.lint.detector.api.LintUtils.endsWith;
@@ -1030,7 +1032,7 @@ public class Main extends LintClient {
}
}
- if (mCheck != null) {
+ if (mCheck != null && issue != LINT_ERROR && issue != PARSER_ERROR) {
return Severity.IGNORE;
}
@@ -1081,6 +1083,9 @@ public class Main extends LintClient {
chop++;
}
path = path.substring(chop);
+ if (path.length() == 0) {
+ path = file.getName();
+ }
}
return path;