Skip to content

Integrate 2.13.x branch into master #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: scala

scala:
# note that 2.13 is on the 2.13.x branch instead
- 2.11.12
- 2.13.0
- 2.12.8
- 2.11.12

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ as the collection can (in some cases) be built in parallel.

Because the wrappers are invoked based on the static type of the collection, there are also cases where parallelization
is inefficient when interfacing with Java 8 Streams (e.g. when a collection is typed as `Seq[String]` so might have linear
access like `List`, but actually is a `WrappedArray[String]` that can be efficiently parallelized) but can be efficient
access like `List`, but actually is a `WrappedArray[String]` (`ArraySeq` on 2.13) that can be efficiently parallelized) but can be efficient
with Scala parallel collections. The `parStream` method is only available when the static type is known to be compatible
with rapid parallel operation; `seqStream` can be parallelized by using `.parallel`, but may or may not be efficient.

Expand Down
26 changes: 22 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import ScalaModulePlugin._

// no 2.13 for now in cross-build because of
// https://github.com/scala/scala-java8-compat/issues/97
crossScalaVersions in ThisBuild := List("2.12.8", "2.11.12")
crossScalaVersions in ThisBuild := List("2.13.0", "2.12.8", "2.11.12")

val disableDocs =
sys.props("nodocs") == "true" ||
Expand All @@ -28,7 +26,27 @@ lazy val commonSettings = Seq(
organization := "org.scala-lang.modules",
version := "0.9.1-SNAPSHOT",

scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked")
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked"),

unmanagedSourceDirectories in Compile ++= {
(unmanagedSourceDirectories in Compile).value.flatMap { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
case _ => Seq(file(dir.getPath ++ "-2.13-"))
}
}
},

unmanagedSourceDirectories in Test ++= {
(unmanagedSourceDirectories in Test).value.flatMap { dir =>
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq(file(dir.getPath ++ "-2.13+"))
case Some((2, 11)) => Seq(file(dir.getPath ++ "-2.13-"), file(dir.getPath ++ "-2.11"))
case _ => Seq(file(dir.getPath ++ "-2.13-"))
}
}
},
)

lazy val fnGen = (project in file("fnGen")).
Expand Down
4 changes: 2 additions & 2 deletions fnGen/WrapFnGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ object WrapFnGen {
numberedA ++= scalaTargs.map(_.toString).collect{ case An(digits) if (digits.length < 10) => digits.toInt }
val scalafnTnames = (jfn.pTypes :+ jfn.rType).zipWithIndex.map{
case (pt, i) if (i < jfn.pTypes.length && pt.isFinalType) || (!pt.isFinalType && jfn.pTypes.take(i).exists(_ == pt)) =>
val j = Iterator.from(i).dropWhile(numberedA).next
val j = Iterator.from(i).dropWhile(numberedA).next()
val genericName = TypeName(s"A$j")
numberedA += j
evidences += ((genericName, pt.typeSymbol.name.toTypeName))
Expand Down Expand Up @@ -309,6 +309,6 @@ object WrapFnGen {

def main(args: Array[String]): Unit = {
val names = args.iterator.map(x => new java.io.File(x))
write(names.next, converterContents)
write(names.next(), converterContents)
}
}
4 changes: 2 additions & 2 deletions project/CodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ object CodeGen {

val specialized =
List("V", "V,IJFD", "V,IJD,IJD").flatMap(specialize).map { case (i, a, sp) =>
s" public static scala.Function$i<$a> procSpecialized(JFunction$i$sp f) { return f; }" } ++
s" public static scala.Function$i<$a> procSpecialized(JFunction$i$sp f) { return (scala.Function$i<$a>)(Object)f; }" } ++
List("BSIJCFDZ", "ZIFJD,IJFD", "ZIFJD,IJD,IJD").flatMap(specialize).map { case (i, a, sp) =>
s" public static scala.Function$i<$a> funcSpecialized(JFunction$i$sp f) { return f; }" }
s" public static scala.Function$i<$a> funcSpecialized(JFunction$i$sp f) { return (scala.Function$i<$a>)(Object)f; }" }

(blocks.map(_._1) ++ blocks.map(_._2)) :+
( "JFunction",
Expand Down
Loading