diff --git a/.travis.yml b/.travis.yml index 7bd4b49b..589139d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: scala script: - - sbt ++$TRAVIS_SCALA_VERSION 'set concurrentRestrictions in Global += Tags.limit(Tags.Compile, 2)' compile test:compile - - sbt ++$TRAVIS_SCALA_VERSION 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' test + - sbt ++$TRAVIS_SCALA_VERSION clean update compile test scala: - - 2.10.3 - 2.11.0-SNAPSHOT jdk: - oraclejdk6 @@ -11,3 +9,6 @@ jdk: notifications: email: - adriaan.moors@typesafe.com + +# if we get weird timeouts, see https://github.com/spray/spray/pull/233 +# 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' diff --git a/build.sbt b/build.sbt index 9ff28686..489f7b05 100644 --- a/build.sbt +++ b/build.sbt @@ -1,21 +1,30 @@ +import VersionKeys.{snapshotScalaBinaryVersion,deriveBinaryVersion} + organization := "org.scala-lang.modules" name := "scala-parser-combinators" version := "1.0.0-SNAPSHOT" -scalaVersion := "2.11.0-M6" +scalaVersion := "2.11.0-M7" + +snapshotScalaBinaryVersion := "2.11.0-M7" + +// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW) -// NOTE: not necessarily equal to scalaVersion -// (e.g., during PR validation, we override scalaVersion to validate, -// but don't rebuild scalacheck, so we don't want to rewire that dependency) -scalaBinaryVersion := "2.11.0-M6" +scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value) // to allow compiling against snapshot versions of Scala resolvers += Resolver.sonatypeRepo("snapshots") + +libraryDependencies ++= Seq( + "junit" % "junit" % "4.11" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test") + // don't use for doc scope, scaladoc warnings are not to be reckoned with -scalacOptions in compile ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint") +// TODO: turn on for nightlies, but don't enable for PR validation... "-Xfatal-warnings" +scalacOptions in compile ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint") // Generate $name.properties to store our version as well as the scala version used to build @@ -81,8 +90,6 @@ pomExtra := ( ) -libraryDependencies ++= Seq("junit" % "junit" % "4.11" % "test", "com.novocode" % "junit-interface" % "0.10" % "test") - osgiSettings val osgiVersion = version(_.replace('-', '.')) diff --git a/project/keys.scala b/project/keys.scala index 07003822..bdca0dda 100644 --- a/project/keys.scala +++ b/project/keys.scala @@ -1,8 +1,11 @@ -object TestKeys { +object VersionKeys { import sbt.settingKey - // for testing with partest - val includeTestDependencies = settingKey[Boolean]("Doesn't declare test dependencies.") + val snapshotScalaBinaryVersion = settingKey[String]("The Scala binary version to use when building against Scala SNAPSHOT.") - val partestVersion = settingKey[String]("Partest version.") -} \ No newline at end of file + def deriveBinaryVersion(sv: String, snapshotScalaBinaryVersion: String) = sv match { + case snap_211 if snap_211.startsWith("2.11") && + snap_211.contains("-SNAPSHOT") => snapshotScalaBinaryVersion + case sv => sbt.CrossVersion.binaryScalaVersion(sv) + } +}