sbt-eclipse icon indicating copy to clipboard operation
sbt-eclipse copied to clipboard

Add some logic to the default value of EclipseKeys.createSrc

Open max-l opened this issue 13 years ago • 1 comments
trafficstars

This could be used to determine if source-managed should be added to the project's source roots:

EclipseKeys.createSrc <<= ((sourceGenerators in Compile) { sourgeGens =>
if(sourgeGens == Nil) EclipseCreateSrc.ValueSet(EclipseCreateSrc.Unmanaged, EclipseCreateSrc.Source) else EclipseCreateSrc.ValueSet(EclipseCreateSrc.Unmanaged, EclipseCreateSrc.Source, EclipseCreateSrc.Managed) })

Also I wish there was a setting such as :

EclipseKeys.createSrcDirs : TaskKey[Seq[File]]

By default this setting would feed on the output of the existing EclipseKeys.createSrc unchanged. It would give a possibility to add or remove the directories that were generated by EclipseKeys.createSrc. I would use it to remove directories like src/main/java, src/test/java when they are empty.

max-l avatar Mar 04 '12 14:03 max-l

After EclipseKeys.createSrc := EclipseCreateSrc.all gets added to build.sbt, the generated eclipse .classpath file ends up with two instances of target/scala-xxx/src_managed/main. If one uses the eclipse Build Path tool to remove one of them, both entries are removed from .classpath. Once src_managed/main is gone from .classpath, then system cannot work. Long story short, if .classpath is modified by hand to have only one instance of src_managed/main, then everything seems to fall into place.

switheyw avatar Mar 11 '15 02:03 switheyw