Mill: How to add additional Resources to a module

271 Views Asked by At

I have some Files out side my Module that I need to have on my classpath for testing.

Listing all possibilities (mill resolve tests._) I think to extend resources is the way to go.

I tried a lot - here my last attempt:

object test extends Tests {

  override def resources =
    new Sources({
      super.resources.self.map(_ :+ (millSourcePath / up / 'data / 'global / 'bpmn))
    }, 
      super.resources.ctx
    )
 ...
}
  • Is overwriting resources the way to go?
  • How is it done correctly?
1

There are 1 best solutions below

0
On BEST ANSWER

resources is a "task of sources" as defined here. Thus, in order to add something to the resources path you can do

override def resources = T.sources {
  super.resources() :+ PathRef(millSourcePath / up / 'data / 'global / 'bpm)
}