Permalink
Browse files

Updates for 2.12.0-RC2.

  • Loading branch information...
1 parent 6cbe70e commit d0a8f512ea0bff2a7d686e4644088da662048f21 @milessabin committed Oct 19, 2016
View
@@ -115,7 +115,7 @@ resolvers ++= Seq(
[ci]: https://travis-ci.org/milessabin/shapeless
-Builds are available for Scala 2.10.x, 2.11.x and for 2.12.0-M4. The main line of development for
+Builds are available for Scala 2.10.x, 2.11.x and for 2.12.0-RC2. The main line of development for
shapeless 2.3.2 is Scala 2.11.8 with Scala 2.10.x supported via the macro paradise compiler plugin.
```scala
View
@@ -21,7 +21,7 @@ lazy val scoverageSettings = Seq(
lazy val buildSettings = Seq(
organization := "com.chuusai",
scalaVersion := "2.11.8",
- crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0-M5")
+ crossScalaVersions := Seq("2.10.6", "2.11.8", "2.12.0-RC2")
)
addCommandAlias("root", ";project root")
@@ -43,7 +43,7 @@ lazy val commonSettings = Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
- //"-Xfatal-warnings",
+ "-Xfatal-warnings",
"-deprecation",
"-unchecked"
),
@@ -99,7 +99,6 @@ lazy val commonJsSettings = Seq(
val g = "https://raw.githubusercontent.com/milessabin/shapeless/" + tagOrHash
s"-P:scalajs:mapSourceURI:$a->$g/"
},
- scalaJSUseRhino in Global := false,
parallelExecution in Test := false,
coverageExcludedPackages := ".*"
)
@@ -135,7 +134,7 @@ lazy val core = crossProject.crossType(CrossTypeMixed)
.configureCross(buildInfoSetup)
.settings(osgiSettings:_*)
.settings(
- sourceGenerators in Compile <+= (sourceManaged in Compile).map(Boilerplate.gen)
+ sourceGenerators in Compile += Def.task(Boilerplate.gen((sourceManaged in Compile).value)).taskValue
)
.settings(mimaSettings:_*)
.jsSettings(commonJsSettings:_*)
@@ -159,9 +158,13 @@ lazy val scratchJS = scratch.js
lazy val runAll = TaskKey[Unit]("runAll")
-def runAllIn(config: Configuration) = {
- runAll in config <<= (discoveredMainClasses in config, runner in run, fullClasspath in config, streams) map {
- (classes, runner, cp, s) => classes.foreach(c => runner.run(c, Attributed.data(cp), Seq(), s.log))
+def runAllIn(config: Configuration): Setting[Task[Unit]] = {
+ runAll in config := {
+ val classes = (discoveredMainClasses in config).value
+ val runner0 = (runner in run).value
+ val cp = (fullClasspath in config).value
+ val s = streams.value
+ classes.foreach(c => runner0.run(c, Attributed.data(cp), Seq(), s.log))
}
}
@@ -170,6 +173,15 @@ lazy val examples = crossProject.crossType(CrossType.Pure)
.configureCross(profile)
.dependsOn(core)
.settings(moduleName := "examples")
+ .settings(
+ libraryDependencies ++= {
+ CrossVersion.partialVersion(scalaVersion.value) match {
+ case Some((2, scalaMajor)) if scalaMajor >= 11 =>
+ Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4")
+ case _ => Seq()
+ }
+ }
+ )
.settings(runAllIn(Compile))
.settings(coreSettings:_*)
.settings(noPublishSettings:_*)
@@ -213,9 +225,9 @@ lazy val publishSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
- publishTo <<= version { (v: String) =>
+ publishTo := {
val nexus = "https://oss.sonatype.org/"
- if (v.trim.endsWith("SNAPSHOT"))
+ if (scalaVersion.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
@@ -241,8 +253,8 @@ lazy val noPublishSettings = Seq(
)
lazy val mimaSettings = mimaDefaultSettings ++ Seq(
- previousArtifacts := {
- if(scalaVersion.value == "2.12.0-M5") Set()
+ mimaPreviousArtifacts := {
+ if(scalaVersion.value == "2.12.0-RC2") Set()
else {
val previousVersion = "2.3.0"
val previousSJSVersion = "0.6.7"
@@ -271,7 +283,7 @@ lazy val mimaSettings = mimaDefaultSettings ++ Seq(
}
},
- binaryIssueFilters ++= {
+ mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters._
@@ -101,7 +101,7 @@ object Default {
): Aux[Some[H] :: T, K :: LabT, FieldType[K, H] :: OutT] =
new Helper[Some[H] :: T, K :: LabT] {
type Out = FieldType[K, H] :: OutT
- def apply(l: Some[H] :: T) = field[K](l.head.x) :: tailHelper(l.tail)
+ def apply(l: Some[H] :: T) = field[K](l.head.get) :: tailHelper(l.tail)
}
implicit def hconsNoneHelper[K <: Symbol, T <: HList, LabT <: HList, OutT <: HList]
@@ -149,7 +149,7 @@ package shapeless {
): analyzer.SearchResult = {
val filteredInput = implicitInfoss.map { infos =>
infos.filter { info =>
- val sym = info.sym.accessedOrSelf
+ val sym = if(info.sym.isLazy) info.sym else info.sym.accessedOrSelf
sym.owner != owner.owner || (!sym.isVal && !sym.isLazy)
}
}
@@ -201,7 +201,7 @@ object Typeable extends TupleTypeableInstances with LowPriorityTypeable {
if(t == null) None
else if(t.isInstanceOf[Left[_, _]]) {
val l = t.asInstanceOf[Left[_, _]]
- for(a <- l.a.cast[A]) yield t.asInstanceOf[Left[A, B]]
+ for(a <- l.left.get.cast[A]) yield t.asInstanceOf[Left[A, B]]
} else None
}
def describe = s"Left[${castA.describe}]"
@@ -214,7 +214,7 @@ object Typeable extends TupleTypeableInstances with LowPriorityTypeable {
if(t == null) None
else if(t.isInstanceOf[Right[_, _]]) {
val r = t.asInstanceOf[Right[_, _]]
- for(b <- r.b.cast[B]) yield t.asInstanceOf[Right[A, B]]
+ for(b <- r.right.get.cast[B]) yield t.asInstanceOf[Right[A, B]]
} else None
}
def describe = s"Right[${castB.describe}]"
@@ -33,6 +33,10 @@ package opticDemoDatatypes {
case class Foo(i: Int, s: String)
case class Bar(i: Int, b: Boolean)
+
+ sealed trait Either[+A, +B]
+ case class Left[A, B](left: A) extends Either[A, B]
+ case class Right[A, B](right: B) extends Either[A, B]
}
object OpticExamples extends App {
@@ -57,8 +61,8 @@ object OpticExamples extends App {
val l: Either[Int, Boolean] = Left(23)
val r: Either[Int, Boolean] = Right(false)
- val lExplicit = prism[Either[Int, Boolean]][Left[Int, Boolean]].a
- val rExplicit = prism[Either[Int, Boolean]][Right[Int, Boolean]].b
+ val lExplicit = prism[Either[Int, Boolean]][Left[Int, Boolean]].left
+ val rExplicit = prism[Either[Int, Boolean]][Right[Int, Boolean]].right
val ol = lExplicit.get(l)
assert(ol == Some(23))
@@ -68,8 +72,8 @@ object OpticExamples extends App {
// 3. Sealed family with coproduct branch inferred from product selectors
- val lInferred = prism[Either[Int, Boolean]].a
- val rInferred = prism[Either[Int, Boolean]].b
+ val lInferred = prism[Either[Int, Boolean]].left
+ val rInferred = prism[Either[Int, Boolean]].right
val ol2 = lInferred.get(l)
assert(ol2 == Some(23))
@@ -1 +1 @@
-sbt.version=0.13.13-RC2
+sbt.version=0.13.13-RC3
View
@@ -1,11 +1,11 @@
scalacOptions += "-deprecation"
libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.15"
-addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.8")
+addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.10")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.6.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.12")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")

0 comments on commit d0a8f51

Please sign in to comment.