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

Automatic clean before deploy can break Cljx lib releases #1586

Open
ptaoussanis opened this issue Jul 4, 2014 · 4 comments
Open

Automatic clean before deploy can break Cljx lib releases #1586

ptaoussanis opened this issue Jul 4, 2014 · 4 comments

Comments

@ptaoussanis
Copy link

Hi there!

v2.4.0 introduced the following change: Automatically clean before deploy to avoid AOT in libraries. (Phil Hagelberg). Not sure if this was discussed somewhere - struggling to find the relevant issue?

Anyway, this change can break libraries that use Cljx transforms that output to a clean target path (handy, quite common, and currently recommended by the Cljx docs).

Is this something that was considered? Is there a recommended workaround? Is there a way to disable the new [auto cleaning] behaviour?

Thanks a lot, cheers! :-)

UPDATE: Found the original issue motivating this change: #1512
UPDATE 2: Okay, found the :auto-clean false project.clj option. Will keep digging to understand this better.

@technomancy
Copy link
Owner

The best way to handle this would be to include whatever's writing to target/classes in :prep-tasks so that it happens after the clean. But if you can't do that for whatever reason, then :auto-clean is the way to go.

@ptaoussanis
Copy link
Author

Great, thanks Phil! Appreciate the quick response - cheers :-)

@jeluard
Copy link

jeluard commented Sep 20, 2014

Unfortunately this is not only about target/classes but everything defined as part of clean-targets. This essentially breaks any task generating sources / tests that should be packaged in the resulting jar. Right now any such project must rely on :auto-clean false.
Also I find it pretty unexpected that the clean task can be called automatically part of a task lifecycle.

Maybe just excluding target/classes would be sufficient to address #1512 ?

@cemerick
Copy link
Collaborator

AFAICT, just using :prep-tasks is not sufficient to address this, :auto-clean false must also be added. I had to use both in double-check (see referenced commit above) in order to prod Leiningen into actually adding generated sources into the jar to be deployed.

What am I doing wrong here? Reopening so that the thread isn't lost.

Meta: it again seems like the challenges posed by AOT are forcing those of us not using AOT to babysit our builds to restore basic behaviour (in this case "stuff that's in target/classes goes into the jar").

@cemerick cemerick reopened this Dec 11, 2014
elahti added a commit to Opetushallitus/ataru that referenced this issue May 26, 2016
Had to revert previously removed prep-tasks. See
technomancy/leiningen#1586 for
more.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants