- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 794
Use the correct source directory set on JVM #5163
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
Conversation
detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/DetektJvm.kt
Fixed
Show resolved
Hide resolved
This comment was marked as duplicate.
This comment was marked as duplicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic doesn't make sense to me - it seems that in the case of a null source set, a detekt task would still be created, but source
would be set to an empty value - so we'd be left with a task that will be skipped with a NO-SOURCE
status.
If we need to filter out null source sets (and it would be good to understand what change has been made in the Kotlin Gradle Plugin that led to the change in behaviour) that should be done in a way that skips registration of a task that won't execute. I'd suggest logging a warning would be a good idea in that case as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this over 🙏
detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/DetektJvm.kt
Outdated
Show resolved
Hide resolved
private fun Project.registerJvmDetektTask( | ||
compilation: KotlinCompilation<KotlinCommonOptions>, | ||
extension: DetektExtension, | ||
inputSource: FileCollection | ||
) { | ||
registerDetektTask(DetektPlugin.DETEKT_TASK_NAME + compilation.name.capitalize(), extension) { | ||
setSource(inputSource) | ||
classpath.setFrom(inputSource, compilation.compileDependencyFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we can merge DetektJvm
into DetektMultiplatform
, see Goooler#3.
# Conflicts: # detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/DetektJvm.kt
I support this change, using the new approach - I'd still like to know what's changing in Kotlin 1.7.20 that means we have to make this change now, but putting that aside, we should do this anyway because:
I just wish we had better test coverage! |
TIL. Is this documented somehwere? |
This is ready to merge, right? I would vote to merge it for 1.22.0-RC2. |
Yup fine with merging this for RC2 |
https://github.com/detekt/detekt/actions/runs/3196227698/jobs/5217876383 Seems |
Same fixes borrowed from square/wire#2310.