Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different :prep-tasks for run and jar? #1898

Open
binarykitchen opened this issue May 12, 2015 · 3 comments
Open

Different :prep-tasks for run and jar? #1898

binarykitchen opened this issue May 12, 2015 · 3 comments

Comments

@binarykitchen
Copy link

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?

@hypirion
Copy link
Collaborator

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.

@binarykitchen
Copy link
Author

thanks - is this documented somewhere with examples? especially the :prep-tasks ^:replace [...] part?

@hypirion
Copy link
Collaborator

hypirion commented Aug 9, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants