sattvik / leinjacker

A library for Leiningen plug-in authors.
42 stars 11 forks source link

Added hook-eval-in-project, get-classpath, and apply-task #4

Closed dgrnbrg closed 11 years ago

dgrnbrg commented 12 years ago

hook-eval-in-project is a powerful tool to allow for functionality like lein2's :injections to be made available in lein1 w/ a bit more work. Also, it allows for plugins to invoke the JVM using entirely different code, for instance, to integrate w/ existing proprietary JVM launchers. One example of this is MATLAB, which allows for user code to be put on the classpath.

apply-task make it easy for one task to chain/delegate to another as a subtask.

get-classpath is useful when changing the JVM invocation, so that the new JVM can receive the classpath from all the right places.

dgrnbrg commented 11 years ago

Would it be possible to get feedback or a merge on this? I have a project that depends on these changes that I'd like to distribute, so I may otherwise have to fork and release so that I can release my project.

Thank you!

tobias commented 11 years ago

@dgrnbrg: get-classpath and apply-task look good to me. I'm curious about hook-eval-in-project though - I don't quite understand what it would be used for. Can you provide a better example of its usage?

dgrnbrg commented 11 years ago

One example is here: https://github.com/dgrnbrg/lein-guzheng/blob/master/src/leiningen/guzheng.clj#L97

I needed to have the opportunity to inject some code into every eval-in-project, since the :injections key in the project map is only supported in lein2.

The other place I use this is to support lein2's :eval-in with lein1. I have a leiningen plugin that I use in a proprietary codebase that requires the JVM to invoked through a special wrapper script (which is used to configure LD_LIBRARY_PATH and jvm properties), and the wrapper script doesn't match regular java's argument passing either. So, I need to run a bunch of code to munge the project map into a command line with this java-invocation tool.

Does that clarify my usage scenarios?

tobias commented 11 years ago

Yes, thanks - that makes sense to me. I'm fine with merging this if @sattvik is. Assuming he gives it a thumbs up, would you be willing to add these functions to the README and add a test for hook-eval-in-project?

sattvik commented 11 years ago

On Thu Aug 23 11:01 2012, Tobias Crawley wrote:

Yes, thanks - that makes sense to me. I'm fine with merging this if @sattvik is. Assuming he gives it a thumbs up, would you be willing to add these functions to the README and add a test for hook-eval-in-project?

I think it's fine to include it. If you could please add the documentation and test, we can pull all these changes in and cut a new release.

dgrnbrg commented 11 years ago

I've added the tests and updated the README after a long hiatus. Can this be merged now?

Thanks!

sattvik commented 11 years ago

I'll take a look at it this weekend. So long as I don't run into any issues, my goal is to create a new release by Monday.

dgrnbrg commented 11 years ago

Cool -- I haven't changed anything functionally since last month; I just got swamped at work.

On Wed, Sep 26, 2012 at 5:00 PM, Daniel Solano Gómez < notifications@github.com> wrote:

I'll take a look at it this weekend. So long as I don't run into any issues, my goal is to create a new release by Monday.

— Reply to this email directly or view it on GitHubhttps://github.com/sattvik/leinjacker/pull/4#issuecomment-8905875.

tobias commented 11 years ago

Since I've pushed changes that may affect these commits, I'll handle merging them in.

dgrnbrg commented 11 years ago

Could you release a new version of leinjacker? I'd like to incorporate some of the new features into a plugin I'm working on, and I'd like to release the plugin as well.

Thanks!

On Thu, Sep 27, 2012 at 10:21 AM, Tobias Crawley notifications@github.comwrote:

Since I've pushed changes that may affect these commits, I'll handle merging them in.

— Reply to this email directly or view it on GitHubhttps://github.com/sattvik/leinjacker/pull/4#issuecomment-8939868.

tobias commented 11 years ago

@dgrnbrg - I just pushed v0.3.0 to clojars: https://clojars.org/leinjacker

dgrnbrg commented 11 years ago

Thank you!

On Mon, Oct 1, 2012 at 9:49 AM, Tobias Crawley notifications@github.comwrote:

@dgrnbrg https://github.com/dgrnbrg - I just pushed v0.3.0 to clojars: https://clojars.org/leinjacker

— Reply to this email directly or view it on GitHubhttps://github.com/sattvik/leinjacker/pull/4#issuecomment-9032472.