build - How do I specify a custom directory layout for an sbt project? -
how specify custom directory layout sbt-based project? i've been looking @ online sbt material, i'm struggling find information...
what did find in documentation default locations:
- sources in base directory
- sources in
src/main/scala,src/main/java - tests in
src/test/scala,src/test/java - data files in
src/main/resources,src/test/resources - unmanaged jar-files in
lib/
how override these in build.sbt file?
my project structure follows:
- source in:
[workspace]/sandbox-scala/src/sbt/myfirst/ - libraries in:
[workspace]/java-lib/common/lib/
any appreciated.
one can override number of sbt's default directory locations. here's example overrides directory sbt expects find "unmanaged" dependencies/jar files:
unmanagedbase := basedirectory.value / "custom-jars-directory" (more examples related depndencies in the sbt documentation.)
you can configure directories specific particular "task"... e.g., set directory test-case source code is, try:
scalasource in test := { (basedirectory in test)(_ / "test") }.value and core application source code somewhere else, under src/:
scalasource in compile := { (basedirectory in compile)(_ / "src") }.value note: older versions of sbt may need following (now-deprecated) syntax:
unmanagedbase <<= basedirectory { base => base / "custom-jars-directory" } scalasource in compile <<= (basedirectory in compile)(_ / "src") this syntax not work in newer versions of sbt (since 0.13.13, believe).
Comments
Post a Comment