@@ -4,14 +4,14 @@ import scoverage.ScoverageKeys
44concurrentRestrictions in Global += Tags .limit(Tags .Test , 1 )
55
66// All Twitter library releases are date versioned as YY.MM.patch
7- val releaseVersion = " 19.8 .0"
7+ val releaseVersion = " 19.9 .0"
88
99lazy val buildSettings = Seq (
1010 version := releaseVersion,
1111 scalaVersion := " 2.12.8" ,
1212 crossScalaVersions := Seq (" 2.11.12" , " 2.12.8" ),
1313 scalaModuleInfo := scalaModuleInfo.value.map(_.withOverrideScalaVersion(true )),
14- fork in Test := true ,
14+ fork in Test := true , // We have to fork to get the JavaOptions
1515 javaOptions in Test ++= travisTestJavaOptions
1616)
1717
@@ -23,13 +23,29 @@ lazy val noPublishSettings = Seq(
2323 publishTo := Some (Resolver .file(" Unused transient repository" , file(" target/unusedrepo" )))
2424)
2525
26+ def gcJavaOptions : Seq [String ] = {
27+ Seq (
28+ " -XX:+UseParNewGC" ,
29+ " -XX:+UseConcMarkSweepGC" ,
30+ " -XX:+CMSParallelRemarkEnabled" ,
31+ " -XX:+CMSClassUnloadingEnabled" ,
32+ " -XX:ReservedCodeCacheSize=128m" ,
33+ " -XX:SurvivorRatio=128" ,
34+ " -XX:MaxTenuringThreshold=0" ,
35+ " -Xss8M" ,
36+ " -Xms512M" ,
37+ " -Xmx2G"
38+ )
39+ }
40+
2641def travisTestJavaOptions : Seq [String ] = {
2742 // When building on travis-ci, we want to suppress logging to error level only.
43+ // https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
2844 val travisBuild = sys.env.getOrElse(" TRAVIS" , " false" ).toBoolean
2945 if (travisBuild) {
3046 Seq (
3147 " -DSKIP_FLAKY=true" ,
32- " -Dsbt.log.noformat =true" ,
48+ " -DSKIP_FLAKY_TRAVIS =true" ,
3349 " -Dorg.slf4j.simpleLogger.defaultLogLevel=error" ,
3450 " -Dcom.twitter.inject.test.logging.disabled" ,
3551 // Needed to avoid cryptic EOFException crashes in forked tests
@@ -107,6 +123,12 @@ lazy val baseSettings = Seq(
107123 scalaCompilerOptions,
108124 javacOptions in (Compile , compile) ++= Seq (" -source" , " 1.8" , " -target" , " 1.8" , " -Xlint:unchecked" ),
109125 javacOptions in doc ++= Seq (" -source" , " 1.8" ),
126+ javaOptions ++= Seq (
127+ " -Djava.net.preferIPv4Stack=true" ,
128+ " -XX:+AggressiveOpts" ,
129+ " -server"
130+ ),
131+ javaOptions ++= gcJavaOptions,
110132 // -a: print stack traces for failing asserts
111133 testOptions += Tests .Argument (TestFrameworks .JUnit , " -a" , " -v" ),
112134 // broken in 2.12 due to: https://issues.scala-lang.org/browse/SI-10134
@@ -517,8 +539,7 @@ lazy val injectUtils = (project in file("inject/inject-utils"))
517539 moduleName := " inject-utils" ,
518540 libraryDependencies ++= Seq (
519541 " com.twitter" %% " finagle-core" % versions.twLibVersion,
520- " com.twitter" %% " util-core" % versions.twLibVersion,
521- " commons-lang" % " commons-lang" % versions.commonsLang
542+ " com.twitter" %% " util-core" % versions.twLibVersion
522543 )
523544 ).dependsOn(
524545 injectCore % " test->test;compile->compile" )
0 commit comments