sbt - How to tell sbteclipse to ignore src/main/java? -
how can sbt-eclipse plugin ignore adding/creating src/main/java , src/test/java eclipse .classpath?
i dont have these folders , when run >eclipse eclipse-sbt-plugin creates folders , adds eclipse .classpath.
build.sbt file
name := "myproject" version := "1.0" scalaversion := "2.10.1" resolvers += "google-api-services" @ "http://google-api-client-libraries.appspot.com/mavenrepo" librarydependencies += "org.scalatest" %% "scalatest" % "1.9.1" % "test" librarydependencies += "junit" % "junit" % "4.10" % "test" librarydependencies += "com.novocode" % "junit-interface" % "0.10-m1" % "test" eclipsekeys.createsrc := eclipsecreatesrc.valueset(eclipsecreatesrc.unmanaged, eclipsecreatesrc.source, eclipsecreatesrc.resource)
projects/plugins.sbt file
resolvers += classpaths.typesaferesolver addsbtplugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")
thanks.
this default behavior of sbt have javasources , scalasources in classpath. them being in eclipse consequence.
it can changed (for java project):
unmanagedsourcedirectories in compile := (javasource in compile).value :: nil
or (for scala project)
unmanagedsourcedirectories in compile := (scalasource in compile).value :: nil
or remove them all
unmanagedsourcedirectories in compile := nil
you can this:
unmanagedsourcedirectories in test <<= (sourcedirectory){ src => src / "somerandompathfortestsources" :: nil}
to see (in sbt console):
show unmanagedsourcedirectories show sources ...
to see makes them:
inspect unmanagedsourcedirectories ...
more about: http://www.scala-sbt.org/0.13.0/docs/detailed-topics/java-sources.html
Comments
Post a Comment