Skip to content

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

@jan-gebauer

Description

@jan-gebauer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions