-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: update to support both scala 3 and scala 2.13
- Loading branch information
Showing
22 changed files
with
200 additions
and
127 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 |
---|---|---|
|
@@ -68,3 +68,5 @@ project/**/metals.sbt | |
|
||
.bsp | ||
.history | ||
scala2/target | ||
scala3/target |
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,41 +1,102 @@ | ||
ThisBuild / version := "2.0.0-RC1" | ||
|
||
ThisBuild / scalaVersion := "2.13.12" | ||
|
||
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full) | ||
import sbt._ | ||
import Keys._ | ||
|
||
ThisBuild / organization := "com.suprnation" | ||
ThisBuild / name := "cats-actors" | ||
ThisBuild / version := "2.0.0-RC2" | ||
ThisBuild / organizationName := "SuprNation" | ||
ThisBuild / startYear := Some(2024) | ||
ThisBuild / licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt")) | ||
|
||
organizationName := "SuprNation" | ||
startYear := Some(2024) | ||
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt")) | ||
ThisBuild / crossScalaVersions := Seq("2.13.12", "3.3.0") | ||
ThisBuild / scalaVersion := crossScalaVersions.value.head | ||
|
||
Test / parallelExecution := false | ||
lazy val commonSettings = Seq( | ||
Test / parallelExecution := false, | ||
libraryDependencies ++= Seq( | ||
"org.typelevel" %% "cats-effect" % "3.5.2", | ||
"org.scalatest" %% "scalatest" % "3.2.19" % Test | ||
), | ||
publishMavenStyle := true, | ||
publishTo := { | ||
val owner = "suprnation" | ||
val repo = "cats-actors" | ||
if (isSnapshot.value) | ||
Some("GitHub Package Registry".at(s"https://maven.pkg.github.com/$owner/$repo")) | ||
else | ||
Some("GitHub Package Registry".at(s"https://maven.pkg.github.com/$owner/$repo")) | ||
}, | ||
publishConfiguration := publishConfiguration.value.withOverwrite(true), | ||
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true) | ||
) | ||
|
||
scalacOptions ++= Seq( // use ++= to add to existing options | ||
"-deprecation", | ||
"-encoding", | ||
"utf8", // if an option takes an arg, supply it on the same line | ||
"-feature", // then put the next option on a new line for easy editing | ||
"-language:implicitConversions", | ||
"-language:existentials", | ||
"-unchecked", | ||
"-Werror", | ||
"-Xlint" // exploit "trailing comma" syntax so you can add an option without editing this line | ||
lazy val scala2Settings = Seq( | ||
libraryDependencies += "org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full, | ||
scalacOptions ++= Seq( | ||
"-language:implicitConversions", | ||
"-language:existentials" | ||
) | ||
) | ||
|
||
libraryDependencies ++= Seq( | ||
"org.typelevel" %% "cats-effect" % "3.5.2", // if needed for other dependencies | ||
"org.typelevel" %% "cats-effect" % "3.5.0", | ||
"org.scalatest" %% "scalatest" % "3.2.18" % Test | ||
lazy val scala3Settings = Seq( | ||
// Scala 3 specific settings can be added here | ||
) | ||
|
||
publishTo := { | ||
val owner = "suprnation" | ||
val repo = "cats-actors" | ||
if (isSnapshot.value) | ||
Some("GitHub Package Registry".at(s"https://maven.pkg.github.com/$owner/$repo")) | ||
else | ||
Some("GitHub Package Registry".at(s"https://maven.pkg.github.com/$owner/$repo")) | ||
} | ||
lazy val root = (project in file(".")) | ||
.settings(commonSettings) | ||
.settings( | ||
name := "cats-actors", | ||
// Conditionally apply settings based on Scala version | ||
libraryDependencies ++= (scalaVersion.value match { | ||
case v if v.startsWith("2.") => Seq("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full) | ||
case _ => Seq() | ||
}), | ||
scalacOptions ++= (scalaVersion.value match { | ||
case v if v.startsWith("2.") => Seq( | ||
"-deprecation", | ||
"-encoding", "utf8", | ||
"-feature", | ||
"-unchecked", | ||
"-Werror", | ||
"-language:implicitConversions", | ||
"-language:existentials", | ||
"-Xlint" | ||
) | ||
case _ => Seq() | ||
}), | ||
Compile / unmanagedSourceDirectories ++= Seq( | ||
baseDirectory.value / "src" / "main" / "scala" | ||
), | ||
Test / unmanagedSourceDirectories ++= Seq( | ||
baseDirectory.value / "src" / "test" / "scala" | ||
), | ||
// Ensure the artifacts are published with the Scala version in the name | ||
Compile / packageBin / artifactPath := { | ||
val artPath = (Compile / packageBin / artifactPath).value | ||
val scalaVer = scalaBinaryVersion.value match { | ||
case "2.13" => "2_13" | ||
case "3" => "3" | ||
case other => other.replace('.', '_') | ||
} | ||
file(s"${artPath.getParent}/cats-actors_${scalaVer}-${version.value}.jar") | ||
}, | ||
// Add tasks to create source and javadoc JARs | ||
Compile / packageSrc / artifactPath := { | ||
val artPath = (Compile / packageSrc / artifactPath).value | ||
val scalaVer = scalaBinaryVersion.value match { | ||
case "2.13" => "2_13" | ||
case "3" => "3" | ||
case other => other.replace('.', '_') | ||
} | ||
file(s"${artPath.getParent}/cats-actors_${scalaVer}-${version.value}-sources.jar") | ||
}, | ||
Compile / packageDoc / artifactPath := { | ||
val artPath = (Compile / packageDoc / artifactPath).value | ||
val scalaVer = scalaBinaryVersion.value match { | ||
case "2.13" => "2_13" | ||
case "3" => "3" | ||
case other => other.replace('.', '_') | ||
} | ||
file(s"${artPath.getParent}/cats-actors_${scalaVer}-${version.value}-javadoc.jar") | ||
} | ||
) |
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.