Different :prep-tasks for run and jar?
Currently all the same defined :prep-tasks are run for lein run and lein jar. Can I somehow define different prep tasks for run and for jar?
It's possible to do this in two ways: Using aliases directly, or using a combination of aliases and profiles.
Aliases:
:aliases {"run" ["do" ["my" "prep"] ["tasks" "here"] ["run"]]
"jar" ["do" ["my" "jar"] ["prep" "tasks"] ["run"]]}
Aliases plus profiles:
:aliases {"run" ["with-profile" "+rprep" "run"]
"jar" ["with-profile" "+jprep" "jar"]}
:profiles {:rprep {:prep-tasks [["my" "prep"] ["tasks" "here"]]
:jprep {:prep-tasks [["my" "jar"] ["prep" "tasks"]]}
Note that both will run the default prep-tasks first. You can avoid that by using the latter option and use :prep-tasks ^:replace [...] instead.
thanks - is this documented somewhere with examples? especially the :prep-tasks ^:replace [...] part?
Not explicitly, but there are some explanations on how it works over at PROFILES.md/merging. Happy to take a patch that would elaborate more on how it works.