1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package cbt
import java.io.File
trait NewStyleMacros extends BaseBuild{
def newStyleMacrosVersion = "3.0.0-M9"
override def scalacOptions = super.scalacOptions ++ NewStyleMacros.scalacOptions(
NewStyleMacros.dependencies( scalaVersion, newStyleMacrosVersion, context.cbtLastModified, context.paths.mavenCache ).jar
)
}
object NewStyleMacros{
def dependencies(
scalaVersion: String, newStyleMacrosVersion: String, cbtLastModified: Long, mavenCache: java.io.File
)(
implicit logger: Logger, transientCache: java.util.Map[AnyRef,AnyRef], classLoaderCache: ClassLoaderCache
) =
MavenResolver( cbtLastModified, mavenCache, mavenCentral ).bindOne(
MavenDependency( "org.scalameta", "paradise_"+scalaVersion, newStyleMacrosVersion )
)
def scalacOptions( jarPath: File ) =
Seq(
"-Xplugin:" ++ jarPath.string,
"-Yrangepos",
"-Xplugin-require:macroparadise"
)
}
|