sbt-assembly : including test classes

后端 未结 1 1469
醉酒成梦
醉酒成梦 2020-12-18 21:58

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

相关标签:
1条回答
  • 2020-12-18 22:49

    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.

    0 讨论(0)
提交回复
热议问题