@@ -7,6 +7,7 @@ import com.typesafe.sbt.osgi.SbtOsgi._
7
7
import com .typesafe .sbt .SbtPgp ._
8
8
import org .scalajs .sbtplugin .ScalaJSPlugin
9
9
import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
10
+ import dotty .tools .sbtplugin .DottyPlugin .autoImport ._
10
11
11
12
object ScalatestBuild extends Build {
12
13
@@ -19,7 +20,7 @@ object ScalatestBuild extends Build {
19
20
20
21
// To temporarily switch sbt to a different Scala version:
21
22
// > ++ 2.10.5
22
- val buildScalaVersion = " 2.11.8 "
23
+ val buildScalaVersion = " 2.12.3 "
23
24
24
25
val releaseVersion = " 3.0.1"
25
26
@@ -80,7 +81,7 @@ object ScalatestBuild extends Build {
80
81
def sharedSettings : Seq [Setting [_]] = Seq (
81
82
javaHome := getJavaHome,
82
83
scalaVersion := buildScalaVersion,
83
- crossScalaVersions := Seq (buildScalaVersion, " 2.10.6" , " 2.12.0 " ),
84
+ crossScalaVersions := Seq (" 2.10.6" , " 2.11.8 " , buildScalaVersion ),
84
85
version := releaseVersion,
85
86
scalacOptions ++= Seq (" -feature" , " -target:jvm-1.6" ),
86
87
resolvers += " Sonatype Public" at " https://oss.sonatype.org/content/groups/public" ,
@@ -152,8 +153,10 @@ object ScalatestBuild extends Build {
152
153
def scalacheckDependency (config : String ) =
153
154
" org.scalacheck" %% " scalacheck" % scalacheckVersion % config
154
155
155
- def crossBuildLibraryDependencies (theScalaVersion : String ) =
156
- CrossVersion .partialVersion(theScalaVersion) match {
156
+ def crossBuildLibraryDependencies (theScalaVersion : String ) = {
157
+ val isDotty = theScalaVersion.startsWith(" 0." )
158
+ val version = if (isDotty) " 2.12.3" else theScalaVersion
159
+ CrossVersion .partialVersion(version) match {
157
160
// if scala 2.11+ is used, add dependency on scala-xml module
158
161
case Some ((2 , scalaMajor)) if scalaMajor >= 11 =>
159
162
Seq (
@@ -164,12 +167,16 @@ object ScalatestBuild extends Build {
164
167
case _ =>
165
168
Seq (scalacheckDependency(" optional" ))
166
169
}
170
+ }
167
171
168
- def scalaLibraries (theScalaVersion : String ) =
172
+ def scalaLibraries (theScalaVersion : String ) = {
173
+ val isDotty = theScalaVersion.startsWith(" 0." )
174
+ val version = if (isDotty) " 2.12.3" else theScalaVersion
169
175
Seq (
170
- " org.scala-lang" % " scala-compiler" % theScalaVersion % " provided" ,
171
- " org.scala-lang" % " scala-reflect" % theScalaVersion // this is needed to compile macro
176
+ " org.scala-lang" % " scala-compiler" % version % " provided" ,
177
+ " org.scala-lang" % " scala-reflect" % version // this is needed to compile macro
172
178
)
179
+ }
173
180
174
181
def scalatestLibraryDependencies =
175
182
Seq (
@@ -290,6 +297,7 @@ object ScalatestBuild extends Build {
290
297
publish := {},
291
298
publishLocal := {}
292
299
)
300
+ .settings(dottySettings)
293
301
294
302
lazy val scalacticMacroJS = Project (" scalacticMacroJS" , file(" scalactic-macro.js" ))
295
303
.settings(sharedSettings : _* )
@@ -349,6 +357,7 @@ object ScalatestBuild extends Build {
349
357
" Bundle-Vendor" -> " Artima, Inc."
350
358
)
351
359
).dependsOn(scalacticMacro % " compile-internal, test-internal" ) // avoid dependency in pom on non-existent scalactic-macro artifact, per discussion in http://grokbase.com/t/gg/simple-build-tool/133shekp07/sbt-avoid-dependence-in-a-macro-based-project
360
+ .settings(dottySettings)
352
361
353
362
lazy val scalacticJS = Project (" scalacticJS" , file(" scalactic.js" ))
354
363
.settings(sharedSettings : _* )
@@ -527,6 +536,7 @@ object ScalatestBuild extends Build {
527
536
" Main-Class" -> " org.scalatest.tools.Runner"
528
537
)
529
538
).dependsOn(scalacticMacro % " compile-internal, test-internal" , scalactic)
539
+ .settings(dottySettings)
530
540
531
541
lazy val scalatestTest = Project (" scalatest-test" , file(" scalatest-test" ))
532
542
.settings(sharedSettings : _* )
@@ -1435,8 +1445,16 @@ object ScalatestBuild extends Build {
1435
1445
doc in Compile := docTask((doc in Compile ).value,
1436
1446
(sourceManaged in Compile ).value,
1437
1447
name.value)
1448
+
1449
+ lazy val dottySettings = List (
1450
+ scalaVersion := " 0.4.0-bin-SNAPSHOT" ,
1451
+ // scalaVersion := dottyLatestNightlyBuild.get,
1452
+ libraryDependencies := libraryDependencies.value.map(_.withDottyCompat()),
1453
+ scalacOptions := List (" -language:Scala2" )
1454
+ )
1438
1455
}
1439
1456
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
1440
1457
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
1441
1458
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
1442
1459
// set scalacOptions in (Compile, console) += "-nowarn"
1460
+
0 commit comments