I want the test-compile action to put the contents of src/test/resources into target/scala_2.8.1/test-classes.
The reason for this is that I'm running SBT with IntelliJ IDEA, which puts the test-classes directory on the classpath when it runs tests.
My logback-test.xml file (configuration for logback logging framework) lives in src/test/resources, and it's not being found during testing.
This doesn't directly answer your question, but instead shows an the alternative that I use.
I add two new tasks: prepare
and test-prepare
.
lazy val prepare = task{
None
} dependsOn (compile, copyResources) describedAs ("Compiles main, copies main resources. Use for the before-action in the idea-sbt-plugin")
lazy val testPrepare = task{
None
} dependsOn (testCompile, copyResources, copyTestResources) describedAs ("Compiles main and test, copies all resources. Use for the before-action in the idea-sbt-plugin")
I then configure the 'before run' SBT action to these. This requires the idea-sbt-plugin.
I use the sbt-idea SBT Processor to configure the IntelliJ module setup. This includes target/scala_2.8.1/[test-]resources
as a dependency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With