Sbt plugin binary incompatibility

柔情痞子 提交于 2020-01-05 06:51:39

问题


I am using the sbtantlr plugin and adapting it to use antlr v3.5. It used to work fine with scala 2.9.2.

Today I upgraded my scala to 2.10.0.

And I compiled the plugin in 2.10.0 and put the plugin 'sbtantlr.jar' in the 'lib' directory of my main scala project.

SBT stopped working with this error message:

Binary incompatibility in plugins detected.

I revert the compiler version to 2.9.2 and it works fine.

Is it because SBT (the official binary release) was built with 2.9? Where can I find the information?


回答1:


Yes, sbt 0.12.x are built with 2.9x and all plugins need to match the binary Scala version.




回答2:


To add more information to what Yann said, Scala only guarantees compatibility between minor versions. That is, code compiled with any 2.8.x version is compatible with code compiled with any other 2.8.x version, but no code compiled with 2.8.x is compatible with code compiled by a 2.9.x version.

Now, SBT is a Scala application, and both the plugins and build configuration are libraries to it. SBT 0.12.x was compiled with Scala 2.9.x, so all plugins and project build configuration must also be compiled with Scala 2.9.x.

The project itself can be compiled with any version, as SBT does not need to interact with it.



来源:https://stackoverflow.com/questions/15144618/sbt-plugin-binary-incompatibility

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!