-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scala 3 migration (build-related parts)
- Loading branch information
1 parent
89731bc
commit 5e0c1ac
Showing
5 changed files
with
59 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "[email protected]", | ||
url = url("https://github.com/anthony-cros"))) | ||
ThisBuild / scmInfo := Some(ScmInfo( | ||
browseUrl = url("https://github.com/galliaproject/gallia-core"), | ||
connection = "scm:[email protected]: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:[email protected]: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)? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 = "[email protected]", | ||
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 })) } | ||
|
||
// =========================================================================== | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" ) } | ||
|
||
// =========================================================================== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.5.2 | ||
sbt.version=1.9.0 |