Commit graph

3112 commits

Author SHA1 Message Date
Gary Fredericks
5e6d9fcfe7 Add back support for java classes in :main
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.
2013-05-22 22:25:15 -05:00
Jean Niklas L'orange
587e13bc7b Merge pull request #1183 from fredericksgary/master
Better error message for require failures
2013-05-22 18:17:37 -07:00
Gary Fredericks
71e609c8a1 Don't try static methods on lein run: better error msg
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.
2013-05-22 17:32:23 -05:00
Colin Jones
daebefbf50 Don't print nrepl server info on trampoline exit 2013-05-21 23:08:11 -05:00
Colin Jones
1679488845 Send init code to trampoline repl as well 2013-05-21 23:07:11 -05:00
Colin Jones
b90d188009 Replace launch-standalone/launch-nrepl with launch
REPLy already makes this exact decision
2013-05-21 21:56:31 -05:00
Colin Jones
f4e3606d9e Quote repl options for trampoline
This way clojure.main/main doesn't try to eval things that aren't
evalable, like {:init-ns foo.core}.
2013-05-21 21:52:55 -05:00
Phil Hagelberg
4f5370efcd Use RELEASE instead of a version range when resolving templates. 2013-05-21 10:53:46 -07:00
Alan Malloy
481def11dc Update GPG.md 2013-05-17 19:04:27 -07:00
Phil Hagelberg
3bb0cb4993 Clarify that pcmpl-lein.el is not part of Leiningen. 2013-05-17 13:46:44 -07:00
Phil Hagelberg
df783a64ca News updates. 2013-05-16 17:22:24 -07:00
Phil Hagelberg
1a47846578 Slashes are used here even on Windows it seems. 2013-05-16 17:21:25 -07:00
Phil Hagelberg
c5767cdaca Support :bootclasspath in :java-agents. 2013-05-16 13:45:40 -07:00
Phil Hagelberg
0d817f524f Looooooong liiiiiines.
[ci skip]
2013-05-16 13:44:10 -07:00
Phil Hagelberg
b9e94ddf92 Clean up sanitize-repo-name. 2013-05-16 10:34:17 -07:00
Phil Hagelberg
3d9d5b54b6 Don't use two-clause cond. 2013-05-16 10:34:07 -07:00
AtKaaZ
533f4725db fix repo name should not contain path delims under windows so test won't
fail
all tests pass under windows
2013-05-16 05:32:38 +03:00
AtKaaZ
0277ec3e41 Merge remote-tracking branch 'upstream/master' into testsUnderWindows1 2013-05-16 05:04:16 +03:00
Phil Hagelberg
a99d923cb2 Preliminary support for :java-agents. 2013-05-15 17:32:43 -07:00
Phil Hagelberg
d432377964 Hold back on :aot :all in the uberjar profile till 3.0. 2013-05-15 15:36:38 -07:00
Phil Hagelberg
94beeeffc4 Some todos. 2013-05-15 13:53:07 -07:00
Phil Hagelberg
cbff7f06fb Fix -o and -U aliases to be additive. 2013-05-15 13:53:01 -07:00
Phil Hagelberg
bba38c436a Don't block :user profile from ~/.lein/profiles.d. 2013-05-15 13:31:29 -07:00
AtKaaZ
ccb5ddf886 Merge remote-tracking branch 'upstream/master' into testsUnderWindows1 2013-05-15 09:40:07 +03:00
Phil Hagelberg
ba178d4076 Make uberjar use the filename returned by jar instead of recalculating. 2013-05-14 22:23:36 -07:00
Phil Hagelberg
c5e5ed61af Fix classpath test to match new checkout-deps behaviour. 2013-05-14 20:44:18 -07:00
AtKaaZ
718cfc3f4c oops still forgot some parens on their own line 2013-05-15 06:34:40 +03:00
AtKaaZ
5b1b097c64 fix 2 test failures which only showed on windows 2013-05-15 06:16:47 +03:00
AtKaaZ
9f984cbf46 Merge remote-tracking branch 'upstream/master' into testsUnderWindows1
Conflicts:
	leiningen-core/test/leiningen/core/test/classpath.clj
2013-05-15 06:16:13 +03:00
AtKaaZ
3521a21a9d moving 2 functions from utils to helper
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)
2013-05-15 02:39:23 +03:00
AtKaaZ
6c34ce7e6f Merge branch 'master' into testsUnderWindows1 2013-05-15 01:53:44 +03:00
Phil Hagelberg
7b32caf8f6 Merge default profiles in checkout-deps project reading.
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)]`
2013-05-14 15:15:40 -07:00
Phil Hagelberg
f21a2c4a64 Merge :uberjar profile when uberjarring.
Fixes #1170.
2013-05-14 14:31:01 -07:00
Phil Hagelberg
8d1818f973 Merge found :deploy-repositories entry with :repositories entry in deploy.
Fixes #765.
2013-05-14 14:06:53 -07:00
Phil Hagelberg
f40da67ece Make profile-scope-target-path work with anonymous profiles.
Also make it work in scenarios where the project map lacks :target-path.
2013-05-14 13:42:41 -07:00
Phil Hagelberg
a1d7b6f3ea Scope :target-path by profile unless it's the default (:base).
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.
2013-05-14 11:40:56 -07:00
AtKaaZ
208036f692 .gitignore some eclipse generated files + others 2013-05-13 21:08:38 +03:00
AtKaaZ
9588d307d5 Merge branch 'master' into testsUnderWindows1 2013-05-13 21:00:58 +03:00
Phil Hagelberg
f2c95e8f65 Default to writing repl-port in ~/.lein when outside projects.
Fixes #589.
2013-05-13 10:02:11 -07:00
Phil Hagelberg
2e9f2708cc Remove prefix clauses and :use from ns.
Prefix clauses break greppability and should be avoided.
2013-05-13 09:53:37 -07:00
Phil Hagelberg
cf679d4f1c Normalize :mirrors like :repositories. Fixes #1171. 2013-05-13 09:40:34 -07:00
AtKaaZ
a8e20e96ce fix some path errors in windows tests
lein test still has 2 failures and 1 error after this.
normalize-path should now handle absolute *nix paths correctly under
windows
addresses #1176
2013-05-13 08:15:55 +03:00
Phil Hagelberg
0ddd6ca629 Deploy ad-hoc files. 2013-05-12 14:11:24 -07:00
Colin Jones
b4660d52db Bump nrepl & clojure-complete dependencies 2013-05-12 15:19:07 -05:00
Colin Jones
0bfe4b8506 Delete .leiningen-cmdline tempfiles when complete
Thanks to @AtKaaz
fixes #1175
2013-05-12 15:13:55 -05:00
Colin Jones
efcca90cd4 Merge pull request #1177 from AtKaaZ/2StringsWere1
two strings were one for windows x86_64 test
2013-05-12 12:07:32 -07:00
AtKaaZ
eb30389ff8 two strings were one for windows x86_64 test 2013-05-12 20:41:24 +03:00
Phil Hagelberg
92615f15ce Don't create target/classes unless we're in an actual project.
Fixes #589.
2013-05-09 16:35:20 -07:00
Phil Hagelberg
1f65fa4468 Remove stray println. 2013-05-09 16:34:58 -07:00
Michał Marczyk
995ae1c570 #1166: reinstate support for :licenses, :licence, :licences 2013-05-09 16:08:34 -07:00