Skip to content

Commit 7a578e8

Browse files
committed
Merge pull request #11 from adriaanm/master
Build cleanup
2 parents 76ccec7 + 09379d2 commit 7a578e8

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: scala
22
script:
3-
- sbt ++$TRAVIS_SCALA_VERSION 'set concurrentRestrictions in Global += Tags.limit(Tags.Compile, 2)' compile test:compile
4-
- sbt ++$TRAVIS_SCALA_VERSION 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' test
3+
- sbt ++$TRAVIS_SCALA_VERSION clean update compile test
54
scala:
6-
- 2.10.3
75
- 2.11.0-SNAPSHOT
86
jdk:
97
- oraclejdk6
108
- openjdk7
119
notifications:
1210
email:
1311
12+
13+
# if we get weird timeouts, see https://github.com/spray/spray/pull/233
14+
# 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)'

build.sbt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1+
import VersionKeys.{snapshotScalaBinaryVersion,deriveBinaryVersion}
2+
13
organization := "org.scala-lang.modules"
24

35
name := "scala-parser-combinators"
46

57
version := "1.0.0-SNAPSHOT"
68

7-
scalaVersion := "2.11.0-M6"
9+
scalaVersion := "2.11.0-M7"
10+
11+
snapshotScalaBinaryVersion := "2.11.0-M7"
12+
13+
// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW)
814

9-
// NOTE: not necessarily equal to scalaVersion
10-
// (e.g., during PR validation, we override scalaVersion to validate,
11-
// but don't rebuild scalacheck, so we don't want to rewire that dependency)
12-
scalaBinaryVersion := "2.11.0-M6"
15+
scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value)
1316

1417
// to allow compiling against snapshot versions of Scala
1518
resolvers += Resolver.sonatypeRepo("snapshots")
1619

20+
21+
libraryDependencies ++= Seq(
22+
"junit" % "junit" % "4.11" % "test",
23+
"com.novocode" % "junit-interface" % "0.10" % "test")
24+
1725
// don't use for doc scope, scaladoc warnings are not to be reckoned with
18-
scalacOptions in compile ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint")
26+
// TODO: turn on for nightlies, but don't enable for PR validation... "-Xfatal-warnings"
27+
scalacOptions in compile ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")
1928

2029

2130
// Generate $name.properties to store our version as well as the scala version used to build
@@ -81,8 +90,6 @@ pomExtra := (
8190
</developers>
8291
)
8392

84-
libraryDependencies ++= Seq("junit" % "junit" % "4.11" % "test", "com.novocode" % "junit-interface" % "0.10" % "test")
85-
8693
osgiSettings
8794

8895
val osgiVersion = version(_.replace('-', '.'))

project/keys.scala

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
object TestKeys {
1+
object VersionKeys {
22
import sbt.settingKey
33

4-
// for testing with partest
5-
val includeTestDependencies = settingKey[Boolean]("Doesn't declare test dependencies.")
4+
val snapshotScalaBinaryVersion = settingKey[String]("The Scala binary version to use when building against Scala SNAPSHOT.")
65

7-
val partestVersion = settingKey[String]("Partest version.")
8-
}
6+
def deriveBinaryVersion(sv: String, snapshotScalaBinaryVersion: String) = sv match {
7+
case snap_211 if snap_211.startsWith("2.11") &&
8+
snap_211.contains("-SNAPSHOT") => snapshotScalaBinaryVersion
9+
case sv => sbt.CrossVersion.binaryScalaVersion(sv)
10+
}
11+
}

0 commit comments

Comments
 (0)