stryker-mutator / stryker4s

Mutation testing for Scala
https://stryker-mutator.io
Apache License 2.0
201 stars 37 forks source link

Gradle plugin #746

Open hugo-vrijswijk opened 3 years ago

hugo-vrijswijk commented 3 years ago

We currently have a plugin for sbt and Maven. The question has come up a couple of times of late, so I think we need to track interest in support for Gradle as well.

Gradle has pretty good documentation for implementing a plugin. From the looks of it, it can be implemented as a simple library, so the development can be another sbt module.

Ideally, the implementation would be closer to sbt than the Maven plugin. For sbt, the sbt-interface is used, which is called programmatically from a process started by Stryker4s. I don't know if Gradle has a similar interface for test frameworks, or if we have to look at per-framework support and a generic solution.

Workaround

The command-runner can be used as a workaround to run Stryker4s on Gradle projects without a plugin.

stryker4s.conf:

stryker4s {
  mutate=["app/src/main/scala/**.scala"],
  test-runner: { command: "./gradlew", args: "test" }
}

Launching using coursier:

$ coursier launch io.stryker-mutator::stryker4s-command-runner:latest.release
YVbakker commented 8 months ago

will be possible after #1522