Skip to content

Commit

Permalink
Merge pull request #5 from tpolecat/scala-3
Browse files Browse the repository at this point in the history
Scala 3
  • Loading branch information
tpolecat authored May 13, 2021
2 parents df9eb2c + 3c69f11 commit 4cd6a98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
27 changes: 3 additions & 24 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

// Our Scala versions.
lazy val `scala-3.0` = "3.0.0-RC3"
lazy val `scala-3.0-prev` = "3.0.0-RC2"
lazy val `scala-2.12` = "2.12.12"
lazy val `scala-2.13` = "2.13.5"
lazy val `scala-3.0` = "3.0.0"

// Publishing
name := "sourcepos"
Expand All @@ -26,7 +25,7 @@ headerLicense := Some(HeaderLicense.Custom(

// Compilation
scalaVersion := `scala-2.13`
crossScalaVersions := Seq(`scala-2.12`, `scala-2.13`, `scala-3.0-prev`, `scala-3.0`)
crossScalaVersions := Seq(`scala-2.12`, `scala-2.13`, `scala-3.0`)
Compile / doc / scalacOptions --= Seq("-Xfatal-warnings")
Compile / doc / scalacOptions ++= Seq(
"-groups",
Expand All @@ -35,32 +34,12 @@ Compile / doc / scalacOptions ++= Seq(
)

// MUnit
libraryDependencies += "org.scalameta" %% "munit" % "0.7.25" % Test
libraryDependencies += "org.scalameta" %% "munit" % "0.7.26" % Test
testFrameworks += new TestFramework("munit.Framework")

// Scala 2 needs scala-reflect
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value).filterNot(_ => scalaVersion.value.startsWith("3."))

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

// dottydoc really doesn't work at all right now
Compile / doc / sources := {
val old = (Compile / doc / sources).value
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.5.0
sbt.version=1.5.2
7 changes: 3 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
1 change: 1 addition & 0 deletions src/main/scala-2/SourcePosPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package org.tpolecat.sourcepos

import scala.language.experimental.macros
import scala.reflect.macros.blackbox

trait SourcePosPlatform {
Expand Down

0 comments on commit 4cd6a98

Please sign in to comment.