Fork me on GitHub

i’m having no luck with boot-new. i do boot -d boot/new new -t template -n tmp.foobar, then cd tmp.foobar; boot build installs it locally. then in a separate directory: boot -d boot/new new -t tmp.foobar -n foobar-test, which gives “Failed to collect dependencies:… tmp.foobar:lein-template:…”


anybody have an example of a boot-new template?


for discussion, before i spend time on a PR: boot-new should use namespaced syms for template name. iow, instead of -t foo-app, we would do -t this would support multiple templates in a single project.


the problem with the current impl if i understand it is that the project name and the template name must be the same. @seancorfield


@mobileink the default template project will produce a snapshot artifact. You'll need to tell boot-new to search for snapshots (`-S` I think -- check the docs).


Or you could change the template project version to non-snapshot before you install it.


thanks, did figger that out eventually. fyi submitted a pr.


but that's a separate issue from supporting multiple template in one boot-template lib, no? i don't how to do it currently.


also if you're open to adding some docs on howto develop a template lib i'll give it a shot.


You shouldn't use (System/exit 0) when there's a failure. I'd prefer that your PR just added another (println (format ...)) to the existing println calls in that exit-error call.


Printing the actual exception is important.


Certainly happy to add more to the readme, so that's all good.


honest q: why not System/exit? my thinking is this: we caught the problem, we know exactly what it is, and we can tell the user exactly the problem. what is the point of a stack trace?


or to put it differently: it's not really an exception if it's something you have foreseen. Exceptions (imho) are for unexpected stuff.


stack traces are alienating in my view. in this case, if boot-new had simply told me it could not find ["RELEASE'] i would have know immediately what the pronlem is. the stack trace was actually anti-helpful.


that's one thing. a separate thing is that boot-new throws only the last exception, when in fact there are two. so the msg is "i could not find the leinengen template", which is just wrong. i don't even care about leinengen, why is boot-new bothering?


so: an enhancement i would like to see is: assume boot. if you want a leinengen template, you must say so. when i'm using a boot template, i do not want to waste time searching for lein stuff.


fwiw i hope i don't sound too blunt, i'm grateful for your work. just trying to not waste time.


or to put it in a more poetic, Rumsfeldian mode: exceptions are for unknown unknows. Known unknowns should never throw exceptions. heh.


I meant specifically if you have an error, do not exit with a ZERO status.


Also, System/exit short-circuits Boot's error handling which might affect a build pipeline. You just shouldn't use it in a Boot task.


That's why there's exit-error


can you elaborate on that? doen't throwing an exception do same?


If you change your PR to just add an additional println with your improved error message using format, I'll merge it in.


I'm on my phone and that explanation is more than I'm willing to type.


I haven't actually gotten out of bed yet. Just responding as a courtesy.


will do, don't wanna argue. but i'm genuinely puzzled as to why System/exit is a bad idea.


hahah! take your time!


Because it just stops the jvm right there and then. Tasks lose control.


why is that bad? serious question. i have a pipeline and a task fails. why not come to a screeching halt -so long as you have a good error msg.


Not typing an answer on my phone. Just accept it's the wrong thing to do.


heh, won't ask you to phone it, but i'm afraid i'm the kind of annoying guy who cannot "just accept". but this is a larger issue maybe somebody else will chime in and pull the worms out of my head. i will accept whatever you want for boot-new, however. i'll revise later today.


get some rest. simple_smile


I'm up and about now. But still on my phone (out getting brunch). Will look for an updated PR sometime, thanks.


is there a way to only get files/namespaces from certain input dirs, in my case the "source-paths"?


i try to run cloverage, but it tries to include dependencies from a cljc file in a resource dir


and i wouldn't want to include that in the coverage measurement anyway


for now i just (set-env! :resource-paths #{}) but that feels dirty