Skip to content

Commit 97cb37a

Browse files
committed
Merge pull request typelevel#12 from adriaanm/master
Automate release: settings for dependency versions.
2 parents 0368714 + 53271dd commit 97cb37a

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: scala
22
script:
3-
- sbt ++$TRAVIS_SCALA_VERSION compile
3+
- sbt ++$TRAVIS_SCALA_VERSION clean update compile
44
scala:
55
- 2.11.0-SNAPSHOT
66
jdk:
@@ -9,3 +9,6 @@ jdk:
99
notifications:
1010
email:
1111
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: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
import DependencyKeys.scalaXmlVersion
1+
import VersionKeys._
2+
23

34
organization := "org.scala-lang.modules"
45

56
name := "scala-partest"
67

78
version := "1.0.0-SNAPSHOT"
89

9-
// TODO: bump to 1.0.0-RC5 as soon as it's out
10+
scalaVersion := "2.11.0-M6"
11+
12+
snapshotScalaBinaryVersion := "2.11.0-M6"
13+
1014
scalaXmlVersion := "1.0.0-RC6"
1115

16+
scalaCheckVersion := "1.10.1"
17+
18+
// DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW)
19+
20+
scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value)
21+
1222
// so we don't have to wait for sonatype to synch to maven central when deploying a new module
1323
resolvers += Resolver.sonatypeRepo("releases")
1424

@@ -22,11 +32,8 @@ libraryDependencies += "com.googlecode.java-diff-utils" % "diffutils" % "1.
2232

2333
libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"
2434

25-
// mark as intransitive because 1.10.1 released against Scala 2.11.0-M6 has wrong dependencies
26-
// once we upgrade to M7 the intransitive bit can be dropped
27-
// however, provided should stay; if one wants to run scalacheck tests it should depend on
28-
// scalacheck explicitly
29-
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.10.1" % "provided" intransitive()
35+
// to run scalacheck tests, depend on scalacheck separately
36+
libraryDependencies += "org.scalacheck" %% "scalacheck" % scalaCheckVersion.value % "provided"
3037

3138
// mark all scala dependencies as provided which means one has to explicitly provide them when depending on partest
3239
// this allows for easy testing of modules (like scala-xml) that provide tested classes themselves and shouldn't
@@ -39,16 +46,9 @@ libraryDependencies += "org.scala-lang" % "scala-reflect" % sca
3946

4047
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided" intransitive()
4148

42-
// standard stuff follows:
43-
scalaVersion := "2.11.0-M6"
44-
45-
// NOTE: not necessarily equal to scalaVersion
46-
// (e.g., during PR validation, we override scalaVersion to validate,
47-
// but don't rebuild scalacheck, so we don't want to rewire that dependency)
48-
scalaBinaryVersion := "2.11.0-M6"
49-
5049
// don't use for doc scope, scaladoc warnings are not to be reckoned with
51-
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint")
50+
// "-Xfatal-warnings",
51+
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")
5252

5353

5454
// Generate $name.properties to store our version as well as the scala version used to build

project/keys.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
object DependencyKeys {
1+
object VersionKeys {
22
import sbt.settingKey
33

44
// To facilitate scripted build of all modules (while we're working on getting dbuild up and running)
55
val scalaXmlVersion = settingKey[String]("Version to use for the scala-xml dependency.")
6+
val scalaCheckVersion = settingKey[String]("Version to use for the scalacheck dependency.")
7+
8+
val snapshotScalaBinaryVersion = settingKey[String]("The Scala binary version to use when building against Scala SNAPSHOT.")
9+
10+
def deriveBinaryVersion(sv: String, snapshotScalaBinaryVersion: String) = sv match {
11+
case snap_211 if snap_211.startsWith("2.11") &&
12+
snap_211.contains("-SNAPSHOT") => snapshotScalaBinaryVersion
13+
case sv => sbt.CrossVersion.binaryScalaVersion(sv)
14+
}
615
}

0 commit comments

Comments
 (0)