tools-build

seancorfield 2021-09-15T16:49:48.166200Z

@alexmiller not sure if you saw my follow-up Q last night? It was pretty late for you...

Alex Miller (Clojure team) 2021-09-15T16:50:37.166600Z

sorry, I'll get back to it in a bit

seancorfield 2021-09-15T16:50:44.166800Z

OK, NP.

Alex Miller (Clojure team) 2021-09-15T20:06:04.167300Z

@seancorfield looked at it again and I think you're right, uber can just do all the things here

Alex Miller (Clojure team) 2021-09-15T20:08:51.167500Z

will update guide

seancorfield 2021-09-15T20:12:57.168Z

Cool. And prep could be a separate example for a lib that needs to either javac or compile-clj something?

seancorfield 2021-09-15T20:13:28.168600Z

(this means it's definitely worth me adding a shortcut uber function to my build-clj library!)

Alex Miller (Clojure team) 2021-09-15T20:23:11.168800Z

yeah

Alex Miller (Clojure team) 2021-09-15T20:53:06.169500Z

tools.build v0.4.0 801a22f is now available • uber - TBUILD-2 - add support for configurable conflict handlers • uber - TBUILD-11 - detect file and dir with same name in uber • uber - TBUILD-16 - expand default exclusions • uber - add support for custom exclusions

Eddie 2021-09-16T04:21:45.173Z

Love the new uber function with conflict handlers. I just started to play with it and had a question. I noticed that user provider rules are merged with the default, and then the “first” handler with a matching regex is used for each conflict. Is there a way to control the priority of handler rules? For example, the "^META-INF/services/" :append handler rule is a good default but (I think) I have a specific service where :append-dedupe is more appropriate but I don’t know how to be sure that my more specific regex will be considered first.

Alex Miller (Clojure team) 2021-09-16T11:56:47.176300Z

No, so you’d need to merge a replacement that handled your special case

Eddie 2021-09-16T14:45:00.179100Z

Gotcha, thanks

Alex Miller (Clojure team) 2021-09-15T20:53:21.169900Z

many thanks to Sean Corfield for the help on all of that

Alex Miller (Clojure team) 2021-09-15T21:13:47.170100Z

updated api doc for uber at: https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-uber

seancorfield 2021-09-15T21:27:45.172300Z

io.github.seancorfield/build-uber-log4j2-handler {:git/tag "v0.1.0" :git/sha "ab8e499"} -- a conflict handler for tools.build v0.4.0+ that handles merging of Log4j2Plugins.dat files. This was the missing gap between what tools.build's uber task and depstar's uberjar function did (so at this point I plan to sunset depstar and encourage everyone to use tools.build instead!). See https://github.com/seancorfield/build-uber-log4j2-handler for more details!

🎆 1
ghadi 2021-09-15T21:31:00.172600Z

🪦

🤣 1
seancorfield 2021-09-15T01:33:25.160500Z

Q: is there a specific reason that the tools.build guide -- https://clojure.org/guides/tools_build#_compiled_uberjar_application_build -- has prep and uber as separate tasks? Is there a specific reason to not have just uber and have it do all four things (write the pom, copy the source, compile the source, build the jar)?

seancorfield 2021-09-15T01:33:53.161Z

(I'm looking at adding some shorthands to build-clj like I already have for jar)

Alex Miller (Clojure team) 2021-09-15T02:29:38.162100Z

you don’t need uber if you just want to use a git lib as a dep

Alex Miller (Clojure team) 2021-09-15T02:29:49.162500Z

prep is enough

Alex Miller (Clojure team) 2021-09-15T03:01:56.164100Z

Although maybe “prep as a git lib” and “uberjar” are unlikely to be the same project and I’m just trying to cram too many things into an example :)

seancorfield 2021-09-15T03:40:13.165Z

Not sure why "write pom, copy files" is useful for a git lib? Can you elaborate?

seancorfield 2021-09-15T03:40:40.165600Z

"prep" to me means javac or perhaps some minor compile-clj stuff...