Skip to content

Commit

Permalink
Switch to Java 8 and Scala 2.11
Browse files Browse the repository at this point in the history
Problem

Its time to drop support for Java 7 and Scala 2.10 as per the blog
post [1].

Solution

Update sbt builds.

[1] https://finagle.github.io/blog/2016/04/20/scala-210-and-java7/

RB_ID=828898
  • Loading branch information
kevinoliver authored and jenkins committed May 9, 2016
1 parent b3aa95f commit d3c82c2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 41 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Expand Up @@ -14,15 +14,10 @@ cache:
- $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION

scala:
- 2.10.6
- 2.11.7
- 2.11.8

jdk:
- oraclejdk7
# Note: not currently testing on JDK 8 internally
- oraclejdk8
# Enable once https://github.com/travis-ci/travis-ci/issues/5227 is fixed.
#- openjdk7

notifications:
hipchat:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Expand Up @@ -5,6 +5,11 @@ as it is included in Scrooge's user's guide.
4.x
-----

- Builds are now only for Java 8 and Scala 2.11. See the
`blog post <https://finagle.github.io/blog/2016/04/20/scala-210-and-java7/>`_
for details. ``RB_ID=828898``


~~~~~

4.7.0
Expand Down
48 changes: 16 additions & 32 deletions project/Build.scala
Expand Up @@ -49,19 +49,6 @@ object Scrooge extends Build {
ScroogeRunner.genTestThriftTask
)

def scalacOptionsVersion(sv: String): Seq[String] = {
Seq(
"-deprecation",
"-unchecked",
"-feature",
"-Xlint",
"-encoding", "utf8"
) ++ (CrossVersion.partialVersion(sv) match {
case Some((2, x)) if x >= 11 => Seq("-Ypatmat-exhaust-depth", "40")
case _ => Nil
})
}

val sharedSettingsWithoutScalaVersion = Seq(
version := libVersion,
organization := "com.twitter",
Expand All @@ -70,12 +57,7 @@ object Scrooge extends Build {
"sonatype-public" at "https://oss.sonatype.org/content/groups/public"
),

ScoverageSbtPlugin.ScoverageKeys.coverageHighlighting := (
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 10)) => false
case _ => true
}
),
ScoverageSbtPlugin.ScoverageKeys.coverageHighlighting := true,

libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.4" % "test",
Expand All @@ -84,7 +66,14 @@ object Scrooge extends Build {
),
resolvers += "twitter-repo" at "https://maven.twttr.com",

scalacOptions := scalacOptionsVersion(scalaVersion.value),
scalacOptions := Seq(
"-target:jvm-1.8",
"-deprecation",
"-unchecked",
"-feature", "-Xlint",
"-encoding", "utf8",
"-Ypatmat-exhaust-depth", "40"
),

// Sonatype publishing
publishArtifact in Test := false,
Expand Down Expand Up @@ -131,16 +120,14 @@ object Scrooge extends Build {
val sharedSettings =
sharedSettingsWithoutScalaVersion ++
Seq(
crossScalaVersions := Seq("2.10.6", "2.11.7"),
scalaVersion := "2.11.7",
javacOptions ++= Seq("-source", "1.7", "-target", "1.7", "-Xlint:unchecked"),
javacOptions in doc := Seq("-source", "1.7")
scalaVersion := "2.11.8",
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint:unchecked"),
javacOptions in doc := Seq("-source", "1.8")
)

val settingsWithTwoTen =
sharedSettingsWithoutScalaVersion ++
Seq(
crossScalaVersions := Seq("2.10.6"),
scalaVersion := "2.10.6",
javacOptions ++= Seq("-source", "1.7", "-target", "1.7", "-Xlint:unchecked"),
javacOptions in doc := Seq("-source", "1.7")
Expand Down Expand Up @@ -195,18 +182,15 @@ object Scrooge extends Build {
assemblySettings
).settings(
name := "scrooge-generator",
libraryDependencies ++= (Seq(
libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % libthriftVersion,
"com.github.scopt" %% "scopt" % "3.3.0",
"com.github.spullara.mustache.java" % "compiler" % "0.8.18",
"org.codehaus.plexus" % "plexus-utils" % "1.5.4",
"com.google.code.findbugs" % "jsr305" % "2.0.1",
"commons-cli" % "commons-cli" % "1.3.1"
).++(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, x)) if x >= 11 =>
Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4")
case _ => Nil
})),
"commons-cli" % "commons-cli" % "1.3.1",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4"
),
test in assembly := {}, // Skip tests when running assembly.
mainClass in assembly := Some("com.twitter.scrooge.Main")
)
Expand Down
7 changes: 6 additions & 1 deletion project/build.sbt
@@ -1 +1,6 @@
scalacOptions ++= Seq("-deprecation", "-unchecked", "-feature", "-Xlint", "-encoding", "utf8")
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-feature", "-Xlint",
"-encoding", "utf8"
)
4 changes: 2 additions & 2 deletions sbt
Expand Up @@ -122,12 +122,12 @@ init_default_option_file () {

declare -r cms_opts="-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
declare -r jit_opts="-XX:ReservedCodeCacheSize=256m -XX:+TieredCompilation"
declare -r default_jvm_opts="-Dfile.encoding=UTF8 -XX:MaxPermSize=384m -Xms512m -Xmx1536m -Xss2m $jit_opts $cms_opts"
declare -r default_jvm_opts="-Dfile.encoding=UTF8 -Xms512m -Xmx1536m -Xss2m $jit_opts $cms_opts"
declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
declare -r latest_28="2.8.2"
declare -r latest_29="2.9.3"
declare -r latest_210="2.10.3"
declare -r latest_211="2.11.0-M5"
declare -r latest_211="2.11.7"

declare -r script_path=$(get_script_path "$BASH_SOURCE")
declare -r script_dir="$(dirname $script_path)"
Expand Down

0 comments on commit d3c82c2

Please sign in to comment.