From e1041fc3ae0aaa64aec339755412fa268a2f45e7 Mon Sep 17 00:00:00 2001 From: Irfan Ahmad Date: Fri, 26 Jun 2015 05:54:03 -0700 Subject: [PATCH] Enable Scala 2.11 cross-compile, upgrade sbt version. Design Review: None Testing Done: Ran test. Looking for review comments on what to test. --- build.sbt | 5 ++++- project/build.properties | 2 +- src/main/scala/com/codahale/jerkson/Types.scala | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 148547c..0347032 100644 --- a/build.sbt +++ b/build.sbt @@ -22,6 +22,9 @@ scmInfo := Some( /* scala versions and options */ scalaVersion := "2.10.1" +/* scala versions and options */ +crossScalaVersions := Seq("2.10.4", "2.11.6") + // These options will be used for *all* versions. scalacOptions ++= Seq( // "-deprecation", @@ -38,7 +41,7 @@ scalacOptions ++= Seq( // These language flags will be used only for 2.10.x. // Uncomment those you need, or if you hate SIP-18, all of them. scalacOptions <++= scalaVersion map { sv => - if (sv startsWith "2.10") List( + if ((sv startsWith "2.10") || (sv startsWith "2.11")) List( // "-Xverify", // "-Ywarn-all", "-feature", diff --git a/project/build.properties b/project/build.properties index db255c2..748703f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.12.3 \ No newline at end of file +sbt.version=0.13.7 diff --git a/src/main/scala/com/codahale/jerkson/Types.scala b/src/main/scala/com/codahale/jerkson/Types.scala index 70400d3..b032d2f 100644 --- a/src/main/scala/com/codahale/jerkson/Types.scala +++ b/src/main/scala/com/codahale/jerkson/Types.scala @@ -2,11 +2,11 @@ package com.codahale.jerkson import com.fasterxml.jackson.databind.JavaType import com.fasterxml.jackson.databind.`type`.{TypeFactory, ArrayType} -import scala.collection.JavaConversions.asScalaConcurrentMap +import scala.collection.JavaConversions.mapAsScalaConcurrentMap import java.util.concurrent.ConcurrentHashMap private[jerkson] object Types { - private val cachedTypes = asScalaConcurrentMap(new ConcurrentHashMap[Manifest[_], JavaType]()) + private val cachedTypes = mapAsScalaConcurrentMap(new ConcurrentHashMap[Manifest[_], JavaType]()) def build(factory: TypeFactory, manifest: Manifest[_]): JavaType = cachedTypes.getOrElseUpdate(manifest, constructType(factory, manifest))