Skip to content

Commit

Permalink
add Scala 3 buid setting
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Oct 5, 2023
1 parent d98f65c commit 2918ad5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
case ${{ matrix.java }} in
"8")
sbt -v ++2.12.x "scalaxbPlugin/scripted"
sbt -v ++3.x "app/Test/compile"
sbt -v +integration/test
;;
"21")
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ lazy val app = (project in file("cli"))
.settings(codegenSettings)
.settings(nocomma {
name := "scalaxb"
crossScalaVersions := Seq(scala213, scala212, scala211, scala210)
crossScalaVersions := Seq(scala3, scala213, scala212, scala211, scala210)
scalaVersion := scala212
resolvers += sbtResolver.value
libraryDependencies ++= appDependencies(scalaVersion.value)
Expand Down
14 changes: 11 additions & 3 deletions project/dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import sbt._

object Dependencies {
val scala3 = "3.3.1"
val scala213 = "2.13.12"
val scala212 = "2.12.18"
val scala211 = "2.11.12"
val scala210 = "2.10.7"

val jaxb = "javax.xml.bind" % "jaxb-api" % "2.3.1"
val scopt = "com.github.scopt" %% "scopt" % "3.7.1"
def scopt(sv: String) = {
CrossVersion.partialVersion(sv) match {
case Some((2, _)) =>
"com.github.scopt" %% "scopt" % "3.7.1"
case _ =>
"com.github.scopt" %% "scopt" % "4.1.0"
}
}
val log4j = "log4j" % "log4j" % "1.2.17"
val defaultDispatchVersion = "1.0.1"
def dispatch(sv: String) = CrossVersion partialVersion sv match {
Expand Down Expand Up @@ -63,13 +71,13 @@ object Dependencies {
def appDependencies(sv: String) = Seq(
launcherInterface % "provided",
jaxb % "provided",
scopt,
scopt(sv),
log4j
) ++ (sv match {
case x if sv.startsWith("2.10.") => Nil
case x if sv.startsWith("2.11.") => Seq(scalaXml1, scalaParserCombinators1)
case x if sv.startsWith("2.12.") => Seq(scalaXml2, scalaParserCombinators1)
case x if sv.startsWith("2.13.") => Seq(scalaXml2, scalaParserCombinators2)
case x => Seq(scalaXml2, scalaParserCombinators2)
})
def integrationDependencies(sv: String) = Seq(
dispatch(sv) % "test",
Expand Down

0 comments on commit 2918ad5

Please sign in to comment.