Skip to content

Commit

Permalink
Merge pull request #271 from tpolecat/scala-3
Browse files Browse the repository at this point in the history
Scala 3
  • Loading branch information
tpolecat authored May 14, 2021
2 parents d3dd387 + ebd979c commit 1e1804f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
java-version: 8
- name: Publish
run: csbt ci-release
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
with:
java-version: 8
- name: Run compile
run: csbt +compile +test
run: sbt +compile +test
42 changes: 10 additions & 32 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import sbtcrossproject.{ crossProject, CrossType }

lazy val catsVersion = "2.6.0"
lazy val fs2CoreVersion = "2.5.5"
lazy val scalacheckVersion = "1.15.4"
lazy val kindProjectorVersion = "0.10.3"
lazy val catsVersion = "2.6.1"
lazy val fs2CoreVersion = "2.5.6"
lazy val scalacheckVersion = "1.15.4"

lazy val scala212 = "2.12.12"
lazy val scala213 = "2.13.5"
lazy val scala30prev = "3.0.0-RC2"
lazy val scala30 = "3.0.0-RC3"
lazy val scala212 = "2.12.12"
lazy val scala213 = "2.13.5"
lazy val scala30 = "3.0.0"

lazy val commonSettings = Seq(
organization := "org.tpolecat",
Expand All @@ -21,32 +19,12 @@ lazy val commonSettings = Seq(
("BSD New", url("http://opensource.org/licenses/BSD-3-Clause"))
),
scalaVersion := scala213,
crossScalaVersions := Seq(scala212, scala213, scala30prev, scala30),

// Add some more source directories
unmanagedSourceDirectories in Compile ++= {
val sourceDir = (sourceDirectory in Compile).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(sourceDir / "scala-3")
case Some((2, _)) => Seq(sourceDir / "scala-2")
case _ => Seq()
}
},

// Also for test
unmanagedSourceDirectories in Test ++= {
val sourceDir = (sourceDirectory in Test).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(sourceDir / "scala-3")
case Some((2, _)) => Seq(sourceDir / "scala-2")
case _ => Seq()
}
},
crossScalaVersions := Seq(scala212, scala213, scala30),

// dottydoc really doesn't work at all right now
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (isDotty.value)
if (scalaVersion.value.startsWith("3."))
Seq()
else
old
Expand Down Expand Up @@ -92,7 +70,7 @@ lazy val refined =
.settings(commonSettings)
.settings(
name := "atto-refined",
libraryDependencies += "eu.timepit" %%% "refined" % "0.9.24",
libraryDependencies += "eu.timepit" %%% "refined" % "0.9.25",
)

lazy val tests =
Expand Down Expand Up @@ -122,7 +100,7 @@ lazy val docs = project
paradoxTheme := Some(builtinParadoxTheme("generic")),
version := version.value.takeWhile(_ != '+'), // strip off the +3-f22dca22+20191110-1520-SNAPSHOT business
paradoxProperties ++= Map(
"scala-versions" -> (crossScalaVersions in core.jvm).value.map(CrossVersion.partialVersion).flatten.map(_._2).mkString("2.", "/", ""),
"scala-versions" -> (core.jvm/crossScalaVersions).value.map(CrossVersion.partialVersion).flatten.map(_._2).mkString("2.", "/", ""),
"org" -> organization.value,
"scala.binary.version" -> s"2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
"core-dep" -> s"${(core.jvm / name).value}_2.${CrossVersion.partialVersion(scalaVersion.value).get._2}",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.9
sbt.version=1.5.2
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17"
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.5")

0 comments on commit 1e1804f

Please sign in to comment.