tools-build

seancorfield 2021-09-16T07:11:10.174700Z

https://github.com/seancorfield/deps-new -- A new, simpler alternative to clj-new -- updated app and lib templates to use tools.build (instead of depstar)

clojure -Ttools install com.github.seancorfield/deps-new '{:git/tag "v0.2.0"}' :as new

flowthing 2021-09-16T12:08:36.177100Z

Maybe a known issue, but noticed that write-pom throws an NPE if :lib is not qualified.

Alex Miller (Clojure team) 2021-09-16T12:10:44.177300Z

Thx

Alex Miller (Clojure team) 2021-09-16T12:11:15.177700Z

But you should qualify :)

flowthing 2021-09-16T12:11:50.178Z

Yes, I know, and I will. 🙂

Alex Miller (Clojure team) 2021-09-16T14:25:52.178500Z

tools.build v0.4.1 452db44 now available: • Add initial parameter spec checking

seancorfield 2021-09-16T17:08:10.181300Z

I'll give things a few more days to settle before I update build-clj to pick up this version (just an FYI for anyone using write-pom via one of the tasks in build-clj).

Alex Miller (Clojure team) 2021-09-16T14:26:07.178900Z

@flowthing ^^ checks lib and path params, more to do in the future

flowthing 2021-09-16T14:55:00.179600Z

Awesome, thanks!

flowthing 2021-09-16T15:08:48.179900Z

Tested with :lib — looks good. 👍

borkdude 2021-09-16T15:43:53.180600Z

I've also converted one project from depstar to tools.build/uber today 💪😉🚀

seancorfield 2021-09-16T17:07:06.181200Z

Thank you @borkdude -- I hope everyone else will follow 🙂

seancorfield 2021-09-16T18:28:38.185200Z

A user just pointed out a subtle difference between depstar and the "default" approach to building an uberjar with tools.build: by default, depstar created a basis that was essentially the -Srepro version so that you had repeatable builds across multiple environments (i.e., ignoring the user deps.edn). The "default" basis created in tools.build does include the user deps.edn per the docs and the http://clojure.org guide. That feels like a trap for the unwary since you might have different :mvn/repos in your user deps.edn than your source pom.xml, for example, and the generated pom.xml from write-pom with a "default" basis would overwrite those in the source pom.xml with those from the user deps.edn.

seancorfield 2021-09-16T18:30:04.186700Z

Not sure whether the default for create-basis should change (`:user nil` so you have to opt-in with :user :standard) or whether this is just something the docs should point out -- and of course now I'm wondering if build-clj should default to a "repro" style basis that users could override to include user deps.edn or whether that would be too confusing.

seancorfield 2021-09-16T18:43:42.187800Z

It's also perhaps a bit odd that the guide has (b/create-basis {:project "deps.edn"}) when that's the default anyway (well, I guess technically (b/create-basis {:project :standard}) would be more "default" 🙂 ).

Alex Miller (Clojure team) 2021-09-16T19:07:48.189600Z

yeah, I went back and forth on this. the tools.build create-basis wraps the tools.deps create-basis, and I think using the user deps.edn is right there to mimic clj. but in tools.build, the perspective is different and I think it would make sense to omit user deps.edn

borkdude 2021-09-16T19:10:00.189900Z

in the name of reproducible builds, I think that make sense

dharrigan 2021-09-16T19:11:23.190900Z

I would like to see the user's deps.edn ignored too, to aid in creating reproducible builds 🙂

Alex Miller (Clojure team) 2021-09-16T19:17:29.191300Z

tools.build v0.5.0 7d77952 now available: • create-basis - do not include user deps.edn by default

seancorfield 2021-09-16T19:19:27.192300Z

OK, now build-clj needs to be updated! 😆 But I do need to tweak the uber task first around required parameters! Thanks for that change Alex -- makes a lot of sense!

dharrigan 2021-09-16T19:19:35.192500Z

Thank you Alex 🙂

lread 2021-09-16T19:34:35.198700Z

When migrating to tools.build from depstar are folks making their git committed pom.xmls more terse? Since tools.build generates a new pom.xml to a work dir, I suppose the pom.xml I commit to git could act like more of a template and leave out <groupId>, <artifactId>, <version>, maybe <scm>-> <tag>, and <dependencies>?

borkdude 2021-09-16T19:34:52.199100Z

I love that these things are all separate libraries so they can be developed and released separately ;)

💯 1
seancorfield 2021-09-16T19:45:33.200Z

@lee Yup, I've taken some things out of the source pom.xml under version control in some of my libraries now.

lread 2021-09-16T19:46:45.200400Z

Very interesting! Thanks @seancorfield!

seancorfield 2021-09-16T19:49:03.201500Z

io.github.seancorfield/build-clj {:git/tag "v0.3.0" :git/sha "fb11811"} available: • updates tools.build to v0.5.0 for the repro basis by default • allows :lib to be omitted from uber if you pass :uber-file

1