scalaresourcesmill

Mill: How to add additional Resources to a module


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
    )
 ...
}

Solution

  • 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)
    }