szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
211 stars 57 forks source link

Incompatibility with new Kotlin versions #362

Closed ivanvillarfreire closed 1 month ago

ivanvillarfreire commented 1 month ago

Good morning.

First of all, I want to sincerely appreciate the good work it's being done here over the years.

I want to comment here what it seems to be some kind of incompatibility with at least the following versions:

------------------------------------------------------------
Gradle 8.6
------------------------------------------------------------

Build time:   2024-02-02 16:47:16 UTC
Revision:     d55c486870a0dc6f6278f53d21381396d0741c6e

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          17.0.7 (Homebrew 17.0.7+0)
OS:           Mac OS X 13.0 aarch64

The problem in fact is pretty simple to see, on a build.gradle.kts file, if you include this section:

  packaging {
      resources.excludes.add("META-INF/{AL2.0,LGPL2.1}")
      resources.excludes.add("META-INF/LICENSE.md")
      resources.excludes.add("META-INF/LICENSE-notice.md")
  }

The gradle sync fails already with the errors:

applicationandroid/build.gradle.kts:139:5: Unresolved reference: packaging
applicationandroid/build.gradle.kts:140:19: Unresolved reference: excludes

The feeling I get, but I could be totally wrong, is that internally Pitest does some kind of packaging too but there is some new way to call that function and Pitest is not able to do it right.

The "good thing" is that if we comment the packaging section, it works just fine:

image

And a ./gradlew pitest:

image
szpak commented 1 month ago

It seems to be the Android project. Please use the Android fork of this plugin: https://github.com/koral--/gradle-pitest-plugin/

szpak commented 1 month ago

First of all, I want to sincerely appreciate the good work it's being done here over the years.

And thank you for the kind words!