Skip to content

Commit

Permalink
Add snapshot resolver if snapshot version is used in sbt plugin (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk authored Nov 14, 2023
1 parent 963fe90 commit c259018
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import sbt.Keys.*
import sbt.*
import sbt.internal.LogManager
import stryker4s.config.{Config, TestFilter}
import stryker4s.extension.FileExtensions.*
import stryker4s.exception.TestSetupException
import stryker4s.extension.FileExtensions.*
import stryker4s.files.{FilesFileResolver, MutatesFileResolver, SbtFilesResolver, SbtMutatesResolver}
import stryker4s.log.Logger
import stryker4s.model.CompilerErrMsg
Expand All @@ -21,6 +21,7 @@ import stryker4s.sbt.Stryker4sMain.autoImport.stryker
import stryker4s.sbt.runner.{LegacySbtTestRunner, SbtTestRunner}

import java.io.{File as JFile, PrintStream}
import scala.annotation.nowarn
import scala.concurrent.duration.FiniteDuration

/** This Runner run Stryker mutations in a single SBT session
Expand Down Expand Up @@ -68,8 +69,10 @@ class Stryker4sSbtRunner(
log.debug(s"Resolved stryker4s version $stryker4sVersion")

val fullSettings = settings ++ Seq(
libraryDependencies +=
"io.stryker-mutator" %% "stryker4s-sbt-testrunner" % stryker4sVersion
libraryDependencies += "io.stryker-mutator" %% "stryker4s-sbt-testrunner" % stryker4sVersion,
resolvers ++= (if (stryker4sVersion.endsWith("-SNAPSHOT"))
List(Resolver.sonatypeRepo("snapshots"): @nowarn("cat=deprecation"))
else Seq.empty)
)
val newState = extracted.appendWithSession(fullSettings, state)

Expand Down

0 comments on commit c259018

Please sign in to comment.