@alexmiller not sure if you saw my follow-up Q last night? It was pretty late for you...
sorry, I'll get back to it in a bit
OK, NP.
@seancorfield looked at it again and I think you're right, uber can just do all the things here
will update guide
Cool. And prep could be a separate example for a lib that needs to either javac or compile-clj something?
(this means it's definitely worth me adding a shortcut uber function to my build-clj library!)
yeah
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
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.
No, so you’d need to merge a replacement that handled your special case
Gotcha, thanks
many thanks to Sean Corfield for the help on all of that
updated api doc for uber at: https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-uber
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!
🪦
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)?
(I'm looking at adding some shorthands to build-clj like I already have for jar)
you don’t need uber if you just want to use a git lib as a dep
prep is enough
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 :)
Not sure why "write pom, copy files" is useful for a git lib? Can you elaborate?
"prep" to me means javac or perhaps some minor compile-clj stuff...