summaryrefslogtreecommitdiff
path: root/lint/src
diff options
context:
space:
mode:
authorChristophe Rhodes <xof@google.com>2021-02-04 12:32:44 +0000
committerIvan Gavrilovic <gavra@google.com>2021-02-17 18:57:49 +0000
commit57542e8f293ad763bb9150933008e36e01c83e51 (patch)
treeb61bc41437872f9fab49a2648b2eeb627d22f10a /lint/src
parent05a17e761491759980c42f069a0dc19ff02764b9 (diff)
downloadidea-57542e8f293ad763bb9150933008e36e01c83e51.tar.gz
[lint] Add inspection for obsolete JCenter
Bug: 179271887 Test: forthcoming Change-Id: I97768b5548fdf469cf0e950a8047ae91afa56fed
Diffstat (limited to 'lint/src')
-rw-r--r--lint/src/META-INF/lint-plugin.xml1
-rw-r--r--lint/src/com/android/tools/idea/lint/common/AndroidLintJcenterRepositoryObsoleteInspection.kt23
2 files changed, 24 insertions, 0 deletions
diff --git a/lint/src/META-INF/lint-plugin.xml b/lint/src/META-INF/lint-plugin.xml
index 42974a50d21..f298dbca24b 100644
--- a/lint/src/META-INF/lint-plugin.xml
+++ b/lint/src/META-INF/lint-plugin.xml
@@ -49,6 +49,7 @@
<globalInspection hasStaticDescription="true" shortName="AndroidLintIgnoreWithoutReason" displayName="@Ignore without Reason" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintIgnoreWithoutReasonInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintImplicitSamInstance" displayName="Implicit SAM Instances" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintImplicitSamInstanceInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintJavaPluginLanguageLevel" displayName="Java Plugin Language Level" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintJavaPluginLanguageLevelInspection"/>
+ <globalInspection hasStaticDescription="true" shortName="AndroidLintJcenterRepositoryObsolete" displayName="JCenter Repository Obsolete" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintJcenterRepositoryObsoleteInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintKotlinPropertyAccess" displayName="Kotlin Property Access" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintKotlinPropertyAccessInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintLambdaLast" displayName="Lambda Parameters Last" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintLambdaLastInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintLocalSuppress" displayName="@SuppressLint on invalid element" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintLocalSuppressInspection"/>
diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintJcenterRepositoryObsoleteInspection.kt b/lint/src/com/android/tools/idea/lint/common/AndroidLintJcenterRepositoryObsoleteInspection.kt
new file mode 100644
index 00000000000..721d57bd3f1
--- /dev/null
+++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintJcenterRepositoryObsoleteInspection.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.tools.idea.lint.common
+
+import com.android.tools.idea.lint.common.LintBundle.Companion.message
+import com.android.tools.lint.checks.GradleDetector
+
+class AndroidLintJcenterRepositoryObsoleteInspection : AndroidLintInspectionBase(
+ message("android.lint.inspections.jcenter.repository.obsolete"), GradleDetector.JCENTER_REPOSITORY_OBSOLETE
+)