Gradle Scala插件推论到sbt中的addCompilerPlugin

编程入门 行业动态 更新时间:2024-10-27 08:29:13
本文介绍了Gradle Scala插件推论到sbt中的addCompilerPlugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Gradle中向scalaCompile任务添加Scala编译器插件的最佳方法是什么?

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

推荐答案

  • 为编译器插件添加配置: configurations { scalaCompilerPlugin }

  • Add a configuration for compiler plugins: configurations { scalaCompilerPlugin }

    添加编译器插件依赖项: dependencies { scalaCompilerPlugin "org.scalamacros:paradise_2.11.7:2.1.0" }

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

    设置选项: tasks.withType(ScalaCompile) { scalaCompileOptions.additionalParameters = [ "-Xplugin:" + configurations.scalaCompilerPlugin.asPath ] }

    Set up the option: tasks.withType(ScalaCompile) { scalaCompileOptions.additionalParameters = [ "-Xplugin:" + configurations.scalaCompilerPlugin.asPath ] }

    我能够在Gradle中使用Macro Paradise设置的项目.

  • 更多推荐

    Gradle Scala插件推论到sbt中的addCompilerPlugin

    本文发布于:2023-07-24 13:15:28,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1203666.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:推论   插件   Scala   Gradle   sbt

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!