Skip to content

Scala 2.13 support #69

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: scala
scala:
- 2.11.8
- 2.12.1
- 2.11.12
- 2.12.10
- 2.13.1

sudo: false

Expand All @@ -20,9 +21,5 @@ before_cache:
- find $HOME/.sbt -name "*.lock" -delete

jdk:
- oraclejdk8
- openjdk8

addons:
apt:
packages:
- oracle-java8-installer
28 changes: 17 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ sonatypeProfileName := "org.xerial"

import ReleaseTransformations._

val SCALA_VERSION = "2.12.4"
val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.11")
val SCALA_VERSION = "2.13.1"
val CROSS_SCALA_VERSIONS = Seq(SCALA_VERSION, "2.11.12", "2.12.10")
scalaVersion in ThisBuild := SCALA_VERSION

val buildSettings = Defaults.coreDefaultSettings ++ Seq(
Expand Down Expand Up @@ -116,15 +116,13 @@ lazy val larrayScala = Project(
},
libraryDependencies ++= Seq(
// Add dependent jars here
"org.wvlet" %% "wvlet-log" % "1.1",
"org.wvlet.airframe" %% "airframe-log" % "19.9.8",
snappy % "test",
junit,
"org.iq80.snappy" % "snappy" % "0.3" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
"com.typesafe.akka" %% "akka-testkit" % "[2.3.14, 2.5)" % "test",
"com.typesafe.akka" %% "akka-multi-node-testkit" % "[2.3.14, 2.5)" % "test"
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.0" % "test"
)
)
) dependsOn(larrayBuffer % scope, larrayMMap) configs (MultiJvm)
Expand All @@ -136,10 +134,18 @@ lazy val larrayBuffer = Project(
description := "LArray off-heap buffer library",
crossPaths := false,
autoScalaLibrary := false,
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.wvlet" %% "wvlet-log" % "1.1" % "test"
)
libraryDependencies ++= {
val parallelCollections = CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, major)) if major >= 13 =>
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0" % "test")
case _ =>
Seq()
}
Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"org.wvlet.airframe" %% "airframe-log" % "19.9.8"
) ++ parallelCollections
}
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class LBufferTest extends LArraySpec {
"allocate concurrently" taggedAs("bench") in {

val N = 100
def range = (0 until N).par

def range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val R = 2
val S = 1024 * 1024

Expand Down Expand Up @@ -206,4 +207,4 @@ class LBufferTest extends LArraySpec {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class MemoryAllocatorTest extends LArraySpec {

val t = time("alloc", repeat = 5) {
block("concurrent") {
val l = for (i <- (0 until N).par) yield {
val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val l = for (i <- range) yield {
val a = new LBuffer(B)
a(B-1) = 1.toByte
a
Expand All @@ -46,7 +47,8 @@ class MemoryAllocatorTest extends LArraySpec {
}

block("Array") {
val l = for (i <- (0 until N).par) yield {
val range = collection.parallel.immutable.ParRange(0, N, 1, inclusive = false)
val l = for (i <- range) yield {
val a = new Array[Int](B)
a(B-1) = 1
a
Expand All @@ -56,4 +58,4 @@ class MemoryAllocatorTest extends LArraySpec {
t("concurrent") should be <= (t("Array"))
}
}
}
}
4 changes: 2 additions & 2 deletions larray/src/main/scala/xerial/larray/LArrayBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ trait LBuilder[Elem, +To] extends WritableByteChannel {
* @param xs the TraversableOnce producing the elements to add.
* @return the coll itself.
*/
def ++=(xs: TraversableOnce[Elem]): this.type = {xs.seq foreach +=; this}
def ++=(xs: TraversableOnce[Elem]): this.type = {xs.toSeq.foreach( += ); this}

def ++=(xs: LIterator[Elem]): this.type = {xs foreach +=; this}

Expand Down Expand Up @@ -426,4 +426,4 @@ object LArrayBuilder {
}
}

}
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.18