Permalink
Browse files

Version up to 0.6.8.

Support scala 2.10.
  - fix Either class name conversion in scalap.
  - Check scala class by ScalaSignature annotation rather than extends ScalaObject( which is deprecated at 2.10)
Support scala 2.9.3.
Cut old scala versions.
  • Loading branch information...
1 parent 3ba6561 commit 80293f6858fd731452040eada48ee347061b39e0 takeshita committed Oct 22, 2013
View
@@ -2,19 +2,20 @@ import sbt._
import Keys._
import Process._
import xml.XML
+import org.sbtidea.SbtIdeaPlugin
object MessagePackScalaBuild extends Build {
- val messagePackVersion = "0.6.8-SNAPSHOT"
+ val messagePackVersion = "0.6.8"
override lazy val settings = super.settings ++
Seq(
organization := "org.msgpack",
name := "msgpack-scala",
version := messagePackVersion,
- scalaVersion := "2.9.2",
- crossScalaVersions := Seq("2.9.0-1","2.9.1","2.9.1-1","2.9.2"),
+ scalaVersion := "2.10.3",
+ crossScalaVersions := Seq("2.9.1-1","2.9.2","2.9.3"/*,"2.10.0","2.10.1","2.10.2"*/,"2.10.3"), // After 2.10 ,binaries are compatible.So don't need to crossCompile.(tests are passed even comment outed versions.)
resolvers ++= Seq(Resolver.mavenLocal),
parallelExecution in Test := false
)
@@ -25,17 +26,19 @@ object MessagePackScalaBuild extends Build {
)
lazy val dependenciesForTest = Seq(
- "junit" % "junit" % "4.8.1" % "test",
+ "junit" % "junit" % "4.11" % "test",
"org.slf4j" % "slf4j-nop" % "1.7.2" % "test"
)
lazy val dependsOnScalaVersion = (scalaVersion) { v => {
val specs = v match{
+ case "2.9.3" => "org.specs2" %% "specs2" % "1.12.4.1" % "test"
case "2.9.2" => "org.specs2" %% "specs2" % "1.12.3" % "test"
case "2.9.1-1" => "org.specs2" %% "specs2" % "1.12.3" % "test"
case "2.9.1" => "org.specs2" %% "specs2" % "1.12.3" % "test"
case "2.9.0-1" => "org.specs2" %% "specs2" % "1.8.2" % "test"
case "2.9.0" => "org.specs2" %% "specs2" % "1.7.1" % "test"
+ case x if x.startsWith("2.10") => "org.specs2" %% "specs2" % "1.14" % "test"
case _ => "org.specs2" %% "specs2" % "1.8.2" % "test"
}
Seq(
@@ -45,10 +48,9 @@ object MessagePackScalaBuild extends Build {
}}
-
lazy val root = Project(id = "msgpack-scala",
base = file("."),
- settings = Project.defaultSettings ++ Seq(
+ settings = Project.defaultSettings ++ SbtIdeaPlugin.settings ++ Seq(
libraryDependencies ++= dependencies,
libraryDependencies ++= dependenciesForTest,
libraryDependencies <++= dependsOnScalaVersion,
View
@@ -0,0 +1 @@
+sbt.version=0.12.2
View
@@ -1,3 +1,5 @@
// To publish to maven central, enable this plugin.
-//addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.7")
+//addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.7")
+
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
@@ -117,7 +117,8 @@ object ScalaSigUtil {
"scala.Predef.Set" -> classOf[Set[_]],
"scala.package.List" -> classOf[List[_]],
"scala.Unit" ->classOf[java.lang.Void],
- "scala.package.Seq" -> classOf[Seq[_]]
+ "scala.package.Seq" -> classOf[Seq[_]],
+ "scala.package.Either" -> classOf[Either[_,_]]
)
object mapToRefJavaName extends MapToJavaName{
@@ -4,6 +4,7 @@ import java.lang.reflect.Type
import org.msgpack.annotation.{Message, MessagePackMessage}
import java.lang.annotation.Annotation
import java.lang.annotation.{ Annotation => JAnnotation}
+import scala.reflect.{ScalaLongSignature, ScalaSignature}
/**
*
@@ -18,7 +19,7 @@ trait ScalaObjectMatcher{
val c : Class[_] = targetType.asInstanceOf[Class[_]]
(isAnnotated(c, classOf[MessagePackMessage]) || isAnnotated(c, classOf[Message]) ) &&
- classOf[ScalaObject].isAssignableFrom(c)
+ (c.getAnnotation[ScalaSignature](classOf[ScalaSignature]) != null || c.getAnnotation[ScalaLongSignature](classOf[ScalaLongSignature]) != null)
}
private def isAnnotated(targetType : Class[_], annotation : Class[_ <: JAnnotation]) = {

0 comments on commit 80293f6

Please sign in to comment.