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

kotlin source directories not analysed when android variant is used #4553

Closed
yachoor opened this issue Feb 2, 2022 · 2 comments · Fixed by #4554
Closed

kotlin source directories not analysed when android variant is used #4553

yachoor opened this issue Feb 2, 2022 · 2 comments · Fixed by #4554
Labels

Comments

@yachoor
Copy link

yachoor commented Feb 2, 2022

Expected Behavior

Code under src/variant1/kotlin should be analysed when gradle detektVariant1Debug task is run

Observed Behavior

Only code under src/variant1/java is analysed

Steps to Reproduce

DetektBug.zip sample project with one variant and 4 classes with same naming issue:

  • Test1 under src/main/java
  • Test2 under src/main/kotlin
  • Test3 under src/variant1/java
  • Test4 under src/variant1/koltin

When running gradle task detekt I get issues in Test1 and Test2, but when running detektVariant1Debug, I get issues only in java files - Test1 and Test3

Your Environment

Tried android gradle plugin version 4.2.0, 7.0.0, 7.1.0 - same result, using detekt 1.19.0

@cortinico
Copy link
Member

cortinico commented Feb 3, 2022

Thanks for providing a reproducer 🙏 Here the fix:

@Goooler
Copy link
Contributor

Goooler commented Feb 3, 2022

Link JLLeitschuh/ktlint-gradle/issues/524, kotlin sourceSet should be added from AGP 7.0, this issue was blocked by #4133 then.

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

Successfully merging a pull request may close this issue.

3 participants