From f8a5b0048bd08a3bdcdffd1395954e0e92ee753b Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 1 May 2018 13:05:04 +0200 Subject: drop support for Scala 2.11 as of 0.10.0 also upgrade Scala 2.12.4 -> 2.12.6 --- .travis.yml | 1 + README.md | 12 +++++----- admin/README.md | 1 - build.sbt | 9 +++----- .../scala/async/internal/TransformUtils.scala | 17 ++++++-------- .../run/uncheckedBounds/UncheckedBoundsSpec.scala | 26 ++-------------------- 6 files changed, 20 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a95e00..acc16cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,3 +15,4 @@ jdk: notifications: email: - jason.zaugg@lightbend.com + - seth.tisue@lightbend.com diff --git a/README.md b/README.md index 1e00844..4be9ace 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ -# scala-async [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.11) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) +# scala-async [[](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) ## Supported Scala versions -This branch targets Scala 2.11, 2.12, and 2.13. +This branch targets Scala 2.12 and 2.13. -Support for Scala 2.10 is [on a branch](https://github.com/scala/async/tree/2.10.x). +Support for Scala 2.11 is [on a branch](https://github.com/scala/scala-async/tree/2.11.x). + +Support for Scala 2.10 is [on a branch](https://github.com/scala/scala-async/tree/2.10.x). ## Quick start @@ -12,7 +14,7 @@ To include scala-async in an existing project use the library published on Maven For sbt projects add the following to your build definition - build.sbt or project/Build.scala: ```scala -libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.9.7" +libraryDependencies += "org.scala-lang.modules" %% "scala-async" % "0.10.0" ``` For Maven projects add the following to your (make sure to use the correct Scala version suffix @@ -22,7 +24,7 @@ to match your project’s Scala binary version): org.scala-lang.modules scala-async_2.12 - 0.9.7 + 0.10.0 ``` diff --git a/admin/README.md b/admin/README.md index 46626b4..cdbfc44 100644 --- a/admin/README.md +++ b/admin/README.md @@ -40,7 +40,6 @@ env: script: admin/build.sh jdk: - - openjdk6 - oraclejdk8 notifications: diff --git a/build.sbt b/build.sbt index c5606bd..9d4c9ed 100644 --- a/build.sbt +++ b/build.sbt @@ -3,14 +3,11 @@ import ScalaModulePlugin._ scalaModuleSettings scalaVersionsByJvm in ThisBuild := { - val v211 = "2.11.12" - val v212 = "2.12.4" + val v212 = "2.12.6" val v213 = "2.13.0-M3" - Map( - 7 -> List(v211 -> false), - 8 -> List(v212 -> true, v213 -> true, v211 -> true), - 9 -> List(v212 -> false, v213 -> false, v211 -> false)) + 8 -> List(v212 -> true, v213 -> true), + 9 -> List(v212 -> false, v213 -> false)) } name := "scala-async" diff --git a/src/main/scala/scala/async/internal/TransformUtils.scala b/src/main/scala/scala/async/internal/TransformUtils.scala index 016ffc1..be56bb7 100644 --- a/src/main/scala/scala/async/internal/TransformUtils.scala +++ b/src/main/scala/scala/async/internal/TransformUtils.scala @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Lightbend Inc. + * Copyright (C) 2012-2018 Lightbend Inc. */ package scala.async.internal @@ -406,15 +406,12 @@ private[async] trait TransformUtils { } // ===================================== - // Copy/Pasted from Scala 2.10.3. See SI-7694. - private lazy val UncheckedBoundsClass = { - try c.mirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds") - catch { case _: ScalaReflectionException => NoSymbol } - } - final def uncheckedBounds(tp: Type): Type = { - if ((tp.typeArgs.isEmpty && (tp match { case _: TypeRef => true; case _ => false}))|| UncheckedBoundsClass == NoSymbol) tp + // Copy/Pasted from Scala 2.10.3. See scala/bug#7694 + private lazy val UncheckedBoundsClass = + c.mirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds") + final def uncheckedBounds(tp: Type): Type = + if ((tp.typeArgs.isEmpty && (tp match { case _: TypeRef => true; case _ => false}))) tp else withAnnotation(tp, Annotation(UncheckedBoundsClass.asType.toType, Nil, ListMap())) - } // ===================================== /** @@ -608,4 +605,4 @@ private[async] trait TransformUtils { } case object ContainsAwait -case object NoAwait \ No newline at end of file +case object NoAwait diff --git a/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala b/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala index 5eb1f32..e728242 100644 --- a/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala +++ b/src/test/scala/scala/async/run/uncheckedBounds/UncheckedBoundsSpec.scala @@ -7,8 +7,7 @@ import scala.async.TreeInterrogation class UncheckedBoundsSpec { @Test def insufficientLub_SI_7694() { - suppressingFailureBefore2_10_3 { - eval( s""" + eval( s""" object Test { import _root_.scala.async.run.toughtype._ import _root_.scala.async.internal.AsyncId.{async, await} @@ -17,12 +16,10 @@ class UncheckedBoundsSpec { } } """, compileOptions = s"-cp ${toolboxClasspath} ") - } } @Test def insufficientLub_SI_7694_ScalaConcurrent() { - suppressingFailureBefore2_10_3 { - eval( s""" + eval( s""" object Test { import _root_.scala.async.run.toughtype._ import _root_.scala.async.Async.{async, await} @@ -33,25 +30,6 @@ class UncheckedBoundsSpec { } } """, compileOptions = s"-cp ${toolboxClasspath} ") - } } - private def suppressingFailureBefore2_10_3(body: => Any) { - try { - body - } catch { - case x: Throwable => - // @uncheckedBounds was only introduced in 2.10.3/ 2.11.0-M5, so avoid reporting this test failure in those cases. - scala.util.Properties.versionNumberString match { - case "2.10.0" | "2.10.1" | "2.10.2" | "2.11.0-M4" => // ignore, the @uncheckedBounds doesn't exist yet - case _ => - val annotationExists = - reflect.runtime.currentMirror.staticClass("scala.reflect.internal.annotations.uncheckedBounds") == reflect.runtime.universe.NoSymbol - if (annotationExists) - Assert.fail("@uncheckedBounds not found in scala-reflect.jar") - else - Assert.fail(s"@uncheckedBounds exists, but it didn't prevent this failure: $x") - } - } - } } -- cgit v1.2.3