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

Allow leiningen.compile/compile to take non-string arguments #1442

Closed
hypirion opened this Issue Feb 8, 2014 · 2 comments

Comments

2 participants
@hypirion
Collaborator

hypirion commented Feb 8, 2014

As it stands, compile (wrongly?) assumes that all input arguments are strings. This makes it harder to use it from plugins and inside e.g. :prep-tasks. As an example of a wishful realistic setup

:prep-task [["compile" #"regex-for-files-java-code-depends-upon"]
             "javac" "compile"]

However, the regex must be string-quoted to make this work:

:prep-task [["compile" "#\"regex-for-files-java-code-depends-upon\""]
             "javac" "compile"]

This can quickly get messy if you use backslash-quoting in the regex, because the regex reader rules doesn't apply anymore. Additionally, the keyword :all would be nice to have unquoted as well.

@technomancy

This comment has been minimized.

Show comment
Hide comment
@technomancy

technomancy Feb 11, 2014

Owner

Accepting args that have already passed through the reader sounds good to me, but if we do this we shouldn't limit it to just the compile task; it might be applicable elsewhere too.

Owner

technomancy commented Feb 11, 2014

Accepting args that have already passed through the reader sounds good to me, but if we do this we shouldn't limit it to just the compile task; it might be applicable elsewhere too.

@hypirion

This comment has been minimized.

Show comment
Hide comment
@hypirion

hypirion Feb 14, 2014

Collaborator

@technomancy Yeah, that should be a goal. I don't think I've seen any other task in core not working like that for some time though.

In this specific case, compile thinks all input arguments are strings (from the command lin), and tries to convert strings starting with # to a regex.

Collaborator

hypirion commented Feb 14, 2014

@technomancy Yeah, that should be a goal. I don't think I've seen any other task in core not working like that for some time though.

In this specific case, compile thinks all input arguments are strings (from the command lin), and tries to convert strings starting with # to a regex.

@hypirion hypirion closed this in a5d2ea5 Feb 22, 2014

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