Gradle编译的Scala类与IntelliJ不兼容?(Compiled Scala classes by Gradle not compatible with IntelliJ?)

编程入门 行业动态 更新时间:2024-10-27 10:24:36
Gradle编译的Scala类与IntelliJ不兼容?(Compiled Scala classes by Gradle not compatible with IntelliJ?)

我有使用gradle配置的scala项目作为构建工具。 在开发过程中,我使用IntelliJ和已配置的Scala插件和Gradle插件。

我的问题是为什么gradle从命令行/终端编译的类与IntelliJ中的类不兼容(即IntelliJ总是尝试重新编译scala类,即使我不修改任何东西而只是运行测试)?

I have scala projects configured with gradle as build tool. During development, I use IntelliJ with configured Scala plugin and Gradle plugin.

My question is why classes compiled by gradle from command line/terminal is not compatible with the one from IntelliJ (i.e. IntelliJ always try to recompile scala classes even if I don't modify anything and just run the test)?

最满意答案

这是IntelliJ的已知错误,看起来不太可能修复。 问题是IntelliJ有一个增量编译器,并且很难将外部编译的类合并到其依赖图中,因为scalac编译器不会生成IntelliJ使用的自定义依赖图信息。

请参阅https://youtrack.jetbrains.com/issue/SCL-8481和https://youtrack.jetbrains.com/issue/SCL-7711

(更多信息请访问https://github.com/JetBrains/intellij-scala/issues/131 ,现已删除)

This is a known bug with IntelliJ which does not look like it is possible to fix. The issue is that IntelliJ has an incremental compiler, and it is very difficult to incorporate externally compiled classes into its dependency graph, because the scalac compiler doesn't produce the custom dependency graph info that IntelliJ uses.

See https://youtrack.jetbrains.com/issue/SCL-8481 and https://youtrack.jetbrains.com/issue/SCL-7711

(More info was at https://github.com/JetBrains/intellij-scala/issues/131 , now deleted)

更多推荐

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

发布评论

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

>www.elefans.com

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