mirror of https://github.com/sbt/sbt.git
[2.x] test: Use new wildcard syntax in test (#8807)
This commit is contained in:
parent
4b3c525c22
commit
2688f7153c
|
|
@ -2,7 +2,7 @@ lazy val foo = taskKey[Unit]("Runs the foo task")
|
|||
|
||||
lazy val bar = taskKey[Unit]("Runs the bar task")
|
||||
|
||||
def makeFoo(config: Configuration): Setting[_] =
|
||||
def makeFoo(config: Configuration): Setting[?] =
|
||||
config / foo := IO.write(file(s"${config.name}-foo"), "foo")
|
||||
|
||||
lazy val PerformanceTest = (config("pt") extend Test)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ TaskKey[Unit]("evil-clear-logger") := Def.uncached {
|
|||
val cls = logger.getClass
|
||||
val field = cls.getDeclaredField("ref")
|
||||
field.setAccessible(true)
|
||||
val ref = field.get(logger).asInstanceOf[java.lang.ref.WeakReference[_]]
|
||||
val ref = field.get(logger).asInstanceOf[java.lang.ref.WeakReference[?]]
|
||||
// MUHAHAHHAHAHAHAHHAHA, I am de evil GC, I clear things.
|
||||
ref.clear()
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ TaskKey[Unit]("evil-clear-logger") := Def.uncached {
|
|||
val cls = logger.getClass
|
||||
val field = cls.getDeclaredField("ref")
|
||||
field.setAccessible(true)
|
||||
val ref = field.get(logger).asInstanceOf[java.lang.ref.WeakReference[_]]
|
||||
val ref = field.get(logger).asInstanceOf[java.lang.ref.WeakReference[?]]
|
||||
// MUHAHAHHAHAHAHAHHAHA, I am de evil GC, I clear things.
|
||||
ref.clear()
|
||||
()
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ def persistedSetting = persist := (loadPrevious(persist) map { case None => 17;
|
|||
def inMemoryCheck = checkKeep := (inputCheck( (ctx, s) => Space ~> str( getFromContext( keep, ctx, s)) )).evaluated
|
||||
def persistedCheck = checkPersist := (inputCheck( (ctx, s) => Space ~> str(loadFromContext(persist, ctx, s)) )).evaluated
|
||||
|
||||
def inputCheck[T](f: (ScopedKey[_], State) => Parser[T]): Initialize[InputTask[Unit]] =
|
||||
def inputCheck[T](f: (ScopedKey[?], State) => Parser[T]): Initialize[InputTask[Unit]] =
|
||||
InputTask.separate( resolvedScoped(ctx => (s: State) => f(ctx, s)) )( dummyTask )
|
||||
|
||||
import sbt.TupleSyntax.*
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
|
|||
def localCache =
|
||||
ivyPaths := IvyPaths(baseDirectory.value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").toString))
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] =
|
||||
def commonSettings: Seq[Def.Setting[?]] =
|
||||
Seq(
|
||||
localCache,
|
||||
ThisBuild / scalaVersion := "2.11.12",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ lazy val check = taskKey[Unit]("Runs the check")
|
|||
def localCache =
|
||||
ivyPaths := IvyPaths(baseDirectory.value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").toString))
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] =
|
||||
def commonSettings: Seq[Def.Setting[?]] =
|
||||
Seq(
|
||||
localCache,
|
||||
scalaVersion := "2.10.4",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-c
|
|||
def localCache =
|
||||
ivyPaths := IvyPaths(baseDirectory.value.toString, Some(((ThisBuild / baseDirectory).value / "ivy" / "cache").toString))
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] =
|
||||
def commonSettings: Seq[Def.Setting[?]] =
|
||||
Seq(
|
||||
localCache,
|
||||
scalaVersion := "2.10.4",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ ThisBuild / scalaVersion := "2.13.12"
|
|||
ThisBuild / versionScheme := Some("semver-spec")
|
||||
ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-cache"
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] =
|
||||
def commonSettings: Seq[Def.Setting[?]] =
|
||||
Seq(
|
||||
fullResolvers := Def.uncached(fullResolvers.value.filterNot(_.name == "inter-project")),
|
||||
publishTo := Some(MavenCache("local-maven", (LocalRootProject / target).value / "local-maven")),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
lazy val check = taskKey[Unit]("tests update")
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] = Seq(
|
||||
def commonSettings: Seq[Def.Setting[?]] = Seq(
|
||||
resolvers ++= Vector(Resolver.typesafeIvyRepo("releases"), Resolver.typesafeRepo("releases"), Resolver.sbtPluginRepo("releases")),
|
||||
check := {
|
||||
val ur = update.value
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-cache"
|
||||
|
||||
def commonSettings: Seq[Def.Setting[_]] =
|
||||
def commonSettings: Seq[Def.Setting[?]] =
|
||||
Seq(
|
||||
ivyPaths := IvyPaths( (ThisBuild / baseDirectory).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")),
|
||||
dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ def localRepo = Def.setting((target in LocalRootProject).value / "local-repo")
|
|||
|
||||
ThisBuild / csrCacheDirectory := (ThisBuild / baseDirectory).value / "coursier-cache"
|
||||
|
||||
val commonSettings = Seq[Def.Setting[_]](
|
||||
val commonSettings = Seq[Def.Setting[?]](
|
||||
organization := "org.example",
|
||||
version := "1.0-SNAPSHOT",
|
||||
scalaVersion := "2.11.7",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ transform := {
|
|||
StateTransform(_.put(foo, 1))
|
||||
}
|
||||
|
||||
def inputCheck[T](f: (ScopedKey[_], State) => Parser[T]): Initialize[InputTask[Unit]] =
|
||||
def inputCheck[T](f: (ScopedKey[?], State) => Parser[T]): Initialize[InputTask[Unit]] =
|
||||
InputTask(resolvedScoped(ctx => (s: State) => f(ctx, s)))(dummyTask)
|
||||
|
||||
val checkTransform = taskKey[Unit]("")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ lazy val custom =
|
|||
)
|
||||
|
||||
|
||||
lazy val platformSettings = Seq[Def.Setting[_]](
|
||||
lazy val platformSettings = Seq[Def.Setting[?]](
|
||||
platformTest := {
|
||||
if(virtualAxes.value.contains(sbt.VirtualAxis.js)) "js-platform"
|
||||
else if(virtualAxes.value.contains(sbt.VirtualAxis.jvm)) "jvm-platform"
|
||||
|
|
@ -47,7 +47,7 @@ lazy val platformSettings = Seq[Def.Setting[_]](
|
|||
}
|
||||
)
|
||||
|
||||
lazy val customSettings = Seq[Def.Setting[_]](
|
||||
lazy val customSettings = Seq[Def.Setting[?]](
|
||||
configTest := {
|
||||
if(virtualAxes.value.contains(config12)) "config for 1.2"
|
||||
else if (virtualAxes.value.contains(config13)) "config for 1.3"
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ commandProgress += new ExecuteProgress2:
|
|||
allDeps: Iterable[TaskId[?]],
|
||||
pendingDeps: Iterable[TaskId[?]]
|
||||
): Unit = ()
|
||||
override def afterReady(task: TaskId[_]): Unit = ()
|
||||
override def beforeWork(task: TaskId[_]): Unit = ()
|
||||
override def afterReady(task: TaskId[?]): Unit = ()
|
||||
override def beforeWork(task: TaskId[?]): Unit = ()
|
||||
override def afterWork[A](task: TaskId[A], result: Either[TaskId[A], Result[A]]): Unit = ()
|
||||
override def afterCompleted[A](task: TaskId[A], result: Result[A]): Unit = ()
|
||||
override def afterAllCompleted(results: RMap[TaskId, Result]): Unit = ()
|
||||
|
|
|
|||
Loading…
Reference in New Issue