Skip to content

Commit

Permalink
wip Scala 2.13.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Aug 21, 2018
1 parent 95adf04 commit 73e218c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
10 changes: 2 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: scala
scala:
- 2.11.12
- 2.12.6
- 2.13.0-M4

jdk:
- oraclejdk8
Expand All @@ -24,11 +25,4 @@ env:
- PUBLISH=true

script:
- sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 -Dfs2.test.verbose testJVM
- sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 -Dfs2.test.verbose testJS
- sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 doc mimaReportBinaryIssues
- (test $TRAVIS_SCALA_VERSION == "2.11.12" && sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 -J-Xms2g -J-Xmx2g docs/tut) || test $TRAVIS_SCALA_VERSION == "2.12.6"

after_success:
- test $PUBLISH == "true" && test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "series/1.0" && sbt +publish

- sbt ++$TRAVIS_SCALA_VERSION -Dfile.encoding=UTF8 -Dfs2.test.verbose coreJVM/compile
55 changes: 39 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ lazy val contributors = Seq(

lazy val commonSettings = Seq(
organization := "co.fs2",
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v >= 13 =>
Nil
case _ =>
Seq(
"-Ypartial-unification"
)
}
},
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-language:implicitConversions",
"-language:higherKinds",
"-language:existentials",
"-language:postfixOps",
"-Ypartial-unification"
) ++
(if (scalaBinaryVersion.value.startsWith("2.12"))
List(
Expand All @@ -51,13 +60,13 @@ lazy val commonSettings = Seq(
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value,
javaOptions in (Test, run) ++= Seq("-Xms64m", "-Xmx64m"),
libraryDependencies ++= Seq(
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.6"),
compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7"),
"org.typelevel" %%% "cats-core" % "1.2.0",
"org.typelevel" %%% "cats-laws" % "1.2.0" % "test",
"org.typelevel" %%% "cats-effect" % "1.0.0-RC3",
"org.typelevel" %%% "cats-effect-laws" % "1.0.0-RC3" % "test",
"org.scalatest" %%% "scalatest" % "3.0.5" % "test",
"org.scalacheck" %%% "scalacheck" % "1.13.5" % "test"
"org.scalatest" %%% "scalatest" % "3.0.6-SNAP1" % "test",
"org.scalacheck" %%% "scalacheck" % "1.14.0" % "test"
),
scmInfo := Some(ScmInfo(url("https://github.com/functional-streams-for-scala/fs2"),
"[email protected]:functional-streams-for-scala/fs2.git")),
Expand Down Expand Up @@ -220,7 +229,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
.settings(
name := "fs2-core",
sourceDirectories in (Compile, scalafmt) += baseDirectory.value / "../shared/src/main/scala",
libraryDependencies += "org.scodec" %%% "scodec-bits" % "1.1.5"
libraryDependencies += "org.scodec" %%% "scodec-bits" % "1.1.6"
)
.jsSettings(commonJsSettings: _*)

Expand All @@ -234,15 +243,7 @@ lazy val coreJVM = core.jvm
Seq(s"""scala.*;version="[$major.$minor,$major.${minor + 1})"""", "*")
},
OsgiKeys.additionalHeaders := Map("-removeheaders" -> "Include-Resource,Private-Package"),
osgiSettings,
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor >= 13 =>
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "0.1.2" % "test")
case _ =>
Seq()
}
}
osgiSettings
)
.settings(mimaSettings)
lazy val coreJS = core.js.disablePlugins(DoctestPlugin, MimaPlugin)
Expand Down Expand Up @@ -274,7 +275,18 @@ lazy val benchmarkMacros = project
.settings(noPublish)
.settings(
name := "fs2-benchmark-macros",
addCompilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.patch)),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.patch)
)
case _ =>
// if scala 2.13.0-M4 or later, macro annotations merged into scala-reflect
// https://github.com/scala/scala/pull/6606
Nil
}
},
libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value
)

Expand All @@ -289,7 +301,18 @@ lazy val benchmark = project
o.startsWith("-Xmx") || o.startsWith("-Xms")) ++ Seq("-Xms256m", "-Xmx256m")
)
.settings(
addCompilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.patch)),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.patch)
)
case _ =>
// if scala 2.13.0-M4 or later, macro annotations merged into scala-reflect
// https://github.com/scala/scala/pull/6606
Nil
}
},
libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value
)
.enablePlugins(JmhPlugin)
Expand Down
4 changes: 2 additions & 2 deletions core/jvm/src/main/scala/fs2/compress.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object compress {
if ((fin && deflater.finished) || (!fin && deflater.needsInput)) acc
else {
val count = deflater.deflate(buffer)
_deflate_collect(deflater, buffer, acc ++ buffer.iterator.take(count), fin)
_deflate_collect(deflater, buffer, acc ++ buffer.iterator.take(count).toSeq, fin)
}

/**
Expand Down Expand Up @@ -100,6 +100,6 @@ object compress {
if (inflater.finished || inflater.needsInput) acc
else {
val count = inflater.inflate(buffer)
_inflate_collect(inflater, buffer, acc ++ buffer.iterator.take(count))
_inflate_collect(inflater, buffer, acc ++ buffer.iterator.take(count).toSeq)
}
}

0 comments on commit 73e218c

Please sign in to comment.