sattvik/leinjacker — pull request #1 by tobias (2012-05-14 21:08:03+00:00)
Title: Additional cross lein version functions; multiple lein version testing

I finally found some time today to work on this. This patch includes the following changes:

* the `eval-in-project` ns is now named `eval`, and includes a `sh` function
* the `utils` ns now has `lein-home`, `lein-generation`, `read-lein-project`, and
`try-resolve-any`, which basically maps `try-resolve` to a collection of symbols,
returning the first success.
* there is now a sub-project for testing under multiple lein versions (in `test-project/`).
Its tests are run via the poorly named `test/leinjacker/multiple_leins_runner.clj`.
* cross version functions in `eval` and `utils` now have basic tests within `test-project/`
* `try-resolve` and `try-resolve-any` have tests in `test/leinjacker/utils_test.clj`

Running the tests currently is *slow*, since the mechanism for running the tests in the
sub-project does the following:

1. calls `lein install` to install leinjacker
2. invokes `lein`, `lein1`, and `lein2` in an effort to find the proper executable name
for each version (this is cached to a file upon success to avoid paying for this
every time)
3. calls `lein deps` in `test-project/` for lein1 to get the leinjacker jar in the
proper location
4. calls `lein{2} midje` in `test-project/` for each version

Steps 1 and 3 could be avoided if I could come up with a better way to get leinjacker
onto the sub-project's classpath, but I haven't yet found a way to do that that also
gets leinjacker's own dependencies loaded properly.

Any feedback is welcome!