Mill:如何向模块添加其他资源

时间:2019-08-22 06:19:08

标签: scala resources mill

我的模块路径上有一些文件需要在类路径上进行测试。

列出所有可能性(mill resolve tests._)我认为扩展resources是可行的方法。

我尝试了很多-这是我的最后一次尝试:

object test extends Tests {

  override def resources =
    new Sources({
      super.resources.self.map(_ :+ (millSourcePath / up / 'data / 'global / 'bpmn))
    }, 
      super.resources.ctx
    )
 ...
}
  • 覆盖resources的路要走吗?
  • 如何正确完成?

1 个答案:

答案 0 :(得分:1)

resources是“源任务” as defined here。因此,为了在资源路径中添加一些内容,您可以

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