Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...