aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-11-26 10:59:44 -0800
committerTor Norbye <tnorbye@google.com>2014-11-26 13:28:35 -0800
commit19de1c1b19635fb32767658f9755fadf20bfb75e (patch)
tree53b88dd46d3e10a92209fbb5d342cb5b63e4549f /eclipse/plugins
parent7b26ed51415fc2e4536c6841a37c3b5ff2f143ac (diff)
downloadsdk-19de1c1b19635fb32767658f9755fadf20bfb75e.tar.gz
sdk-19de1c1b19635fb32767658f9755fadf20bfb75e.tar.bz2
sdk-19de1c1b19635fb32767658f9755fadf20bfb75e.zip
72760: Lint errors prevent exporting of application
Change-Id: I710982520f2ac40674dca7f63760f525051342a2
Diffstat (limited to 'eclipse/plugins')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/.gitignore1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintIssueRegistry.java65
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.base/.gitignore1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ddms/.gitignore1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java9
7 files changed, 78 insertions, 11 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.gitignore b/eclipse/plugins/com.android.ide.eclipse.adt/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
index c91661664..94a7da17a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
@@ -903,7 +903,7 @@ public class EclipseLintClient extends LintClient {
* @return the issue registry to use to access detectors and issues
*/
public static IssueRegistry getRegistry() {
- return new BuiltinIssueRegistry();
+ return new EclipseLintIssueRegistry();
}
@Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintIssueRegistry.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintIssueRegistry.java
new file mode 100644
index 000000000..3abbdeb84
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintIssueRegistry.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.lint;
+
+import com.android.annotations.NonNull;
+import com.android.tools.lint.checks.*;
+import com.android.tools.lint.detector.api.Issue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class EclipseLintIssueRegistry extends BuiltinIssueRegistry {
+ private static List<Issue> sFilteredIssues;
+
+ public EclipseLintIssueRegistry() {
+ }
+
+ @NonNull
+ @Override
+ public List<Issue> getIssues() {
+ if (sFilteredIssues == null) {
+ // Remove issues that do not work properly in Eclipse
+ List<Issue> sIssues = super.getIssues();
+ List<Issue> result = new ArrayList<Issue>(sIssues.size());
+ for (Issue issue : sIssues) {
+ if (issue == MissingClassDetector.INSTANTIATABLE) {
+ // Apparently violated by
+ // android.support.v7.internal.widget.ActionBarView.HomeView
+ // See issue 72760
+ continue;
+ } else if (issue == DuplicateIdDetector.WITHIN_LAYOUT) {
+ // Apparently violated by
+ // sdk/extras/android/support/v7/appcompat/abc_activity_chooser_view_include.xml
+ // See issue 72760
+ continue;
+ } else if (issue == AppCompatResourceDetector.ISSUE
+ || issue == AppCompatCallDetector.ISSUE) {
+ // Apparently has some false positives in Eclipse; see issue
+ // 72824
+ continue;
+ } else if (issue.getImplementation().getDetectorClass() == RtlDetector.class) {
+ // False positives in Eclipse; see issue 78780
+ continue;
+ }
+ result.add(issue);
+ }
+ sFilteredIssues = result;
+ }
+
+ return sFilteredIssues;
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
index 8e40f1c64..7ff06fc40 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
@@ -744,11 +744,11 @@ public final class Sdk {
}
AdtPlugin.log(t, "Exception in checkAndLoadTargetData."); //$NON-NLS-1$
- return new Status(IStatus.ERROR, AdtPlugin.PLUGIN_ID,
- String.format(
- "Parsing Data for %1$s failed", //$NON-NLS-1$
- target.hashString()),
- t);
+ String message = String.format("Parsing Data for %1$s failed", target.hashString());
+ if (t instanceof UnsupportedClassVersionError) {
+ message = "To use this platform, run Eclipse with JDK 7 or later. (" + message + ")";
+ }
+ return new Status(IStatus.ERROR, AdtPlugin.PLUGIN_ID, message, t);
}
}
};
diff --git a/eclipse/plugins/com.android.ide.eclipse.base/.gitignore b/eclipse/plugins/com.android.ide.eclipse.base/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.base/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/.gitignore b/eclipse/plugins/com.android.ide.eclipse.ddms/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
index a93bc3ea7..9d3bc60c6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
@@ -35,7 +35,6 @@ import com.android.sdklib.IAndroidTarget;
import com.android.utils.GrabProcessOutput;
import com.android.utils.GrabProcessOutput.IProcessOutput;
import com.android.utils.GrabProcessOutput.Wait;
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
import com.android.tools.lint.checks.ManifestDetector;
import com.android.tools.lint.checks.SecurityDetector;
import com.android.tools.lint.client.api.Configuration;
@@ -156,7 +155,7 @@ public class TemplateHandlerTest extends SdkLoadingTestCase {
}
public void testNewBlankProject() throws Exception {
- Stopwatch stopwatch = new Stopwatch();
+ Stopwatch stopwatch = Stopwatch.createUnstarted();
stopwatch.start();
checkProjectWithActivity(null);
stopwatch.stop();
@@ -268,7 +267,7 @@ public class TemplateHandlerTest extends SdkLoadingTestCase {
// ---- Test support code below ----
private void checkCreateActivityInProject(String activityName) throws Exception {
- Stopwatch stopwatch = new Stopwatch();
+ Stopwatch stopwatch = Stopwatch.createUnstarted();
stopwatch.start();
File templateFile = findTemplate("activities", activityName);
sProjectTestedSeparately.add(templateFile);
@@ -279,7 +278,7 @@ public class TemplateHandlerTest extends SdkLoadingTestCase {
}
private void checkCreateTemplate(String category, String name) throws Exception {
- Stopwatch stopwatch = new Stopwatch();
+ Stopwatch stopwatch = Stopwatch.createUnstarted();
stopwatch.start();
File templateFile = findTemplate(category, name);
assertNotNull(templateFile);
@@ -763,7 +762,7 @@ public class TemplateHandlerTest extends SdkLoadingTestCase {
System.setProperty("com.android.tools.lint.bindir", AdtPrefs.getPrefs().getOsSdkFolder()
+ File.separator + FD_TOOLS);
- LintDriver driver = new LintDriver(new BuiltinIssueRegistry(), new LintClient() {
+ LintDriver driver = new LintDriver(EclipseLintClient.getRegistry(), new LintClient() {
@Override
public void report(@NonNull Context context,
@NonNull Issue issue, @NonNull Severity severity,