Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: scala

env:
#
# Scala 2.11 supported versions
#
- SCALA_VERSION=2.11.6
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.11.7
Expand All @@ -14,6 +17,9 @@ env:
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.11.12
TRAVIS_JDK=adopt@~1.11.0-0
#
# Scala 2.12 supported versions
#
- SCALA_VERSION=2.12.3
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.12.3
Expand Down Expand Up @@ -54,6 +60,9 @@ env:
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.12.13
TRAVIS_JDK=adopt@~1.11.0-0
#
# Scala 2.13 supported versions
#
- SCALA_VERSION=2.13.0
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.13.0
Expand All @@ -74,6 +83,10 @@ env:
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.13.4
TRAVIS_JDK=adopt@~1.11.0-0
- SCALA_VERSION=2.13.5
TRAVIS_JDK=adopt@~1.8.0-0
- SCALA_VERSION=2.13.5
TRAVIS_JDK=adopt@~1.11.0-0

before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh
install: jabba install "$TRAVIS_JDK" && jabba use "$_" && java -Xmx32m -version
Expand All @@ -98,7 +111,7 @@ before_cache:
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
cache:
directories:
- $HOME/.ivy2
- $HOME/.sbt/boot
- $HOME/.sbt/launchers
- $HOME/.cache/coursier
- $HOME/.ivy2
- $HOME/.sbt/boot
- $HOME/.sbt/launchers
- $HOME/.cache/coursier
28 changes: 7 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,13 @@ lazy val defaults = Seq(
sonatypeProfileName := "com.typesafe",
scalaVersion := crossScalaVersions.value.last,
crossScalaVersions := {
val earliest211 = 6
val latest211 = 12
val latest212 = 13
val latest213 = 4
val skipVersions = Set("2.11.9", "2.11.10")
val scala211Versions =
(earliest211 to latest211)
.map(i => s"2.11.$i")
.filterNot(skipVersions.contains(_))
ifJavaVersion(_ < 8) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we are not supporting any Java version older than 8. 🙏🏼

scala211Versions
} {
scala211Versions ++ (0 to latest212).map(i => s"2.12.$i") ++ (0 to latest213).map(i => s"2.13.$i")
}
// Remember to keep this list aligned with .travis.yml
// 2.11.6 is the first to be supported and we skip 2.11.9 and 2.11.10
val supportedScala211Versions = Seq("2.11.6", "2.11.7", "2.11.8", "2.11.11", "2.11.12")
// Scala 2.12.[0-2] are not supported
val supportedScala212Versions = (3 to 13).map(p => s"2.12.$p")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala 2.12.[0-2] versions were included before, but the code does not even compile for those versions, which explains they weren't listed in .travis.yml.

val supportedScala213Versions = (0 to 5).map(p => s"2.13.$p")
supportedScala211Versions ++ supportedScala212Versions ++ supportedScala213Versions
},
scalaMajorVersion := CrossVersion.partialVersion(scalaVersion.value).get._2.toInt,
resolvers += Resolver.mavenLocal,
Expand All @@ -74,10 +67,3 @@ lazy val defaults = Seq(
)

lazy val browse = SettingKey[Boolean]("browse", "run with -Ybrowse:uncurry")

def ifJavaVersion[T](predicate: Int => Boolean)(yes: => T)(no: => T): T = {
System.getProperty("java.version").split("\\.").toList match {
case "1" :: v :: _ if predicate(v.toInt) => yes
case _ => no
}
}