Skip to content

Commit 80a4abc

Browse files
committed
Setup Dotty build
1 parent ab0ad7f commit 80a4abc

File tree

4 files changed

+25
-100
lines changed

4 files changed

+25
-100
lines changed

.travis.yml

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

project/build.properties

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

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ addSbtPlugin("org.scala-native" % "sbt-scalajs-crossproject" % "0.2.0")
1111
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.6")
1212

1313
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.18")
14+
15+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.1.7")

project/scalatest.scala

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object ScalatestBuild extends Build {
115115
def sharedSettings: Seq[Setting[_]] = Seq(
116116
javaHome := getJavaHome(scalaBinaryVersion.value),
117117
scalaVersion := buildScalaVersion,
118-
crossScalaVersions := Seq(buildScalaVersion, "2.10.6", "2.12.0"),
118+
crossScalaVersions := Seq("2.10.6", "2.11.8", buildScalaVersion),
119119
version := releaseVersion,
120120
scalacOptions ++= Seq("-feature", "-target:jvm-1.6"),
121121
resolvers += "Sonatype Public" at "https://oss.sonatype.org/content/groups/public",
@@ -214,11 +214,14 @@ object ScalatestBuild extends Build {
214214
}
215215
}
216216

217-
def scalaLibraries(theScalaVersion: String) =
217+
def scalaLibraries(theScalaVersion: String) = {
218+
val isDotty = theScalaVersion.startsWith("0.")
219+
val version = if (isDotty) "2.12.3" else theScalaVersion
218220
Seq(
219-
"org.scala-lang" % "scala-compiler" % theScalaVersion % "provided",
220-
"org.scala-lang" % "scala-reflect" % theScalaVersion // this is needed to compile macro
221+
"org.scala-lang" % "scala-compiler" % version % "provided",
222+
"org.scala-lang" % "scala-reflect" % version // this is needed to compile macro
221223
)
224+
}
222225

223226
def scalatestLibraryDependencies =
224227
Seq(
@@ -399,6 +402,7 @@ object ScalatestBuild extends Build {
399402
publish := {},
400403
publishLocal := {}
401404
)
405+
.settings(dottySettings)
402406

403407
lazy val deleteJsDependenciesTask = taskKey[Unit]("Delete JS_DEPENDENCIES")
404408

@@ -488,6 +492,7 @@ object ScalatestBuild extends Build {
488492
"Bundle-Vendor" -> "Artima, Inc."
489493
)
490494
).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
495+
.settings(dottySettings)
491496

492497
lazy val scalacticJS = Project("scalacticJS", file("scalactic.js"))
493498
.settings(sharedSettings: _*)
@@ -737,6 +742,7 @@ object ScalatestBuild extends Build {
737742
"Main-Class" -> "org.scalatest.tools.Runner"
738743
)
739744
).dependsOn(scalacticMacro % "compile-internal, test-internal", scalactic)
745+
.settings(dottySettings)
740746

741747
lazy val scalatestTest = Project("scalatest-test", file("scalatest-test"))
742748
.settings(sharedSettings: _*)
@@ -1938,8 +1944,18 @@ object ScalatestBuild extends Build {
19381944
doc in Compile := docTask((doc in Compile).value,
19391945
(resourceManaged in Compile).value,
19401946
name.value)
1947+
1948+
import dotty.tools.sbtplugin.DottyPlugin.autoImport._
1949+
// lazy val dottyVersion = dottyLatestNightlyBuild.get
1950+
lazy val dottyVersion = "0.8.0-bin-20180411-7b91742-NIGHTLY"
1951+
lazy val dottySettings = List(
1952+
scalaVersion := dottyVersion,
1953+
libraryDependencies := libraryDependencies.value.map(_.withDottyCompat()),
1954+
scalacOptions := List("-language:Scala2")
1955+
)
19411956
}
19421957
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
19431958
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
19441959
// set scalacOptions in (Compile, console) += "-Xlog-implicits"
19451960
// set scalacOptions in (Compile, console) += "-nowarn"
1961+

0 commit comments

Comments
 (0)