diff --git a/build.sbt b/build.sbt index 53f9529..6fe8c84 100644 --- a/build.sbt +++ b/build.sbt @@ -1,18 +1,28 @@ // gallia-avro +// =========================================================================== +ThisBuild / organizationName := "Gallia Project" +ThisBuild / organization := "io.github.galliaproject" // *must* match groupId for sonatype +ThisBuild / organizationHomepage := Some(url("https://github.com/galliaproject")) +ThisBuild / startYear := Some(2021) +ThisBuild / version := "0.6.0-SNAPSHOT" +ThisBuild / description := "A Scala library for data manipulation" +ThisBuild / homepage := Some(url("https://github.com/galliaproject/gallia-avro")) +ThisBuild / licenses := Seq("Apache 2" -> url("https://github.com/galliaproject/gallia-avro/blob/master/LICENSE")) +ThisBuild / developers := List(Developer( + id = "anthony-cros", + name = "Anthony Cros", + email = "contact.galliaproject@gmail.com", + url = url("https://github.com/anthony-cros"))) +ThisBuild / scmInfo := Some(ScmInfo( + browseUrl = url("https://github.com/galliaproject/gallia-core"), + connection = "scm:git@github.com:galliaproject/gallia-core.git")) + // =========================================================================== lazy val root = (project in file(".")) .settings( - organizationName := "Gallia Project", - organization := "io.github.galliaproject", // *must* match groupId for sonatype - name := "gallia-avro", - version := GalliaCommonSettings.CurrentGalliaVersion, - homepage := Some(url("https://github.com/galliaproject/gallia-avro")), - scmInfo := Some(ScmInfo( - browseUrl = url("https://github.com/galliaproject/gallia-avro"), - connection = "scm:git@github.com:galliaproject/gallia-avro.git")), - licenses := Seq("Apache 2" -> url("https://github.com/galliaproject/gallia-avro/blob/master/LICENSE")), - description := "A Scala library for data manipulation" ) + name := "gallia-avro", + target := baseDirectory.value / "bin" / "avro") .settings(GalliaCommonSettings.mainSettings:_*) // =========================================================================== @@ -21,7 +31,7 @@ lazy val slf4jVersion = "1.7.36" // --------------------------------------------------------------------------- libraryDependencies ++= Seq( - "io.github.galliaproject" %% "gallia-core" % GalliaCommonSettings.CurrentGalliaVersion, + "io.github.galliaproject" %% "gallia-core" % version.value, "org.slf4j" % "slf4j-nop" % slf4jVersion, "org.apache.avro" % "avro" % avroVersion, "org.apache.avro" % "avro-compiler" % avroVersion /* just to deserialize IDL (as opposed to JSON)... */) // any way to serialize IDL (t220224102703)? diff --git a/project/GalliaCommonSettings.scala b/project/GalliaCommonSettings.scala index 4fc93af..a39e427 100644 --- a/project/GalliaCommonSettings.scala +++ b/project/GalliaCommonSettings.scala @@ -3,35 +3,19 @@ import sbt.Keys._ // =========================================================================== object GalliaCommonSettings { - val CurrentGalliaVersion = "0.5.0" - + val scala3 = "3.3.1" + val scala213 = "2.13.12" + val scala212 = "2.12.18" + // --------------------------------------------------------------------------- val mainSettings = Seq( - organizationHomepage := Some(url("https://github.com/galliaproject")), - startYear := Some(2021), - developers := - List(Developer( - id = "anthony-cros", - name = "Anthony Cros", - email = "contact.galliaproject@gmail.com", - url = url("https://github.com/anthony-cros") )), - + scalaVersion := scala3, + crossScalaVersions := List(scala3, scala213, scala212), // --------------------------------------------------------------------------- - scalaVersion := GalliaScalaVersions.supported.head, - crossScalaVersions := GalliaScalaVersions.supported) - - // =========================================================================== - // TODO: t210121165741: -Xdisable-assertions (also turns off require?) - scalacOptions ++= Seq( - "-encoding", "UTF-8", - //"-Yimports:java.lang,scala,scala.Predef,scala.util.chaining,aptus.Anything_" -- not possible for 2.12 it seems (TODO: t210308154253 confirm) - "-Ywarn-value-discard") ++ - // --------------------------------------------------------------------------- - (scalaBinaryVersion.value match { - case "2.13" => Seq("-Ywarn-unused:imports") - case _ => Seq("-Ywarn-unused-import" ) }) - -} + scalacOptions ++= (scalaBinaryVersion.value match { + case "3" => GalliaScalacOptions.scala3Options + case "2.13" => GalliaScalacOptions.scala213Options + case "2.12" => GalliaScalacOptions.scala212Options })) } // =========================================================================== diff --git a/project/GalliaScalaVersions.scala b/project/GalliaScalaVersions.scala deleted file mode 100644 index 39c81a9..0000000 --- a/project/GalliaScalaVersions.scala +++ /dev/null @@ -1,15 +0,0 @@ -import sbt._ - -// =========================================================================== -object GalliaScalaVersions { - val scala213 = "2.13.12" - val scala212 = "2.12.18" - - // --------------------------------------------------------------------------- - val supported = List( - scala213, - scala212) -} - -// =========================================================================== - diff --git a/project/GalliaScalacOptions.scala b/project/GalliaScalacOptions.scala new file mode 100644 index 0000000..e19c0df --- /dev/null +++ b/project/GalliaScalacOptions.scala @@ -0,0 +1,27 @@ +// =========================================================================== +object GalliaScalacOptions { + + val commonOptions = Seq( + "-encoding", "UTF-8", + "-feature", + "-unchecked", + "-deprecation", + + "-language:implicitConversions") + + // =========================================================================== + val commonOptionsExcept212 = Seq( + "-Wunused:implicits", + "-Wunused:explicits", + "-Wunused:imports", + "-Wunused:locals", + "-Wunused:params", + "-Wunused:privates") + + // =========================================================================== + val scala3Options = commonOptions ++ commonOptionsExcept212 ++ Seq("-no-indent", "-Wvalue-discard") + val scala213Options = commonOptions ++ commonOptionsExcept212 ++ Seq("-Wdead-code", "-Ywarn-value-discard") + val scala212Options = commonOptions ++ Seq( "-Ywarn-value-discard", "-Ywarn-unused-import" ) } + +// =========================================================================== + diff --git a/project/build.properties b/project/build.properties index 19479ba..40b3b8e 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.2 +sbt.version=1.9.0