Skip to content

Custom lint rules ignored for :library module #65

Open
@mosofsky

Description

@mosofsky

When I tried moving the Test.kt file from the :app module to the :library module, lint stopped reporting the expected warning.

Steps to reproduce:

  1. git clone https://github.com/googlesamples/android-custom-lint-rules.git
  2. cd android-custom-lint-rules
  3. Move Test.kt to library module:
    1. mkdir -p library/src/main/java/com/example/lint/library
    2. mv app/src/main/java/com/android/example/Test.kt library/src/main/java/com/example/lint/library
    3. sed -i '' 's/com.android.example/com.example.lint.library/' library/src/main/java/com/example/lint/library/Test.kt
  4. Run either of these lint commands:
    1. ./gradlew :library:lint
    2. ./gradlew lint
  5. Expected "Warning: This code mentions lint: Congratulations [SampleId]" but got none

This may be related to Custom lint checks stopped running for multi-module Android project after upgrading to Android Gradle Plugin 4.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions