Skip to content

Commit

Permalink
Support Scala 3.0.0-M1
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Nov 15, 2020
1 parent 28fcbaf commit 5295e2b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Expand Up @@ -18,10 +18,10 @@ jobs:
strategy:
matrix:
scala:
- { name: 'Scala', version: "2.11.12", binary-version: "2.11", java-version: "8" }
- { name: 'Scala', version: "2.12.12", binary-version: "2.12", java-version: "11" }
- { name: 'Scala', version: "2.13.3", binary-version: "2.13", java-version: "11" }
- { name: 'Dotty', version: "0.26.0-RC1", binary-version: "0.26", java-version: "11" }
- { name: 'Scala 2', version: "2.11.12", binary-version: "2.11", java-version: "8" }
- { name: 'Scala 2', version: "2.12.12", binary-version: "2.12", java-version: "11" }
- { name: 'Scala 2', version: "2.13.3", binary-version: "2.13", java-version: "11" }
- { name: 'Scala 3', version: "3.0.0-M1", binary-version: "3.0.0-M1", java-version: "11" }

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -30,6 +30,9 @@ local.properties
# Locally stored "Eclipse launch configurations"
*.launch

# sbt
.bsp/

# sbteclipse plugin
.target

Expand Down
57 changes: 44 additions & 13 deletions build.sbt
Expand Up @@ -4,8 +4,8 @@ import just.semver.SemVer
import SemVer.{Major, Minor}
import microsites.ConfigYml

val DottyVersion = "0.26.0-RC1"
val ProjectScalaVersion = DottyVersion
val DottyVersion = "3.0.0-M1"
val ProjectScalaVersion = "2.13.3"

val removeDottyIncompatible: ModuleID => Boolean =
m =>
Expand All @@ -14,8 +14,9 @@ val removeDottyIncompatible: ModuleID => Boolean =
m.name == "kind-projector" ||
m.name == "mdoc"

//val ProjectScalaVersion: String = "2.13.1"
val CrossScalaVersions: Seq[String] = Seq("2.10.7", "2.11.12", "2.12.12", "2.13.3", ProjectScalaVersion).distinct
val CrossScalaVersions: Seq[String] = Seq(
"2.10.7", "2.11.12", "2.12.12", "2.13.3", DottyVersion
).distinct

val GitHubUsername = "Kevin-Lee"
val RepoName = "just-fp"
Expand All @@ -33,7 +34,7 @@ lazy val noPublish: SettingsDefinition = Seq(
)

val hedgehogVersionFor2_10 = "7bd29241fababd9a3e954fd38083ed280fc9e4e8"
val hedgehogVersion = "0.4.2"
val hedgehogVersion = "0.5.1"
val hedgehogRepo: MavenRepository =
"bintray-scala-hedgehog" at "https://dl.bintray.com/hedgehogqa/scala-hedgehog"

Expand All @@ -43,10 +44,13 @@ def hedgehogLibs(hedgehogVersion: String): Seq[ModuleID] = Seq(
, "qa.hedgehog" %% "hedgehog-sbt" % hedgehogVersion % Test
)

ThisBuild / scalaVersion := ProjectScalaVersion
ThisBuild / version := ProjectVersion
ThisBuild / organization := "io.kevinlee"
ThisBuild / developers := List(
Global / semanticdbEnabled := false
ThisBuild / semanticdbEnabled := false

ThisBuild / scalaVersion := ProjectScalaVersion
ThisBuild / version := ProjectVersion
ThisBuild / organization := "io.kevinlee"
ThisBuild / developers := List(
Developer(GitHubUsername, "Kevin Lee", "kevin.code@kevinlee.io", url(s"https://github.com/$GitHubUsername"))
)
ThisBuild / homepage := Some(url(s"https://github.com/$GitHubUsername/$RepoName"))
Expand All @@ -70,19 +74,45 @@ lazy val core = (project in file("core"))
// .disablePlugins((if (isDotty.value) Seq(WartRemover) else Seq.empty[AutoPlugin]):_*)
.settings(
name := prefixedProjectName("core")
, semanticdbEnabled := false
, description := "Just FP Lib - Core"
, crossScalaVersions := CrossScalaVersions
, unmanagedSourceDirectories in Compile ++= {
val sharedSourceDir = baseDirectory.value / "src/main"
if (scalaVersion.value.startsWith("2.10") || scalaVersion.value.startsWith("2.11"))
Seq(sharedSourceDir / "scala-2.10_2.11")
else if (scalaVersion.value.startsWith("2.12"))
Seq(
sharedSourceDir / "scala-2.12_2.13",
sharedSourceDir / "scala-2.12_3.0",
)
else if (scalaVersion.value.startsWith("2.13"))
Seq(
sharedSourceDir / "scala-2.12_2.13",
sharedSourceDir / "scala-2.12_3.0",
sharedSourceDir / "scala-2.13_3.0",
)
else if (scalaVersion.value.startsWith("3.0"))
Seq(
sharedSourceDir / "scala-2.12_3.0",
sharedSourceDir / "scala-2.13_3.0"
)
else
Seq(sharedSourceDir / "scala-2.12_2.13")
Seq.empty
}
, scalacOptions :=
( if (isDotty.value)
Seq(
"-source:3.0-migration", "-language:dynamics,existentials,higherKinds,reflectiveCalls,experimental.macros,implicitConversions", "-Ykind-projector"
"-source:3.0-migration",
"-Ykind-projector",
"-language:" + List(
"dynamics",
"existentials",
"higherKinds",
"reflectiveCalls",
"experimental.macros",
"implicitConversions"
).mkString(","),
)
else
Nil
Expand Down Expand Up @@ -129,7 +159,7 @@ lazy val core = (project in file("core"))
(scalaBinaryVersion.value match {
case "2.10" =>
task(Seq.empty[File])
case "2.12" | "2.13" =>
case "2.11" | "2.12" | "2.13" =>
task {
val file = (sourceManaged in Test).value / "amm.scala"
IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
Expand Down Expand Up @@ -238,6 +268,7 @@ lazy val justFp = (project in file("."))
.settings(
name := prefixedProjectName("")
, description := "Just FP Lib"
, semanticdbEnabled := false
)
.settings(noPublish)
.aggregate(core, docs)
.aggregate(core)
4 changes: 2 additions & 2 deletions project/plugins.sbt
Expand Up @@ -12,6 +12,6 @@ addSbtPlugin("io.kevinlee" % "sbt-devoops" % "1.0.3")

addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.4")

addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.1.3")
addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.3.0")

addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.1")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")

0 comments on commit 5295e2b

Please sign in to comment.