sbt-assembly icon indicating copy to clipboard operation
sbt-assembly copied to clipboard

How to generate two uber jars for one project folder using different filter

Open charlessong0 opened this issue 8 years ago • 2 comments

Hi,

I Just started to learn scala/sbt and is now trying to build my project in two different jars:

One will only contain the .dll unmanagedResource for windows The other one will only contain the .so unmanagedResource for Linux

I am now able to set the filter. But I do not know how to generate two jars in one assembly - or some other option without me touching the code of build.sbt for assembly.

Thanks! Charles

charlessong0 avatar Aug 17 '16 18:08 charlessong0

Have figured it out. Just create two projects pointing to the save folder. Assign different target and resource to them and then you can apply different filters to create different jars. .settings( target := file("...1/scala-2.10/"), sourceManaged := file("...1/scala-2.10/") )

.settings( target := file("...2/scala-2.10/"), sourceManaged := file("...2/scala-2.10/") )

charlessong0 avatar Aug 17 '16 21:08 charlessong0

@charlessong0 if you create two projects pointing to the same folder, the later one will overwrite the previous one, right?

for example:

lazy val proj1 = (project in file("."))...

lazy val proj2 = (project in file("."))...

now, there is only one project proj2.

fluency03 avatar Nov 06 '17 10:11 fluency03