What is the best way to add a Scala compiler plugin to the scalaCompile task in Gradle?
Asked
Active
Viewed 1,140 times
1 Answers
12
Add a configuration for compiler plugins:
configurations { scalaCompilerPlugin }
Add compiler plugin dependencies:
dependencies { scalaCompilerPlugin "org.scalamacros:paradise_2.11.7:2.1.0" }
Set up the option:
tasks.withType(ScalaCompile) { scalaCompileOptions.additionalParameters = [ "-Xplugin:" + configurations.scalaCompilerPlugin.asPath ] }
I was able to use Macro Paradise in a Gradle-built project with this setup.

vergenzt
- 9,669
- 4
- 40
- 47
-
wondering if you can help me with this: http://stackoverflow.com/questions/39594587/how-do-you-cross-compile-to-scala-js-with-gradle – Suminda Sirinath S. Dharmasena Sep 20 '16 at 12:55