-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include root directory in .classpath (in sbt build) #186
Comments
I think putting .scala files into the project root directory is bad style. Could you please explain why you consider this "standard conventions"? Anyway, Eclipse doesn't like nested source directories. There are ways to work around it (exclusion rules), but this feature would definitely add some complexity. |
I mean in the directory called 'project' if that was unclear. http://www.scala-sbt.org/release/docs/Getting-Started/Directories.htmlshows In the stack overflow example, I showed an inclusion rule - probably On Thursday, November 21, 2013, Heiko Seeberger wrote:
|
Thanks for the clarification. Scala files under project/ are part of the sbt build definition. Therefore they (might) depend on sbt libraries, hence a general solution requires more than just adding a src entry. See issue #26. |
@hseeberger If you do "reload plugins" "eclipse", then you everything seems to work. What you actually need to be able to add the root directory is the appropriate mechanisms of "excluded" directories. If that issue was fixed, I'd say we should be able to enable this, so we can eclipsify our |
@jsuereth - not quite everything works. I see in #26, someone noticed the same issue and also proposed adding:
Perhaps the plugin could check whether there are .scala files in root path by examining the 'sources' key and if so, then add the above entry to the classpath. I think that would solve the common case at least. @hseeberger this issue is is just about adding the above classpath entry when you do "reload plugins" "eclipse". (I suppose it would also fix this stack overflow request too.) #26 would trigger all this without requiring "reload plugins" which would be nice (but #26 is separate, and would benefit from this logic). |
@jsuereth blows up here in a Play sub project enabled build
Have periodically tried since forever to get project/*.scala files recognized by Eclipse -- the inner workings of SBT would be far more accessible with live type inference vs. blindly groping in the dark ;-) |
Could this plugin generate a separate Eclipse project for the |
@hrj I think I just found the piece that would allow us to do it. THere'sa |
Any progress on this? I too have a project that has sources in the root folder but nested. That is The plugin currently adds <classpathentry output="C:-Users-User-Projects-Project1" kind="src" path="C:-Users-User-Projects-Project1"/> that's the path to my project dash separated and it doesn't work I fix it manually from eclipse ui by adding the project root as a source folder and an inclusion rule and I get the following <classpathentry including="com/**" kind="src" path=""/> which works Can this be done automatically? I would gladly create a PR if someone points me to the right direction. :) |
When following standard conventions, users put .scala files in the root of the project directory in sbt. However, sbt-eclipse doesn't add a .classpath entry for these .scala files in the root directory.
see stack overflow for an example where the .classpath generated for the sbt build is missing the the root directory, and for a manually generated solution.
It's probably possible to detect this situation automatically by noticing .scala files in the root directory. But even without an automatic detection, an option like sourcesInRootDirectory=true would be nice.
The text was updated successfully, but these errors were encountered: