pull/2106/merge
Jaehwa Noh 3 days ago committed by GitHub
commit cabea08860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -25,6 +25,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
abstract class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
@ -44,6 +45,10 @@ abstract class AndroidApplicationConventionPlugin : Plugin<Project> {
configureBadgingTasks(this)
}
configureSpotlessForAndroid()
dependencies {
"compileOnly"(project(":lint"))
}
}
}
}

@ -55,11 +55,13 @@ abstract class AndroidLibraryConventionPlugin : Plugin<Project> {
}
configureSpotlessForAndroid()
dependencies {
"androidTestImplementation"(libs.findLibrary("kotlin.test").get())
if (project.path != ":lint") "compileOnly"(project(":lint"))
"implementation"(libs.findLibrary("androidx.tracing.ktx").get())
"testImplementation"(libs.findLibrary("kotlin.test").get())
"testImplementation"(libs.findLibrary("junit").get())
"implementation"(libs.findLibrary("androidx.tracing.ktx").get())
"androidTestImplementation"(libs.findLibrary("kotlin.test").get())
}
}
}

@ -44,6 +44,5 @@ class AndroidLintConventionPlugin : Plugin<Project> {
private fun Lint.configure() {
xmlReport = true
sarifReport = true
checkDependencies = true
disable += "GradleDependency"
}

@ -26,8 +26,6 @@ android {
}
dependencies {
lintPublish(projects.lint)
api(libs.androidx.compose.foundation)
api(libs.androidx.compose.foundation.layout)
api(libs.androidx.compose.material.iconsExtended)

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 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.
-->
<lint>
<!--
DesignSystem lint check doesn't need on `designsystem` module.
-->
<issue id="DesignSystem" severity="ignore"/>
</lint>

@ -11,7 +11,7 @@ config:
nodePlacementStrategy: SIMPLE
---
graph TB
:lint[lint]:::unknown
:lint[lint]:::android-library
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;

@ -14,31 +14,14 @@
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
`java-library`
kotlin("jvm")
alias(libs.plugins.nowinandroid.android.lint)
}
java {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
alias(libs.plugins.nowinandroid.android.library)
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
android {
namespace = "com.google.samples.apps.nowinandroid.lint"
}
dependencies {
compileOnly(libs.kotlin.stdlib)
compileOnly(libs.lint.api)
testImplementation(libs.kotlin.test)
testImplementation(libs.lint.checks)
testImplementation(libs.lint.tests)
lintPublish(projects.lint.impl)
}

@ -0,0 +1 @@
/build

@ -0,0 +1,48 @@
# `:lint:impl`
## Module dependency graph
<!--region graph-->
```mermaid
---
config:
layout: elk
elk:
nodePlacementStrategy: SIMPLE
---
graph TB
subgraph :lint
direction TB
:lint:impl[impl]:::unknown
end
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
```
<details><summary>📋 Graph legend</summary>
```mermaid
graph TB
application[application]:::android-application
feature[feature]:::android-feature
library[library]:::android-library
jvm[jvm]:::jvm-library
application -.-> feature
library --> jvm
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
```
</details>
<!--endregion-->

@ -0,0 +1,44 @@
/*
* Copyright 2026 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
*
* https://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.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
`java-library`
kotlin("jvm")
alias(libs.plugins.nowinandroid.android.lint)
}
java {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
dependencies {
compileOnly(libs.kotlin.stdlib)
compileOnly(libs.lint.api)
testImplementation(libs.kotlin.test)
testImplementation(libs.lint.checks)
testImplementation(libs.lint.tests)
}

@ -1,5 +1,5 @@
/*
* Copyright 2022 The Android Open Source Project
* Copyright 2026 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.
@ -14,12 +14,12 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.lint
package com.google.samples.apps.nowinandroid.lint.impl
import com.android.tools.lint.client.api.IssueRegistry
import com.android.tools.lint.client.api.Vendor
import com.android.tools.lint.detector.api.CURRENT_API
import com.google.samples.apps.nowinandroid.lint.designsystem.DesignSystemDetector
import com.google.samples.apps.nowinandroid.lint.impl.designsystem.DesignSystemDetector
class NiaIssueRegistry : IssueRegistry() {

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.lint
package com.google.samples.apps.nowinandroid.lint.impl
import com.android.tools.lint.detector.api.AnnotationInfo
import com.android.tools.lint.detector.api.AnnotationUsageInfo

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.lint.designsystem
package com.google.samples.apps.nowinandroid.lint.impl.designsystem
import com.android.tools.lint.client.api.UElementHandler
import com.android.tools.lint.detector.api.Category

@ -14,4 +14,4 @@
# limitations under the License.
#
com.google.samples.apps.nowinandroid.lint.NiaIssueRegistry
com.google.samples.apps.nowinandroid.lint.impl.NiaIssueRegistry

@ -1,5 +1,5 @@
/*
* Copyright 2023 The Android Open Source Project
* Copyright 2026 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.
@ -14,14 +14,14 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.lint.designsystem
package com.google.samples.apps.nowinandroid.lint.impl.designsystem
import com.android.tools.lint.checks.infrastructure.TestFile
import com.android.tools.lint.checks.infrastructure.TestFiles.kotlin
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
import com.google.samples.apps.nowinandroid.lint.designsystem.DesignSystemDetector.Companion.ISSUE
import com.google.samples.apps.nowinandroid.lint.designsystem.DesignSystemDetector.Companion.METHOD_NAMES
import com.google.samples.apps.nowinandroid.lint.designsystem.DesignSystemDetector.Companion.RECEIVER_NAMES
import com.google.samples.apps.nowinandroid.lint.impl.designsystem.DesignSystemDetector.Companion.ISSUE
import com.google.samples.apps.nowinandroid.lint.impl.designsystem.DesignSystemDetector.Companion.METHOD_NAMES
import com.google.samples.apps.nowinandroid.lint.impl.designsystem.DesignSystemDetector.Companion.RECEIVER_NAMES
import org.junit.Test
class DesignSystemDetectorTest {

@ -1,5 +1,5 @@
/*
* Copyright 2023 The Android Open Source Project
* Copyright 2026 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.
@ -14,13 +14,13 @@
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.lint
package com.google.samples.apps.nowinandroid.lint.impl.designsystem
import com.android.tools.lint.checks.infrastructure.TestFile
import com.android.tools.lint.checks.infrastructure.TestFiles.kotlin
import com.android.tools.lint.checks.infrastructure.TestLintTask.lint
import com.google.samples.apps.nowinandroid.lint.TestMethodNameDetector.Companion.FORMAT
import com.google.samples.apps.nowinandroid.lint.TestMethodNameDetector.Companion.PREFIX
import com.google.samples.apps.nowinandroid.lint.impl.TestMethodNameDetector.Companion.FORMAT
import com.google.samples.apps.nowinandroid.lint.impl.TestMethodNameDetector.Companion.PREFIX
import org.junit.Test
class TestMethodNameDetectorTest {

@ -78,6 +78,7 @@ include(":feature:search:api")
include(":feature:search:impl")
include(":feature:settings:impl")
include(":lint")
include(":lint:impl")
include(":sync:work")
include(":sync:sync-test")
include(":ui-test-hilt-manifest")

Loading…
Cancel
Save