Skip to content

Commit

Permalink
Merge pull request #152 from gourlaysama/new-collections
Browse files Browse the repository at this point in the history
Upgrade to 2.13.0-M4 and new collections
  • Loading branch information
SethTisue authored May 17, 2018
2 parents e420513 + bd43152 commit 8b02d6f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
12 changes: 10 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ScalaModulePlugin._
scalaVersionsByJvm in ThisBuild := {
val v211 = "2.11.12"
val v212 = "2.12.6"
val v213 = "2.13.0-M3"
val v213 = "2.13.0-M4"

Map(
6 -> List(v211 -> true),
Expand Down Expand Up @@ -38,7 +38,15 @@ lazy val `scala-parser-combinators` = crossProject.in(file(".")).
"Scala Parser Combinators",
"-doc-version",
version.value
)
),
unmanagedSourceDirectories in Compile ++= {
(unmanagedSourceDirectories in Compile).value.map { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => file(dir.getPath ++ "-2.13")
case _ => file(dir.getPath ++ "-2.11-2.12")
}
}
}
).
jvmSettings(
OsgiKeys.exportPackage := Seq(s"scala.util.parsing.*;version=${version.value}"),
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.23")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package scala.util.parsing.input

private[input] trait ScalaVersionSpecificPagedSeq[T] {
// Nothing for 2.11 and 2.12!
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package scala.util.parsing.input

private[input] trait ScalaVersionSpecificPagedSeq[T] { self: PagedSeq[T] =>
// Members declared in scala.collection.Seq
override def iterableFactory: collection.SeqFactory[collection.IndexedSeq] = collection.IndexedSeq

}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class PagedSeq[T: ClassTag] protected(
end: Int)
extends scala.collection.AbstractSeq[T]
with scala.collection.IndexedSeq[T]
with ScalaVersionSpecificPagedSeq[T]
{
def this(more: (Array[T], Int, Int) => Int) = this(more, new Page[T](0), 0, UndeterminedEnd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UnitTestIO {
val s = "Here is a test string"
val f = io.Source.fromBytes(s.getBytes("utf-8"))
val b = new collection.mutable.ArrayBuffer[Char]()
f.copyToBuffer(b)
b ++= f
assertEquals(new String(b.toArray), s)
}
}

0 comments on commit 8b02d6f

Please sign in to comment.