Fork me on GitHub
#boot
<
2018-04-30
>
dcerys16:04:55

Caveat: I’m a boot newbie. I’m trying to create a build.boot file so I can build a number of jar files (~5), with identical dependencies, but different :main classes. I started with the basic pattern of (sift) (aot) (uber), but I can’t naively follow this with multiple (jar :file X :main Y) statements (well I can, but the non-first jars are bloated) . Can someone point me to an example of generating multiple jar files in a case like this?

alandipert16:04:09

@dan551 can all the classes be in all the jars and they just differ by entrypoint? or do you actually need to sift things out before jar-ing

dcerys16:04:31

@alandipert Yes, all the classes can be in all the jars and they just differ by entrypoint. (Although the 5 top-level entry point classes/files are orthogonal to each other, i.e., they don’t need to be in the other jar files).

alandipert16:04:41

@dan551 are the class names provided by the user at build time? or can you code them into your build.boot

dcerys16:04:31

@alandipert: yes, I could put them in my build.boot. So, my naive option is to include 5 build-jar-N deftasks, each generating fileN.jar files (but I’d have to copy each of the jar files out of the target directory prior to invoking the next build-jar-N)

alandipert17:04:40

actually, 1 second, needs elaboration 😄

alandipert17:04:54

the problem with stacking jar tasks is we don't want previous jars created in the pipeline to end up in subsequent jars

alandipert17:04:20

so the "solution" there is to maintain a history stack of filesets. it's a means to forking the pipeline

alandipert17:04:39

wow, nevermind x2, that's crazy overkill. you can just sift out main1.jar instead of saving the fileset

dcerys18:04:15

@alandipert: Thanks, I’ll try the sift approach