Use new lint API.

upstream-sync
Sebastian Kaspari 3 years ago
parent fc7ac5b475
commit 21c023d001

@ -9,7 +9,7 @@ object Versions {
// These versions are linked: lint should be X+23.Y.Z of gradle_plugin version, according to:
// https://github.com/alexjlockwood/android-lint-checks-demo/blob/0245fc027463137b1b4afb97c5295d60dce998b6/dependencies.gradle#L3
const val android_gradle_plugin = "4.2.2"
const val android_lint_api = "27.0.1"
const val android_lint_api = "30.0.0-rc01"
const val sentry = "1.7.10"
const val leakcanary = "2.4"

@ -8,6 +8,17 @@ apply plugin: 'kotlin'
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
if (project.hasProperty("centralRepo")) {
maven {
name "MavenCentral"
url project.property("centralRepo")
}
} else {
mavenCentral()
}
}
dependencies {
// I didn't look thoroughly enough to really know what's going on here but I think
// the lint API uses jdk8 so if we provide jdk7, the dependency collision system
@ -23,6 +34,7 @@ dependencies {
compileOnly "com.android.tools.lint:lint-api:${Versions.android_lint_api}"
compileOnly "com.android.tools.lint:lint-checks:${Versions.android_lint_api}"
testImplementation "junit:junit:4.13.2"
testImplementation "com.android.tools.lint:lint:${Versions.android_lint_api}"
testImplementation "com.android.tools.lint:lint-tests:${Versions.android_lint_api}"
}

@ -5,6 +5,7 @@
package org.mozilla.fenix.lintrules
import com.android.tools.lint.client.api.IssueRegistry
import com.android.tools.lint.client.api.Vendor
import com.android.tools.lint.detector.api.Issue
import org.mozilla.fenix.lintrules.perf.ConstraintLayoutPerfDetector
@ -22,4 +23,8 @@ class LintIssueRegistry : IssueRegistry() {
LicenseDetector.ISSUE_MISSING_LICENSE,
LicenseDetector.ISSUE_INVALID_LICENSE_FORMAT
) + ConstraintLayoutPerfDetector.ISSUES + ContextCompatDetector.ISSUES
override val vendor: Vendor = Vendor(
vendorName = "Mozilla",
identifier = "mozilla-fenix"
)
}

Loading…
Cancel
Save