Gradle Scala Plugin corollary to addCompilerPlugin in sbt

后端 未结 1 1988
旧巷少年郎
旧巷少年郎 2020-12-31 18:55

What is the best way to add a Scala compiler plugin to the scalaCompile task in Gradle?

相关标签:
1条回答
  • 2020-12-31 19:58
    1. Add a configuration for compiler plugins: configurations { scalaCompilerPlugin }

    2. Add compiler plugin dependencies: dependencies { scalaCompilerPlugin "org.scalamacros:paradise_2.11.7:2.1.0" }

    3. 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.

    0 讨论(0)
提交回复
热议问题