Skip to content

[KMP] Fix resolution of Android test classpaths#4026

Merged
cortinico merged 2 commits into
detekt:mainfrom
cortinico:nc/fix-android-kmp
Aug 11, 2021
Merged

[KMP] Fix resolution of Android test classpaths#4026
cortinico merged 2 commits into
detekt:mainfrom
cortinico:nc/fix-android-kmp

Conversation

@cortinico

Copy link
Copy Markdown
Member

This PR depends on #4025

The approach used inside the KMP support for detekt-gradle-plugin was not working correctly for tests sourcesets of Android targets. I fixed it by delegating the creation of detekt tasks for android() targets to DetektAndroid. This will also make sure that the behavior between a pure Android project and a KMP project with an Android target is closer.

Fixes #3840

@codecov

codecov Bot commented Aug 9, 2021

Copy link
Copy Markdown

Codecov Report

Merging #4026 (9d0ce43) into main (66049c5) will not change coverage.
The diff coverage is n/a.

❗ Current head 9d0ce43 differs from pull request most recent head 25d3edd. Consider uploading reports for the commit 25d3edd to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##               main    #4026   +/-   ##
=========================================
  Coverage     83.56%   83.56%           
  Complexity     3182     3182           
=========================================
  Files           459      459           
  Lines          9092     9092           
  Branches       1771     1771           
=========================================
  Hits           7598     7598           
  Misses          561      561           
  Partials        933      933           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66049c5...25d3edd. Read the comment docs.

@picklebento picklebento left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we test with AGP 4.2 so far? (Not a blocking question but something I am interested in)

@cortinico

Copy link
Copy Markdown
Member Author

Did we test with AGP 4.2 so far? (Not a blocking question but something I am interested in)

We're already on AGP 4.2.0 👍

@BraisGabin BraisGabin added this to the 1.18.0 milestone Aug 11, 2021
@picklebento

Copy link
Copy Markdown
Member

There is a UnnecessaryLet finding in the PR.

@cortinico cortinico merged commit 9d4ae9d into detekt:main Aug 11, 2021
@cortinico cortinico deleted the nc/fix-android-kmp branch August 11, 2021 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks detektAndroidDebugUnitTest detektAndroidReleaseUnitTest and detektAndroidDebugAndroidTest fail to run in a KMM project

3 participants