Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom lint rules ignored for :library module #65

Open
mosofsky opened this issue Jan 7, 2022 · 1 comment
Open

Custom lint rules ignored for :library module #65

mosofsky opened this issue Jan 7, 2022 · 1 comment

Comments

@mosofsky
Copy link

mosofsky commented Jan 7, 2022

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

@andrefrsousa
Copy link

We have a similar problem in a multi module project. Basically in the non-android modules we are unable to run our custom lints. @tnorbye there a way to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants