Skip to content

Commit 801008d

Browse files
committed
Merge pull request #16 from adriaanm/master
Build cleanup
2 parents 08814e2 + a5de947 commit 801008d

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

Diff for: .travis.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
language: scala
2-
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
2+
script:
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:
13-
11+
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)'

Diff for: build.sbt

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1+
import VersionKeys.{snapshotScalaBinaryVersion,deriveBinaryVersion}
2+
13
organization := "org.scala-lang.modules"
24

35
name := "scala-xml"
46

57
version := "1.0.0-SNAPSHOT"
68

7-
// standard stuff follows:
8-
scalaVersion := "2.11.0-M6"
9+
scalaVersion := "2.11.0-M7"
10+
11+
snapshotScalaBinaryVersion := "2.11.0-M7"
912

10-
// NOTE: not necessarily equal to scalaVersion
11-
// (e.g., during PR validation, we override scalaVersion to validate,
12-
// but don't rebuild scalacheck, so we don't want to rewire that dependency)
13-
scalaBinaryVersion := "2.11.0-M6"
13+
// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW)
14+
15+
scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value)
1416

1517
// to allow compiling against snapshot versions of Scala
1618
resolvers += Resolver.sonatypeRepo("snapshots")
1719

18-
// don't use for doc scope, scaladoc warnings are not to be reckoned with
19-
scalacOptions in compile ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint")
2020

2121
libraryDependencies ++= Seq(
2222
"org.scala-lang" % "scala-compiler" % scalaVersion.value % "test", // used in CompilerErrors test
2323
"junit" % "junit" % "4.11" % "test",
2424
"com.novocode" % "junit-interface" % "0.10" % "test")
2525

26+
27+
// don't use for doc scope, scaladoc warnings are not to be reckoned with
28+
// TODO: turn on for nightlies, but don't enable for PR validation... "-Xfatal-warnings"
29+
scalacOptions in compile ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")
30+
2631
// Generate $name.properties to store our version as well as the scala version used to build
2732
resourceGenerators in Compile <+= Def.task {
2833
val props = new java.util.Properties

Diff for: project/keys.scala

+8-5
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)