This commit bends over backwards to add back support for java
classes in :main that was removed in 71e609c8a1. The crux of
the complexity was that when we try to require the namespace
relevant to the argument to `lein run`, we could get a
FileNotFoundException for two distinct reasons -- either the
namespace we were trying to run doesn't exist, in which case
we want to check if it was actually a class name; or the
namespace exists but it or some other dependency is trying
to require a namespace that doesn't exist. In the latter case
we definitely want the FileNotFoundException to propagate up
to the top. But distinguishing these two cases by examining
the exception is hacky at best, so the alternative adopted
here is to hold on to the exception, check if a class exists,
and if not, re-throw the exception.
This should handle the majority of use cases correctly. The
test added in 71e609c8a1 is still relevant and still passes.
lein run tries to support invoking static methods on classes by
swallowing FileNotFoundExceptions when requiring the namespace to run,
which can obscure the real error when there's a real issue loading a
namespace.
Phil said he wasn't interested in keeping the (undocumented) feature
around, so the easiest fix to the error message problem was to remove
that feature.
Added a test as well.
merged all commits to date which required adding "dev-resources" so a
test wouldn't fail
`bin\lein test` tested under windows (currently 2 failures and 1 error)
Fixes#1180, but in a way that's probably too clever.
Makes it possible to recursively descend into checkout dependencies
with the following addition to the `:user` profile:
`:checkout-deps-shares [#=(resolve leiningen.core.classpath/checkout-deps-paths)]`
Anyone using a %s pattern in their custom :target-path will get this
behaviour, but strings that don't have it will continue to behave as
normal.
Fixes#468.