boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
dcerys 2018-04-30T16:24:55.000617Z

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?

2018-04-30T16:41:09.000780Z

@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

dcerys 2018-04-30T16:42:31.000117Z

@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).

2018-04-30T16:52:41.000145Z

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

dcerys 2018-04-30T16:57:31.000651Z

@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)

2018-04-30T17:00:12.000201Z

@dan551 here's how i would do it: https://gist.github.com/alandipert/3d53a625d95eb8edd30f31603008d851

2018-04-30T17:00:40.000738Z

actually, 1 second, needs elaboration 😄

2018-04-30T17:22:37.000655Z

@dan551 ok, here's a recipe - that got involved quickly https://gist.github.com/alandipert/3d53a625d95eb8edd30f31603008d851

2018-04-30T17:22:54.000394Z

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

2018-04-30T17:23:20.000317Z

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

2018-04-30T17:34:39.000224Z

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

dcerys 2018-04-30T18:00:15.000641Z

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