I will try to answer, but I am not very familiar with the internal details of sbt.
Usually, the path for the build system (unlike your program) is in the project, as described here . Usually this should be in project/plugins.sbt
. It sounds right, since there is no reason for the program you are developing to take care of which libraries your build system uses, and vice versa.
When your plugin runs the application code, it may not be so simple, and problems with classpath / classloader may occur. I'm not sure if this will work. Typically, your plugin should implement a testing platform, and not define its own task. Testing documentation for sbt is limited.
The testing framework should implement org.scalatools.testing.Framework
in the test-interface . Your assembly will take this into account after adding
testFrameworks += new TestFramework("full.class.name")
When you run a regular test command, it allows each structure to recognize the test classes it deals with (two available criteria: extending the base class or annotation) and running them. The frame runs in the assembly, it is provided with a class loader to access the application code.
You can take a look at the implementation of the framework for junit (comes with sbt). There is also a TestNG implementation . I donโt know this, according to his document, itโs a little unorthodox, I hope this works for you.
source share