Skip to content

Commit

Permalink
Use new lint API.
Browse files Browse the repository at this point in the history
  • Loading branch information
pocmo committed Jul 27, 2021
1 parent fc7ac5b commit 21c023d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions mozilla-lint-rules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
)
}

0 comments on commit 21c023d

Please sign in to comment.