Skip to content

Commit 5f55e98

Browse files
committed
Setup Dotty build
1 parent 6e03d4d commit 5f55e98

File tree

4 files changed

+31
-90
lines changed

4 files changed

+31
-90
lines changed

.travis.yml

Lines changed: 3 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,5 @@
11
language: scala
2-
scala:
3-
- 2.11.8
4-
- 2.10.6
5-
- 2.12.0
2+
script:
3+
- sbt scalatest/compile "last scalatest/compile"
64
jdk:
7-
- oraclejdk7
8-
- openjdk6
9-
- oraclejdk8
10-
11-
sudo: false
12-
13-
env:
14-
#see https://github.com/scalatest/scalatest/pull/245
15-
#global values should be replaced using http://docs.travis-ci.com/user/encryption-keys/ with valid values
16-
global:
17-
- SCALATEST_NEXUS_LOGIN=tbd
18-
- SCALATEST_NEXUS_PASSWORD=tbd
19-
- SCALATEST_GPG_FILE=tbd
20-
- SCALATEST_GPG_PASSPHASE=tbd
21-
22-
matrix:
23-
- MODE=RegularTests1
24-
- MODE=RegularTests2
25-
- MODE=RegularTests3
26-
- MODE=RegularTests4
27-
- MODE=RegularTests5
28-
- MODE=ScalacticTests
29-
- MODE=genMustMatchersTests1
30-
- MODE=genMustMatchersTests2
31-
- MODE=genMustMatchersTests3
32-
- MODE=genMustMatchersTests4
33-
- MODE=genGenTests
34-
- MODE=genTablesTests
35-
- MODE=genInspectorsTests
36-
- MODE=genInspectorsShorthandsTests1
37-
- MODE=genInspectorsShorthandsTests2
38-
- MODE=genTheyTests
39-
- MODE=genContainTests1
40-
- MODE=genContainTests2
41-
- MODE=genSortedTests
42-
- MODE=genLoneElementTests
43-
- MODE=genEmptyTests
44-
- MODE=examples
45-
- MODE=examplesJS
46-
47-
matrix:
48-
exclude:
49-
- scala: "2.12.0"
50-
jdk: oraclejdk7
51-
- scala: "2.12.0"
52-
jdk: openjdk6
53-
54-
branches:
55-
only:
56-
- 3.0.x
57-
58-
#before_script: ./travis_build.sh Compile
59-
script: ./travis_build.sh $MODE
60-
61-
notifications:
62-
email:
63-
64-
65-
66-
cache:
67-
directories:
68-
- $HOME/.ivy2
69-
70-
#after_success:
71-
# # only 'scalatest/scalatest' 'master' branch is published from the first node
72-
# - |
73-
# echo "Succeded on: ${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}"
74-
# if [ "${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}" = "scalatest/scalatest/master" ]; then
75-
# # temporary for convinience taken outside, todo: grab in repo, also some of steps may be hidden in inside of travis_build
76-
# curl -o travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py
77-
# python travis_after_all.py
78-
# export $(cat .to_export_back)
79-
# if [ "$BUILD_LEADER" = "YES" ]; then
80-
# if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then
81-
# ./travis_build.sh Publish
82-
# fi
83-
# fi
84-
# fi
5+
- oraclejdk8

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.13
1+
sbt.version=0.13.15

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")
33
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.7.0")
44

55
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.17")
6+
7+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.1.5")

project/scalatest.scala

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.typesafe.sbt.osgi.SbtOsgi._
77
import com.typesafe.sbt.SbtPgp._
88
import org.scalajs.sbtplugin.ScalaJSPlugin
99
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
10+
import dotty.tools.sbtplugin.DottyPlugin.autoImport._
1011

1112
object ScalatestBuild extends Build {
1213

@@ -19,7 +20,7 @@ object ScalatestBuild extends Build {
1920

2021
// To temporarily switch sbt to a different Scala version:
2122
// > ++ 2.10.5
22-
val buildScalaVersion = "2.11.8"
23+
val buildScalaVersion = "2.12.3"
2324

2425
val releaseVersion = "3.0.1"
2526

@@ -80,7 +81,7 @@ object ScalatestBuild extends Build {
8081
def sharedSettings: Seq[Setting[_]] = Seq(
8182
javaHome := getJavaHome,
8283
scalaVersion := buildScalaVersion,
83-
crossScalaVersions := Seq(buildScalaVersion, "2.10.6", "2.12.0"),
84+
crossScalaVersions := Seq("2.10.6", "2.11.8", buildScalaVersion),
8485
version := releaseVersion,
8586
scalacOptions ++= Seq("-feature", "-target:jvm-1.6"),
8687
resolvers += "Sonatype Public" at "https://oss.sonatype.org/content/groups/public",
@@ -152,8 +153,10 @@ object ScalatestBuild extends Build {
152153
def scalacheckDependency(config: String) =
153154
"org.scalacheck" %% "scalacheck" % scalacheckVersion % config
154155

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 {
157160
// if scala 2.11+ is used, add dependency on scala-xml module
158161
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
159162
Seq(
@@ -164,12 +167,16 @@ object ScalatestBuild extends Build {
164167
case _ =>
165168
Seq(scalacheckDependency("optional"))
166169
}
170+
}
167171

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
169175
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
172178
)
179+
}
173180

174181
def scalatestLibraryDependencies =
175182
Seq(
@@ -290,6 +297,7 @@ object ScalatestBuild extends Build {
290297
publish := {},
291298
publishLocal := {}
292299
)
300+
.settings(dottySettings)
293301

294302
lazy val scalacticMacroJS = Project("scalacticMacroJS", file("scalactic-macro.js"))
295303
.settings(sharedSettings: _*)
@@ -349,6 +357,7 @@ object ScalatestBuild extends Build {
349357
"Bundle-Vendor" -> "Artima, Inc."
350358
)
351359
).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)
352361

353362
lazy val scalacticJS = Project("scalacticJS", file("scalactic.js"))
354363
.settings(sharedSettings: _*)
@@ -527,6 +536,7 @@ object ScalatestBuild extends Build {
527536
"Main-Class" -> "org.scalatest.tools.Runner"
528537
)
529538
).dependsOn(scalacticMacro % "compile-internal, test-internal", scalactic)
539+
.settings(dottySettings)
530540

531541
lazy val scalatestTest = Project("scalatest-test", file("scalatest-test"))
532542
.settings(sharedSettings: _*)
@@ -1435,8 +1445,16 @@ object ScalatestBuild extends Build {
14351445
doc in Compile := docTask((doc in Compile).value,
14361446
(sourceManaged in Compile).value,
14371447
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+
)
14381455
}
14391456
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
14401457
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
14411458
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
14421459
// set scalacOptions in (Compile, console) += "-nowarn"
1460+

0 commit comments

Comments
 (0)