From 367bd323bc28a051f26559f82c5f94f0c40a1d83 Mon Sep 17 00:00:00 2001 From: Yang Bo Date: Thu, 16 Jun 2016 16:41:24 +0800 Subject: Backport to Scala 2.10 --- macros/src/main/scala/ch/jodersky/jni/annotations.scala | 7 ++++--- project/SbtJniBuild.scala | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/macros/src/main/scala/ch/jodersky/jni/annotations.scala b/macros/src/main/scala/ch/jodersky/jni/annotations.scala index ffc262e..c1caa48 100644 --- a/macros/src/main/scala/ch/jodersky/jni/annotations.scala +++ b/macros/src/main/scala/ch/jodersky/jni/annotations.scala @@ -1,16 +1,17 @@ package ch.jodersky.jni +import macrocompat.bundle import util.PlatformMacros import scala.language.experimental.macros - import scala.reflect.macros.whitebox.Context import scala.annotation.StaticAnnotation import scala.annotation.compileTimeOnly -object nativeLoaderMacro { +@bundle +class nativeLoaderMacro(val c: Context) { - def impl(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = { + def impl(annottees: c.Expr[Any]*): c.Expr[Any] = { import c.universe._ val nativeLibrary: String = c.prefix.tree match { diff --git a/project/SbtJniBuild.scala b/project/SbtJniBuild.scala index ee71b3c..0d72497 100644 --- a/project/SbtJniBuild.scala +++ b/project/SbtJniBuild.scala @@ -10,7 +10,7 @@ import com.typesafe.sbt.SbtScalariform.ScalariformKeys object SbtJniBuild extends Build { - val scalaVersions: Seq[String] = List("2.11.8", "2.12.0-M4") + val scalaVersions: Seq[String] = List("2.10.6", "2.11.8", "2.12.0-M4") val macrosParadiseVersion = "2.1.0" val commonSettings = Seq( @@ -47,6 +47,8 @@ object SbtJniBuild extends Build { scalaVersion := scalaVersions.head, crossScalaVersions := scalaVersions, addCompilerPlugin("org.scalamacros" % "paradise" % macrosParadiseVersion cross CrossVersion.full), + libraryDependencies += "org.typelevel" %% "macro-compat" % "1.1.1", + libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided, libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value ) ) -- cgit v1.2.3