diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f38d21..8376703 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: java: - - 11 + - 17 - 25 steps: - uses: actions/checkout@v6 diff --git a/build.sbt b/build.sbt index fa1f6da..d41a9f6 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ val tagOrHash = Def.setting { } def gitHash(): String = - sys.process.Process("git rev-parse HEAD").lineStream_!.head + sys.process.Process("git rev-parse HEAD").lazyLines_!.head val unusedWarnings = Seq( "-Ywarn-unused", @@ -23,7 +23,7 @@ val unusedWarnings = Seq( val jsNativeCommon = Def.settings( libraryDependencies ++= Seq( - "com.github.xuwei-k" %%% "msgpack4z-native" % msgpack4zNativeVersion, + "com.github.xuwei-k" %% "msgpack4z-native" % msgpack4zNativeVersion, ) ) @@ -195,14 +195,14 @@ lazy val msgpack4zCore = projectMatrix name := msgpack4zCoreName, Test / sourceDirectories ~= (_.distinct), libraryDependencies ++= Seq( - "org.scalaz" %%% "scalaz-core" % ScalazVersion, - "com.github.scalaprops" %%% "scalaprops" % scalapropsVersion % "test", - "com.github.scalaprops" %%% "scalaprops-scalaz" % scalapropsVersion % "test", - "com.github.xuwei-k" %% "zeroapply-scalaz" % "0.5.1" % "provided", + "org.scalaz" %% "scalaz-core" % ScalazVersion, + "com.github.scalaprops" %% "scalaprops" % scalapropsVersion % "test", + "com.github.scalaprops" %% "scalaprops-scalaz" % scalapropsVersion % "test", + ("com.github.xuwei-k" %% "zeroapply-scalaz" % "0.5.1" % "provided").platform(Platform.jvm), ), libraryDependencies ++= { if (CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 2)) { - Seq("com.chuusai" %%% "shapeless" % "2.3.13" % "test") + Seq("com.chuusai" %% "shapeless" % "2.3.13" % "test") } else { Nil } @@ -257,19 +257,29 @@ lazy val noPublish = Seq( Test / publishArtifact := false ) -TaskKey[Unit]("testSequential") := Def - .sequential( - List( - msgpack4zCore.allProjects(), - testJavaLatest.allProjects(), - ).flatten.map(_._1).sortBy(_.id).map(_ / Test / test) - ) - .value -commonSettings -noPublish -Compile / scalaSource := (ThisBuild / baseDirectory).value / "dummy" -Test / scalaSource := (ThisBuild / baseDirectory).value / "dummy" -autoScalaLibrary := false +val msgpack4zCoreRoot = rootProject.autoAggregate.settings( + TaskKey[Unit]("testSequential") := Def + .sequential( + List( + msgpack4zCore.allProjects(), + testJavaLatest.allProjects(), + ).flatten + .map(_._1) + .sortBy(_.id) + .flatMap(p => + Seq[Def.Initialize[Task[Unit]]]( + Def.task(streams.value.log.info(s"start ${p.id} test")), + (p / Test / testFull).map(_ => ()) + ) + ) + ) + .value, + commonSettings, + noPublish, + Compile / scalaSource := (ThisBuild / baseDirectory).value / "dummy", + Test / scalaSource := (ThisBuild / baseDirectory).value / "dummy", + autoScalaLibrary := false, +) lazy val testJavaLatest = projectMatrix .in(file("test-java-latest")) diff --git a/project/AnyValCodec.scala b/project/AnyValCodec.scala index 28b1ee8..9472de3 100644 --- a/project/AnyValCodec.scala +++ b/project/AnyValCodec.scala @@ -1,11 +1,11 @@ import java.util.Locale object AnyValCodec { - private[this] val types = "Boolean Byte Short Int Long Float Double".split(' ').toList + private val types = "Boolean Byte Short Int Long Float Double".split(' ').toList - private[this] val defdef = types.map { tpe => s" implicit def ${tpe.toLowerCase(Locale.ENGLISH)}Codec: MsgpackCodec[$tpe]" }.mkString("\n") + private val defdef = types.map { tpe => s" implicit def ${tpe.toLowerCase(Locale.ENGLISH)}Codec: MsgpackCodec[$tpe]" }.mkString("\n") - private[this] val impl = types.map { tpe => + private val impl = types.map { tpe => s""" override final def ${tpe.toLowerCase(Locale.ENGLISH)}Codec: MsgpackCodec[$tpe] = MsgpackCodec.tryConst(_.pack$tpe(_), _.unpack$tpe())""" diff --git a/project/CaseCodec.scala b/project/CaseCodec.scala index ffb7fc7..84f6ecb 100644 --- a/project/CaseCodec.scala +++ b/project/CaseCodec.scala @@ -7,7 +7,7 @@ object CaseCodec { private final val extract = "extract" private final val Z = "Z" - private[this] val f: Int => String = { i => + private val f: Int => String = { i => val tparams = tparamList(i) val tparams1 = tparams.mkString(", ") val implicitParams = tparams.map(x => x + ": MsgpackCodec[" + x + "]").mkString(", ") @@ -46,7 +46,7 @@ object CaseCodec { """ } - private[this] def one = { + private def one = { val codec1 = "codec1" val A1 = "A1" def methodDef(name: String) = diff --git a/project/build.properties b/project/build.properties index 7c95fc1..666624a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.12.13 +sbt.version=2.0.0 diff --git a/project/plugin.sbt b/project/plugin.sbt index d3c7dbe..7282f20 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -5,7 +5,6 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1") addSbtPlugin("com.github.scalaprops" % "sbt-scalaprops" % "0.5.3") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.6") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0") -addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.11.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.6.1") @@ -13,9 +12,7 @@ scalacOptions ++= Seq( "-deprecation", "-unchecked", "-language:existentials", - "-language:higherKinds", "-language:implicitConversions", - "-Yno-adapted-args", ) fullResolvers ~= { _.filterNot(_.name == "jcenter") }