Skip to content

Commit 3af39b6

Browse files
authored
Switch to scala 2.13.0-RC1 (#220)
Switch to scala 2.13.0-RC1
2 parents 11b516f + db82c03 commit 3af39b6

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ matrix:
88
- env: CMD="mill __.jvm[2.12.7].test"
99
jdk: oraclejdk9
1010

11-
- env: CMD="mill __.jvm[2.13.0-M5].test"
11+
- env: CMD="mill __.jvm[2.13.0-RC1].test"
1212
jdk: openjdk10
1313

1414
- env: CMD="mill __.js[2.11.12].test"
@@ -17,15 +17,15 @@ matrix:
1717
- env: CMD="mill __.js[2.12.7].test"
1818
jdk: openjdk10
1919

20-
- env: CMD="mill __.js[2.13.0-M5].test"
20+
- env: CMD="mill __.js[2.13.0-RC1].test"
2121
jdk: openjdk10
2222

2323
- env: CMD="mill all demo.fastOpt perftests.__.compile"
2424
jdk: openjdk10
2525

26-
- env: CMD="sbt readme/run"
26+
- env: CMD="mill demo.fullOpt && sbt readme/run"
2727
jdk: oraclejdk8
2828

2929
script:
30-
- curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.3.4/0.3.4 && chmod +x ~/bin/mill
30+
- curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.3.6/0.3.6-85-38fce6 && chmod +x ~/bin/mill
3131
- $CMD

build.sc

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scalalib._
33
import scalajslib._
44
import publish._
55

6-
val crossVersions = Seq("2.11.12", "2.12.7", "2.13.0-M5")
6+
val crossVersions = Seq("2.11.12", "2.12.7", "2.13.0-RC1")
77
object fastparse extends Module{
88
object jvm extends Cross[fastparseJvmModule](crossVersions:_*)
99
class fastparseJvmModule(val crossScalaVersion: String) extends FastparseModule{
@@ -27,15 +27,15 @@ object fastparse extends Module{
2727
object js extends Cross[fastparseJsModule](crossVersions:_*)
2828
class fastparseJsModule(val crossScalaVersion: String) extends FastparseModule with ScalaJSModule {
2929
def platformSegment = "js"
30-
def scalaJSVersion = "0.6.25"
30+
def scalaJSVersion = "0.6.27"
3131
object test extends Tests with CommonTestModule{
3232
def platformSegment = "js"
3333
}
3434
}
3535
}
3636
trait FastparseModule extends CommonCrossModule{
3737
def ivyDeps = Agg(
38-
ivy"com.lihaoyi::sourcecode::0.1.5",
38+
ivy"com.lihaoyi::sourcecode::0.1.6",
3939
)
4040
def compileIvyDeps = Agg(
4141
ivy"org.scala-lang:scala-reflect:${scalaVersion()}"
@@ -69,6 +69,7 @@ trait FastparseModule extends CommonCrossModule{
6969
implicit def Sequencer1[T1, T2]: Sequencer[T1, T2, (T1, T2)] = Sequencer0{case (t1, t2) => (t1, t2)}
7070
}
7171
""".stripMargin
72+
file.toIO.getParentFile.mkdirs()
7273
ammonite.ops.write(file, output)
7374
Seq(PathRef(file))
7475
}
@@ -100,7 +101,7 @@ object pythonparse extends Module{
100101

101102
trait ExampleParseJsModule extends CommonCrossModule with ScalaJSModule{
102103
def moduleDeps = Seq(fastparse.js())
103-
def scalaJSVersion = "0.6.25"
104+
def scalaJSVersion = "0.6.27"
104105
def platformSegment = "js"
105106
object test extends Tests with CommonTestModule{
106107
def platformSegment = "js"
@@ -120,7 +121,35 @@ trait ExampleParseJvmModule extends CommonCrossModule{
120121
}
121122
}
122123

124+
125+
// Remove once mill has proper support for 2.13.0-RC1
126+
object CustomZincWorker extends mill.scalalib.ZincWorkerModule {
127+
def scalaCompilerBridgeSourceJar(scalaVersion: String, scalaOrganization: String) = {
128+
val (scalaVersion0, scalaBinaryVersion0, bridgeVersion) = scalaVersion match {
129+
case s if s.startsWith("2.13.") => ("2.13.0-M2", "2.13.0-M2", "1.2.5")
130+
case _ => (scalaVersion, mill.scalalib.api.Util.scalaBinaryVersion(scalaVersion), Versions.zinc)
131+
}
132+
133+
val (bridgeDep, bridgeName) = {
134+
val org = "org.scala-sbt"
135+
val name = "compiler-bridge"
136+
(ivy"$org::$name:$bridgeVersion", s"${name}_$scalaBinaryVersion0")
137+
}
138+
139+
mill.scalalib.Lib.resolveDependencies(
140+
repositories,
141+
Lib.depToDependency(_, scalaVersion0, ""),
142+
Seq(bridgeDep),
143+
sources = true
144+
).map(deps =>
145+
mill.scalalib.api.Util.grepJar(deps.map(_.path), bridgeName, bridgeVersion, sources = true)
146+
)
147+
}
148+
}
149+
123150
trait CommonCrossModule extends CrossScalaModule with PublishModule{
151+
def zincWorker: ZincWorkerModule =
152+
CustomZincWorker
124153

125154
def publishVersion = "2.1.0"
126155
def artifactName = millModuleSegments.parts.dropRight(2).mkString("-")
@@ -151,9 +180,12 @@ trait CommonCrossModule extends CrossScalaModule with PublishModule{
151180

152181
}
153182
trait CommonTestModule extends ScalaModule with TestModule{
183+
def zincWorker: ZincWorkerModule =
184+
CustomZincWorker
185+
154186
def platformSegment: String
155187
def ivyDeps = Agg(
156-
ivy"com.lihaoyi::utest::0.6.6",
188+
ivy"com.lihaoyi::utest::0.6.7",
157189
)
158190

159191
// def scalacOptions = T{ if (scalaVersion() == "2.12.7") Seq("-opt:l:method") else Nil }
@@ -214,14 +246,14 @@ object perftests extends Module{
214246
}
215247
def testFrameworks = Seq("utest.runner.Framework")
216248
def ivyDeps = Agg(
217-
ivy"com.lihaoyi::utest::0.6.6",
249+
ivy"com.lihaoyi::utest::0.6.7",
218250
ivy"org.scala-lang:scala-compiler:${scalaVersion()}"
219251
)
220252
}
221253
}
222254

223255
object demo extends ScalaJSModule{
224-
def scalaJSVersion = "0.6.25"
256+
def scalaJSVersion = "0.6.27"
225257
def scalaVersion = "2.12.7"
226258
def moduleDeps = Seq(
227259
scalaparse.js("2.12.7"),

fastparse/test/src/fastparse/ExampleTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ object ExampleTests extends TestSuite{
487487

488488
parse("(1+(2+3x))+4", Foo.expr(_))
489489

490-
val expected = """
490+
val expected = Predef.augmentString("""
491491
+expr:1:1, cut
492492
+side:1:1, cut
493493
+expr:1:2, cut
@@ -504,7 +504,7 @@ object ExampleTests extends TestSuite{
504504
-expr:1:2:Failure(expr:1:2 / side:1:4 / ")":1:8 ..."1+(2+3x))+", cut)
505505
-side:1:1:Failure(side:1:1 / expr:1:2 / side:1:4 / ")":1:8 ..."(1+(2+3x))", cut)
506506
-expr:1:1:Failure(expr:1:1 / side:1:1 / expr:1:2 / side:1:4 / ")":1:8 ..."(1+(2+3x))", cut)
507-
""".linesIterator.filter(_.trim != "").toSeq
507+
""").lines.filter(_.trim != "").toSeq
508508
val minIndent = expected.map(_.takeWhile(_ == ' ').length).min
509509
val expectedString = expected.map(_.drop(minIndent)).mkString("\n")
510510
val capturedString = captured.mkString("\n")

0 commit comments

Comments
 (0)