I see that for writing tasks, it's possible to provide requires separate from the task body. What if my task is using some Java classes? I can write out fully qualified class names, but is there any way to do an import? Do I just wrap an import and the task body together in a do?
no wait to do imports, unless in :init
so like this:
{:tasks {:init (import '[java.util.concurrent Executor])
a (do ,,,
Executor)}}And that would apply the import to every task, right? Is there a downside to using init for that if, say, only one of five tasks actually needs those classes?
it would apply to all tasks yes. the only alternative is to require a namespace on the classpath and move the code there
there's not really a downside I'd say, extra startup cost of that is negligible
Thanks 🙂