Skip to content

Using shapeless: current release

Miles Sabin edited this page Jul 20, 2015 · 4 revisions

Binary release artefacts are published to the Sonatype OSS Repository Hosting service and synced to Maven Central. Snapshots of the master and scala-2.10.x branches are built using Travis CI and automatically published to the Sonatype OSS Snapshot repository. To include the Sonatype repositories in your SBT build you should add,

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  Resolver.sonatypeRepo("snapshots")
)

Please be aware that SBT 0.13.6 has an [issue][namehashing] related to its new name hashing feature which when compiling with shapeless might cause SBT to loop indefinitely consuming all heap. Workarounds are to move to an earlier (0.13.5) or later (0.13.7) SBT version or disable name hashing by adding,

incOptions := incOptions.value.withNameHashing(false)

to your settings.

shapeless-2.2.4

Builds are available for Scala 2.11.x and for Scala 2.10.x. The main line of development for shapeless 2.2.4 is Scala 2.11.7 with Scala 2.10.x supported via the macro paradise compiler plugin.

scalaVersion := "2.11.7"

libraryDependencies ++= Seq(
  "com.chuusai" %% "shapeless" % "2.2.4"
)

If you are using Scala 2.10.x, note that unlike earlier versions, it is no longer necessary to provide an explicit Scala version suffix for your shapeless dependency. You must however ensure that you are using Scala version 2.10.2 or greater, with Scala 2.10.5 (or switching to 2.11.x) strongly recommended. You should also add the macro paradise plugin to your build,

scalaVersion := "2.10.5"

libraryDependencies ++= Seq(
  "com.chuusai" %% "shapeless" % "2.2.4",
  compilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full)
)