gradle-pitest-plugin icon indicating copy to clipboard operation
gradle-pitest-plugin copied to clipboard

Setting up pitest with JUnit5 without keeping any versions in build.gradle

Open jan-gebauer opened this issue 7 months ago • 3 comments

Hi,

our usecase is that we would like to keep all version numbers out of our build.gradle files. Normally, we do this by using init.d in our .gradle folder. This worked well for version of the plugin itself but not so much for the junit5PluginVersion. It also works reasonably well for the other settings, such as mutationThreshold.

In init.d we have a file called pitest.init.gradle that looks like this

allprojects {
  afterEvaluate { project -> 
    project.plugins.withId("info.soildsoft.pitest") {
      junit5PluginVersion = '1.2.1'
      mutationThreshold = 65
      // other settings
    }
  }
}

The pitest version is set elsewhere. The presented code does not work and it is as if we didn't set the junit5PluginVersion at all. Are we doing something wrong? Is there a way to do this?

I noticed that there was a discussion about it but nothing seemed conclusive.

jan-gebauer avatar Jul 12 '24 14:07 jan-gebauer