-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Scala to 2.13 and other dependencies
- Loading branch information
Showing
30 changed files
with
235 additions
and
217 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
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
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,26 +1,26 @@ | ||
import com.typesafe.sbt.SbtGit.GitKeys._ | ||
import com.typesafe.tools.mima.core._ | ||
import com.typesafe.sbt.SbtGit.GitKeys.* | ||
import com.typesafe.tools.mima.core.* | ||
import sbtcrossproject.CrossPlugin.autoImport.crossProject | ||
import sbtcrossproject.CrossProject | ||
|
||
val Scala211 = "2.11.12" | ||
val Scala212 = "2.12.15" | ||
val Scala213 = "2.13.8" | ||
val Scala212 = "2.12.19" | ||
val Scala213 = "2.13.13" | ||
|
||
commonSettings | ||
noPublishSettings | ||
crossScalaVersions := Nil | ||
|
||
ThisBuild / organization := "com.chuusai" | ||
ThisBuild / scalaVersion := Scala213 | ||
ThisBuild / scalaVersion := Scala211 | ||
ThisBuild / crossScalaVersions := Seq(Scala211, Scala212, Scala213) | ||
ThisBuild / mimaFailOnNoPrevious := false | ||
ThisBuild / versionScheme := Some("pvp") | ||
|
||
// GHA configuration | ||
|
||
ThisBuild / githubWorkflowBuildPreamble := Seq(WorkflowStep.Run(List("sudo apt install clang libunwind-dev libgc-dev libre2-dev"))) | ||
ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]") | ||
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")) | ||
ThisBuild / githubWorkflowArtifactUpload := false | ||
ThisBuild / githubWorkflowBuildMatrixAdditions += "platform" -> List("jvm", "js", "native") | ||
ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false) | ||
|
@@ -78,20 +78,31 @@ val scalacOptions212 = Seq( | |
|
||
val scalacOptions213 = Seq( | ||
"-Xlint:-adapted-args,-delayedinit-select,-nullary-unit,-package-object-classes,-type-parameter-shadow,-byname-implicit,_", | ||
"-Ywarn-unused:-implicits", | ||
"-Wconf:msg=shadowing a nested class of a parent is deprecated:s" | ||
"-Wunused:-implicits", | ||
"-Wconf:msg=shadowing a nested class of a parent is deprecated:s", | ||
) | ||
|
||
val scalacTestOptions213 = Seq( | ||
"-Xlint:-infer-any,-named-booleans", | ||
"-Wunused:-locals,-privates", | ||
// Symbol.unapply returns Option | ||
"-Wconf:cat=other-implicit-type:s,cat=other-match-analysis&src=*/lazy.scala:s", | ||
) | ||
|
||
lazy val commonSettings = crossVersionSharedSources ++ Seq( | ||
resolvers ++= Resolver.sonatypeOssRepos("releases"), | ||
resolvers ++= Resolver.sonatypeOssRepos("snapshots"), | ||
incOptions := incOptions.value.withLogRecompileOnMacro(false), | ||
scalacOptions := scalacOptionsAll, | ||
Compile / compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 12)) => scalacOptions212 | ||
case Some((2, 13)) => scalacOptions213 | ||
case _ => Nil | ||
}), | ||
Test / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => scalacTestOptions213 | ||
case _ => Nil | ||
}), | ||
Compile / console / scalacOptions -= "-Xfatal-warnings", | ||
Test / console / scalacOptions -= "-Xfatal-warnings", | ||
console / initialCommands := """import shapeless._""", | ||
|
@@ -182,17 +193,21 @@ lazy val examples = crossProject(JSPlatform, JVMPlatform, NativePlatform) | |
.configureCross(configureJUnit) | ||
.dependsOn(core) | ||
.settings(moduleName := "examples") | ||
.settings(libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "2.1.1") | ||
.settings(libraryDependencies += "org.scala-lang.modules" %%% "scala-parser-combinators" % "2.2.0") | ||
.settings(runAllIn(Compile)) | ||
.settings(commonSettings) | ||
.settings(noPublishSettings) | ||
.nativeSettings(Compile / sources ~= (_.filterNot(_.getName == "sexp.scala"))) | ||
.settings(scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match { | ||
case Some((2, 13)) => scalacTestOptions213 | ||
case _ => Nil | ||
})) | ||
|
||
lazy val examplesJVM = examples.jvm | ||
lazy val examplesJS = examples.js | ||
lazy val examplesNative = examples.native | ||
|
||
lazy val crossVersionSharedSources: Seq[Setting[_]] = | ||
lazy val crossVersionSharedSources: Seq[Setting[?]] = | ||
Seq(Compile, Test).map { sc => | ||
(sc / unmanagedSourceDirectories) ++= { | ||
(sc / unmanagedSourceDirectories).value.flatMap { dir: File => | ||
|
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
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
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
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
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
Oops, something went wrong.