File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change
1
+ import VersionKeys .{snapshotScalaBinaryVersion ,deriveBinaryVersion }
2
+
1
3
organization := " org.scala-lang.modules"
2
4
3
5
name := " scala-parser-combinators"
@@ -6,9 +8,16 @@ version := "1.0.0-SNAPSHOT"
6
8
7
9
scalaVersion := " 2.11.0-M7"
8
10
11
+ snapshotScalaBinaryVersion := " 2.11.0-M7"
12
+
13
+ // DOUBLETHINK YOUR WAY OUT OF EDITING BELOW (THERE IS NO BELOW)
14
+
15
+ scalaBinaryVersion := deriveBinaryVersion(scalaVersion.value, snapshotScalaBinaryVersion.value)
16
+
9
17
// to allow compiling against snapshot versions of Scala
10
18
resolvers += Resolver .sonatypeRepo(" snapshots" )
11
19
20
+
12
21
libraryDependencies ++= Seq (
13
22
" junit" % " junit" % " 4.11" % " test" ,
14
23
" com.novocode" % " junit-interface" % " 0.10" % " test" )
Original file line number Diff line number Diff line change 1
- object TestKeys {
1
+ object VersionKeys {
2
2
import sbt .settingKey
3
3
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." )
6
5
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
+ }
You can’t perform that action at this time.
0 commit comments