diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-14 12:21:40 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-14 12:21:40 -0400 |
commit | e3262d4e4f8b83cac6f1b2a0558af3e30073ec2a (patch) | |
tree | 293f6094560094ff5580ba62e4a2d07e02e86a7d /stage2/plugins/NewStyleMacros.scala | |
parent | 66c3d62ebb08eb0054ade9b98dc7a477976117b7 (diff) | |
parent | 3df15ef7c9c5a48516c06cf7b598acf298d8b8c0 (diff) | |
download | cbt-e3262d4e4f8b83cac6f1b2a0558af3e30073ec2a.tar.gz cbt-e3262d4e4f8b83cac6f1b2a0558af3e30073ec2a.tar.bz2 cbt-e3262d4e4f8b83cac6f1b2a0558af3e30073ec2a.zip |
Merge remote-tracking branch 'origin/master' into kind-projector-plugin
Diffstat (limited to 'stage2/plugins/NewStyleMacros.scala')
-rw-r--r-- | stage2/plugins/NewStyleMacros.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/stage2/plugins/NewStyleMacros.scala b/stage2/plugins/NewStyleMacros.scala new file mode 100644 index 0000000..42b3287 --- /dev/null +++ b/stage2/plugins/NewStyleMacros.scala @@ -0,0 +1,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" + ) +} + |