What is the purpose of `scala-2.11` folder in Inte

2019-01-23 11:07发布

问题:

scala-2.11 folder appeared after recent update of IDEA and Scala plugin.
What should it be used for?

回答1:

Usually such directories are used for binary version-dependent code. For example, macros in 2.10 are not source-compatible with macros in 2.11, so if you're building your project for different binary versions and you're using macros, it makes sense to put code which is only valid for the specific version in different source roots. SBT then will use the appropriate directory when compiling for 2.10 or 2.11.

If you're using SBT, though, you would need to set such thing up manually in the build definition. If you're not using SBT, then probably IDEA plugin was updated to handle such things by itself.