sbt-assembly : including test classes

被刻印的时光 ゝ 提交于 2019-11-28 02:50:45

问题


As part of sbt-assembly I want to include both src and test class files in jar. Sbt-assembly includes only src files with dependencies. Is there any way through which I can include test classes also in same jar?


回答1:


I wrote sbt-assembly so that the settings can be loaded into other configurations than the default Runtime. Put the following in assembly.sbt and it should add test:assembly task:

import AssemblyKeys._

Project.inConfig(Test)(baseAssemblySettings)

jarName in (Test, assembly) := s"${name.value}-test-${version.value}.jar"

Like the way jarName setting is scoped, substitute xxx in assembly in README with xxx in (Test, assembly) to customize the setting.



来源:https://stackoverflow.com/questions/20488329/sbt-assembly-including-test-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!