What is the best way to add a Scala compiler plugin to the scalaCompile task in Gradle?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With