From 488f87114e2f67434bcb227c203294ed03e88b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Wro=C5=84ski?= Date: Tue, 26 Sep 2023 14:26:35 +0200 Subject: [PATCH] Update to scala 3 --- build.sbt | 6 +++--- .../main/scala/packager/cli/commands/BuildOptions.scala | 7 +++---- .../main/scala/packager/cli/commands/DebianOptions.scala | 5 +++-- .../main/scala/packager/cli/commands/DockerOptions.scala | 4 ++-- .../main/scala/packager/cli/commands/MacOSOptions.scala | 4 ++-- .../main/scala/packager/cli/commands/RedHatOptions.scala | 4 ++-- .../main/scala/packager/cli/commands/SharedOptions.scala | 4 ++-- .../main/scala/packager/cli/commands/WindowsOptions.scala | 4 ++-- project/ScalaVersions.scala | 3 ++- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/build.sbt b/build.sbt index 86a6f34..83c6520 100644 --- a/build.sbt +++ b/build.sbt @@ -47,19 +47,19 @@ lazy val compileOptions: Seq[Setting[_]] = Seq( lazy val packagerProjectSettings = Seq( name := "scala-packager", - scalaVersion := ScalaVersions.scala213, + scalaVersion := ScalaVersions.scala3, crossScalaVersions := ScalaVersions.all ) lazy val imageResizerProjectSettings = Seq( name := "scala-packager-image-resizer", - scalaVersion := ScalaVersions.scala213, + scalaVersion := ScalaVersions.scala3, crossScalaVersions := ScalaVersions.all ) lazy val cliProjectSettings = Seq( name := "scala-packager-cli", - scalaVersion := ScalaVersions.scala213, + scalaVersion := ScalaVersions.scala3, crossScalaVersions := ScalaVersions.all, libraryDependencies ++= Seq(Deps.caseApp) ) diff --git a/modules/cli/src/main/scala/packager/cli/commands/BuildOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/BuildOptions.scala index 7d5fa5b..f5526cf 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/BuildOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/BuildOptions.scala @@ -1,7 +1,6 @@ package packager.cli.commands -import caseapp.{Group, HelpMessage, Name, Parser, Recurse} -import caseapp.core.help.Help +import caseapp._ import packager.cli.commands.BuildOptions.PackagerType import packager.config._ @@ -109,6 +108,6 @@ object BuildOptions { case object Rpm extends NativePackagerType } - implicit val parser: Parser[BuildOptions] = Parser[BuildOptions] - implicit val help: Help[BuildOptions] = Help[BuildOptions] + implicit lazy val parser: Parser[BuildOptions] = Parser.derive + implicit lazy val help: Help[BuildOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/DebianOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/DebianOptions.scala index c40fd85..bb473ca 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/DebianOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/DebianOptions.scala @@ -1,6 +1,7 @@ package packager.cli.commands import caseapp.core.help.Help +import caseapp.core.parser.Parser import caseapp.{Group, HelpMessage, Parser, ValueDescription} import packager.cli.commands.SettingsHelpers.Mandatory import packager.config.{DebianSettings, SharedSettings} @@ -55,7 +56,7 @@ final case class DebianOptions( case object DebianOptions { - implicit val parser: Parser[DebianOptions] = Parser[DebianOptions] - implicit val help: Help[DebianOptions] = Help[DebianOptions] + implicit lazy val parser: Parser[DebianOptions] = Parser.derive + implicit lazy val help: Help[DebianOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/DockerOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/DockerOptions.scala index 4dac244..f3b11a7 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/DockerOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/DockerOptions.scala @@ -59,7 +59,7 @@ final case class DockerOptions( case object DockerOptions { - implicit val parser: Parser[DockerOptions] = Parser[DockerOptions] - implicit val help: Help[DockerOptions] = Help[DockerOptions] + implicit lazy val parser: Parser[DockerOptions] = Parser.derive + implicit lazy val help: Help[DockerOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/MacOSOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/MacOSOptions.scala index 6fe0b3c..6452ad0 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/MacOSOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/MacOSOptions.scala @@ -23,7 +23,7 @@ final case class MacOSOptions( case object MacOSOptions { - implicit val parser: Parser[MacOSOptions] = Parser[MacOSOptions] - implicit val help: Help[MacOSOptions] = Help[MacOSOptions] + implicit lazy val parser: Parser[MacOSOptions] = Parser.derive + implicit lazy val help: Help[MacOSOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/RedHatOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/RedHatOptions.scala index ecda205..f1b685d 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/RedHatOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/RedHatOptions.scala @@ -41,7 +41,7 @@ final case class RedHatOptions( case object RedHatOptions { - implicit val parser: Parser[RedHatOptions] = Parser[RedHatOptions] - implicit val help: Help[RedHatOptions] = Help[RedHatOptions] + implicit lazy val parser: Parser[RedHatOptions] = Parser.derive + implicit lazy val help: Help[RedHatOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/SharedOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/SharedOptions.scala index 90ee876..28b27d8 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/SharedOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/SharedOptions.scala @@ -33,6 +33,6 @@ final case class SharedOptions( ) case object SharedOptions { - implicit val parser: Parser[SharedOptions] = Parser[SharedOptions] - implicit val help: Help[SharedOptions] = Help[SharedOptions] + implicit lazy val parser: Parser[SharedOptions] = Parser.derive + implicit lazy val help: Help[SharedOptions] = Help.derive } diff --git a/modules/cli/src/main/scala/packager/cli/commands/WindowsOptions.scala b/modules/cli/src/main/scala/packager/cli/commands/WindowsOptions.scala index 4b88756..e00123d 100644 --- a/modules/cli/src/main/scala/packager/cli/commands/WindowsOptions.scala +++ b/modules/cli/src/main/scala/packager/cli/commands/WindowsOptions.scala @@ -63,6 +63,6 @@ final case class WindowsOptions( case object WindowsOptions { - implicit val parser: Parser[WindowsOptions] = Parser[WindowsOptions] - implicit val help: Help[WindowsOptions] = Help[WindowsOptions] + implicit lazy val parser: Parser[WindowsOptions] = Parser.derive + implicit lazy val help: Help[WindowsOptions] = Help.derive } diff --git a/project/ScalaVersions.scala b/project/ScalaVersions.scala index 819949b..33c8bdc 100644 --- a/project/ScalaVersions.scala +++ b/project/ScalaVersions.scala @@ -1,5 +1,6 @@ object ScalaVersions { def scala212 = "2.12.18" def scala213 = "2.13.11" - def all = Seq(scala213, scala212) + def scala3 = "3.3.1" + def all = Seq(scala3, scala213, scala212) }