Open matanox opened 8 years ago
Looks like I'm adding the library dependency only once and not per project. Which brings in a single binary version of the compiler plugin - rather than fitting each sub-project with its matching binary version of the compiler plugin.
The workaround of the last commit here - which skips sub-projects that do not match the overall scala version - leaves cross-version support rather impaired, it only avoids crashing. Take parboiled2 as an example; there is no root project there, rather it uses the Common Settings idiom. So the project defaults to 2.10 while each and every sub-project is 2.11. We instrument nothing therefore there, through the sbt plugin.
libraryDependencies for sub-projects seem to have a management cycle of their own (e.g. seem to be ignored)
A different way around it - https://gitter.im/sbt/sbt?at=566d2350cffd648a05553745
@pfn I guess that would work if I had a proper sbt project to use for scoping, but I don’t. What I ended up doing is creating a configuration, scoping the ModuleID to the created configuration, and then use
update in <my-configuration>.value.allFiles
. That seems to give me all transitive dependencies. If I use insteaddependencyClasspath in <my-configuration>
I get back an errorReferences to undefined settings: foo/<my-configuration>:dependencyClasspath from foo/*:<my-task>
This is going on hold now, until an sbt committer is willing to take this up one day or answer questions. It is just too cryptic and better support is needed. Noting that I suspect this may also be an issue for sub-projects which override their root project's library settings, not just to builds of mixed scala versions.
This issue is a hindrance to our breadth of support.
Running Canve for play framework (need to cd to
/framework
first), for a certain subproject, the classpath is clearly bringing in scala 2.10, whereas the resolved dependency of the compiler plugin is 2.11:This means runtime binary incompatibility, running the scala 2.11 plugin as part of a 2.10 compilation, which ultimately breaks on: