Commit graph

570 commits

Author SHA1 Message Date
Phil Hagelberg
f822cedeac Add experimental support for :eval-in :nrepl. 2013-02-07 15:15:24 -08:00
Jean Niklas L'orange
0864e69455 Implement symlink?. 2013-02-07 20:49:00 +01:00
Tim McCormack
f7fbda14c8 Use -- to treat filenames as non-option args to gpg.
Ordinarily I'd also check that the filename was not "-", or perhaps
get the absolute path, but in this case I know the filename. (Otherwise
this could result in a hung process as gpg waited for stdin.)
2013-02-05 20:25:26 -05:00
Bruce Adams
9f20aa3bfd Remove superfluous exclusion of slf4j
The dependencies for pomegranate were cleaned up as of pomegranate-0.0.8. We no longer need to exclude slf4j. (Hard to claim this is important; I just happened to notice that it was not needed.)
2013-02-03 16:20:43 -05:00
Jean Niklas L'orange
c9c5cca4dc Make profile aliases available outside projects.
Fixes #978.

By adding an atom (to pop off used aliases to avoid recursive calls)
which contains :user :aliases from profiles, we can use those aliases
outside of project maps. Whenever looking up aliases, will check the
atom if we're not in a project.
2013-02-03 13:20:03 +01:00
Jean Niklas L'orange
3a0a1911f7 Fix typo in min-version-warning. 2013-02-03 11:48:16 +01:00
Jean Niklas L'orange
3045ed7111 Add support for ~/.lein/profiles.d. Closes #871.
Add support for profiles.d within the user's Leiningen home directory. All .clj
files within LEIN_HOME/profiles.d will be treated as maps merged into the
original profiles.clj (if existing).

Erroneous .clj file inside profiles.d emits an error message and will be treated
as nil.

A profile defined multiple times will error and "crash" the loading of profiles,
such that profiles return nil.

The errors will only be emitted once for user-friendliness.
2013-01-23 19:53:28 +01:00
Jean Niklas L'orange
730141f972 Memoize user/profiles. 2013-01-23 19:53:28 +01:00
Phil Hagelberg
be4ec8c81e Bump to 2.1.0-SNAPSHOT. 2013-01-19 20:39:17 -08:00
Phil Hagelberg
0cd13d8cdb Release 2.0.0. 2013-01-19 20:07:46 -08:00
Jean Niklas L'orange
4f2bc328d7 Gracefully stop reading input in sub-process. Fixes #934.
This commit handles three major bugs with the current way of redirecting input
from Leiningen to a sub-process:

- The redirection is never stopped. This means that typing on the keyboard after
  a sub-process has finished will crash the thread redirecting data from *in* to
  the sub-process' input stream, as it is closed.

- The redirection is buffered. This means that data intended to a subsequent
  sub-process may be sent to this sub-process instead.

- The redirection blocks instead of busy waits. For the output streams, this is
  perfectly fine and the recommended approach to avoid wasting cycles. However,
  this has some issues when done to an input stream: If the sub-process finishes
  while the thread block waiting for a character, we will be unable to stop the
  thread before a character has been read. The consequence is that a character
  originally intended to the subsequent sub-process will be given to the
  previous process.

These issues are solved by reading one byte at a time, busy wait on data and
gracefully exit when the sub-process has ended (through a mutable
variable/atom).
2013-01-18 01:02:15 +01:00
Phil Hagelberg
221d62a279 Merge pull request #932 from mgrubb/warn-on-user-in-project
Emit warning when user profile is in project files
2013-01-14 10:42:43 -08:00
Jean Niklas L'orange
1ea3c4c677 Treat :user in profile.clj as project map when outside of project. Fixes #931.
By treating the `:user` profile in `profile.clj` as the project map when one's
outside of a project, the default repositories among with any mentioned
repositories within the `:user` profile will be fetched without any issues. Also
works fine when `profile.clj` doesn't contain any `:user` profile or no
`profile.clj` exists.
2013-01-14 11:03:11 +01:00
Michael Grubb
ec435b48a6 Emit warning when user profile is in project files
This implements issue #890.
It warns if a :user profile is found in either project.clj or
a profiles.clj in the project directory.
2013-01-13 21:26:20 -06:00
Jean Niklas L'orange
fbc1804f86 Add tests to check ^:replace/^:displace behaviour. 2013-01-13 11:10:01 +01:00
Jean Niklas L'orange
2b40a3c8ec Prioritize metadata from :replace-vals and suppress from :displace. 2013-01-13 10:54:04 +01:00
Jean Niklas L'orange
e5511fe516 Back to 2.0.0-SNAPSHOT. 2013-01-13 10:38:54 +01:00
Phil Hagelberg
99f0ed7069 Release 2.0.0-RC2 2013-01-12 17:03:18 -08:00
Phil Hagelberg
b75658cff9 Be less specific in hooke-injection. 2013-01-12 14:44:50 -08:00
Phil Hagelberg
ccab537e56 Use default repos when non-nil project contains none. 2013-01-12 14:06:31 -08:00
Phil Hagelberg
e7b52a076d Oops, got the nesting wrong on that last one. 2013-01-12 13:20:54 -08:00
Phil Hagelberg
06fecc812a Use default repositories for plugins when outside project.
Fixes #928.
2013-01-12 12:56:39 -08:00
Phil Hagelberg
33bab94f7f Merge pull request #926 from redinger/normalize-profiles
Normalize profiles before merging them
2013-01-11 19:33:34 -08:00
Christopher Redinger
e053fe1930 Normalize profiles before merging them 2013-01-11 21:49:03 -05:00
Phil Hagelberg
c300908789 newnew's not newnew anymore; it's just new. 2013-01-11 10:55:55 -08:00
Phil Hagelberg
eb15a82e12 Back to 2.0.0-SNAPSHOT. 2013-01-10 16:59:36 -08:00
Phil Hagelberg
1e309c1a52 Release 2.0.0-RC1 2013-01-10 16:45:09 -08:00
Nelson Morris
b7c54adc4e Print checksum exceptions 2013-01-10 17:03:20 -06:00
Phil Hagelberg
5f6fd4f306 Move resolution failure messages to catch block in get-dependencies. 2013-01-10 13:31:46 -08:00
Phil Hagelberg
96adcdccc5 Fix tests re: central snapshots. 2013-01-10 11:40:15 -08:00
Phil Hagelberg
567a4f87bc Bump to latest lein-newnew. 2013-01-10 11:40:02 -08:00
Phil Hagelberg
15c5eb9287 Don't need to explicitly include clojars classic in project.clj. 2013-01-10 11:35:35 -08:00
Phil Hagelberg
adab79df77 Todos and news. 2013-01-10 11:35:18 -08:00
Phil Hagelberg
824c3dc511 Don't refer folks to the Releases repository docs yet. 2013-01-10 11:08:56 -08:00
Phil Hagelberg
c70fca859f Merge pull request #909 from hyPiRion/normalize-data-in-project-map
Normalize data in project map
2013-01-10 11:02:53 -08:00
Hugo Duncan
eb58efca7d Disable snapshots from maven central 2013-01-09 17:04:40 -05:00
Jean Niklas L'orange
ef3641c172 Add a repo test case which actually merges repositories. 2013-01-07 21:48:03 +01:00
Jean Niklas L'orange
88dfec8daf Add tests to ensure that repository merging works as intended. 2013-01-07 20:42:19 +01:00
Jean Niklas L'orange
4c1320255e Normalize repositories in project map before merging. Fixes #858. 2013-01-07 02:54:46 +01:00
Phil Hagelberg
3d3fb9cdb2 Clarify the exit docstring. 2013-01-02 22:32:30 -08:00
Phil Hagelberg
712ac9a017 Exclusion to pacify lein-pedantic. 2012-12-28 12:00:19 -08:00
Jean Niklas L'orange
27fe39d618 Fix ^:displace and ^:replace handling in meta-merge
An object with the metadata flag `:displace` set signals that, if a merge
conflict appears, this object is to be discarded. Likewise, `^:replace` signals
that this object should be kept in a merge conflict.

However, previous functionality only tested if the right element had the
`:replace` flag, or if the left element had the `:displace` flag. This commit
resolves this by checking whether the left element has a `:replace` flag and the
right element has a `:displace` flag, and handles accordingly to the semantics
explained in the previous paragraph.

Whenever two elements where both has the `:displace` flag is merged, the
leftmost is picked, and their metadata is merged. Likewise for the `:replace`
flag. The elements will not lose their `:displace` and `:replace` flags, as they
have not really been preferred over another element.

The `nil?` tests have been placed at the top to reflect that nil is the lack of
a value, not a value itself. As such, elements will not be "preferred" or
"discarded" over nil/nothing.
2012-12-28 04:28:34 +01:00
Phil Hagelberg
799bf696d3 Fix classpath test. 2012-12-26 10:07:57 -08:00
Nelson Morris
723671b607 Use aether data to figure out repository id for listener output
For "important" events, aether gives us enough info to figure
out which repo it is happening from.  Lets use it instead
of trying to match from project data.

Previously matching from the project data would be incorrect
and output failures or not output anything for transative repos.
2012-12-15 13:16:07 -06:00
Nelson Morris
c07259f875 Print checksum mismatch message
Previously the output for downloading files would just say "failed to find".
Instead output the fact checksums were invalid, and from which repository.
2012-12-15 11:13:00 -06:00
Phil Hagelberg
b15a1188db Upgrade to lein-newnew 0.3.6. Fixes #865. 2012-12-14 14:42:24 -08:00
Jean Niklas L'orange
d6ba16b9da Removes run task aliases within metadata. fix #882
Removes the task to be run residing within a project's metadata (inside
:without-profiles) in addition to the original map, in order to prevent
"with-profile" from reviving already used aliases.
2012-12-11 02:27:45 +01:00
Jean Niklas L'orange
493adefe34 Add :java-opts as an alias for :jvm-opts 2012-12-09 19:50:34 +01:00
Anthony Grimes
ba9e56f259 Add capability for selectors to be two functions (one checks the ns, one the vars)
This makes it so that a selector such as :only can prevent unnecessary loading
of namespaces that they aren't going to work on. It is a way for a selector
that knows which namespaces it will touch by the selector's arguments and the
namespace names themselves to not have to load all namespaces.

This commit also fixes a bug introduced by a recent pull request where
'namespaces' could not be resolved. Per discussion with technomancy, provided a
default test selector *always*.
2012-12-07 17:44:31 -06:00
Balint Erdi
d0dd2dcdcf Fix a leiningen-core project test case 2012-12-04 16:44:19 +01:00
David Greenberg
80cf398b50 Allow project's git repository to be different than project root
This allows for other directories to be used for the automatic
repository tagging. This is useful for repositories that contain
multiple projects, such as leiningen-core and leiningen, so that both
will have the correct repository tag information in their pom.xml.
2012-11-28 14:48:28 -05:00
Justin Balthrop
77327993ee don't propagate DRIP_INIT or DRIP_INIT_CLASS to subprocess 2012-11-19 13:07:53 -08:00
Bruce Adams
7495e10103 Bug fix for leading spaces in JVM_OPTS #856 2012-11-19 11:45:54 -05:00
Phil Hagelberg
24fd117104 Back to classic Clojars for a while.
Took longer than expected to get Releases working.
2012-11-18 05:43:27 -08:00
Phil Hagelberg
6d4ffe9a98 Add classic repo to Leiningen's own project.clj. 2012-11-15 07:07:52 -08:00
Phil Hagelberg
1fa23122ce Fix error message when there's an arity mismatch in apply-task. 2012-11-14 15:06:38 -08:00
Phil Hagelberg
8470f34c3f Fix global exclusions test broken by meta-merge changes. 2012-11-14 12:54:25 -08:00
Phil Hagelberg
d4a3708f44 Fix usages of when for return values. 2012-11-14 12:48:36 -08:00
Phil Hagelberg
2973d99652 Check Clojars releases repository instead of classic. Fixes #241. 2012-11-14 12:45:34 -08:00
Phil Hagelberg
4d9b8537cd Better docstrings in leiningen-core. 2012-11-12 15:15:12 -08:00
Phil Hagelberg
168d5e29b1 Accept optional not-found arg in lookup-alias. 2012-11-12 14:40:30 -08:00
Phil Hagelberg
359eed9627 Accept ^:replace metadata on *env*; don't always want to merge. 2012-11-12 14:40:30 -08:00
Phil Hagelberg
43110b873d Remove deprecated conj-dependencies function. 2012-11-12 14:40:30 -08:00
Justin Balthrop
c7cedb7db8 don't need a meta-merge to combine exclusion 2012-11-08 18:07:07 -08:00
Jacek Laskowski
bac476ce6d a typo 2012-11-09 01:31:15 +01:00
Justin Balthrop
8407b5906a fix bug when adding exclusions to dependencies with :displace metadata 2012-11-08 15:09:23 -08:00
Phil Hagelberg
e804b26716 Remove compatibility shims and warnings in preparation for 2.0.0. 2012-11-01 16:39:34 -07:00
Phil Hagelberg
3a0ab9b672 Tidy up user.clj and help.clj. 2012-10-31 11:51:23 -07:00
Phil Hagelberg
377153b1bc OK, I knew that was too clever. 2012-10-27 07:46:18 -07:00
Phil Hagelberg
9202b099ea Hooks that come from profiles can be rolled back. Fixes #802. 2012-10-26 19:25:35 -07:00
AtKaaZ
cf35d81c04 fix #836 trampoline EOF error, on windows 2012-10-27 00:05:08 +02:00
Phil Hagelberg
a5b833a0f4 Fix src/resource paths when with-profile is trampolined. Fixes #822. 2012-10-26 11:29:05 -07:00
Phil Hagelberg
55651a086d Add leiningen-core's pom.xml to fix #745.
[ci skip]
2012-10-25 21:29:24 -07:00
Phil Hagelberg
753d40723d clojure.walk strips metadata. Fixes #804. 2012-10-25 17:03:53 -07:00
Phil Hagelberg
dedb237dde Don't use colon in filename in when-stale. 2012-10-25 11:41:59 -07:00
Phil Hagelberg
ecdc783f2d repl task needs to disable pumping *in*. 2012-10-23 10:44:43 -07:00
Phil Hagelberg
abb9e44f56 Pump *in* to subprocesses as well.
There was a good reason we couldn't support this in earlier versions
of Leiningen, but it escapes me now. Perhaps it doesn't work on old
JDKs or there are platform-specific issues or something?
2012-10-23 09:53:30 -07:00
Phil Hagelberg
720a61ae65 Fix some typos in eval.clj tests.
[ci skip]
2012-10-20 15:02:34 -07:00
Phil Hagelberg
329b4b7fa6 Un-deprecate :auth profile since full-disk encryption is a good use case for it. 2012-10-10 10:04:30 -07:00
Justin Balthrop
0e02ad7164 switch with-profile to last-wins
This patch switches with-profile so that the last profile specified
wins. This is more in line with the way clojure.core/merge works.

For more info, see:
http://librelist.com/browser/leiningen/2012/9/12/changing-with-profile-from-first-wins-to-last-wins/#ff32b118546fa95d0960f2247e190c18
2012-10-08 18:27:40 -07:00
Justin Balthrop
9f37f53c5e move dependency and repository merging into meta-merge
This is accomplished with the :reduce metadata, which specifies the
reduce function to use when merging. This allows us to merge
dependencies and repositories deeply like other structures. Note that
dependencies are transformed into a map before they are merged and then
transformed back into a vector.

Also change the way that collections are merged. They used to be merged
by taking the right collection and prepending it to the left collection.
This behavior was needed for :*-paths in defproject, but it is not an
obvious default. Now, the default is to append the right collection, but
the :prepend metadata can be used to tell meta-merge to prepend instead.
By default, :source-paths, :resource-paths and :test-paths have :prepend
set to true.
2012-10-08 18:27:40 -07:00
Justin Balthrop
5893c1406a keep track of :active-profiles when merging
This is a list of all named profiles that have been merged in, after
following composite profile. This is different from :included-profiles
which is the list of profiles before composite profiles have been
expanded.
2012-10-08 18:27:40 -07:00
Justin Balthrop
5b76a2eb6a add leiningen.core.project/make
Move some defproject logic out of the macro into project/make.
2012-10-08 16:45:35 -07:00
Justin Balthrop
11037d7ddb rename profile-key-merge to meta-merge 2012-10-08 16:10:38 -07:00
Justin Balthrop
d24e36a63b move hooke-injection closer to where it is used 2012-10-08 15:46:51 -07:00
Chas Emerick
b06a04593a re-add support for :creds :gpg, add warning for anyone using e.g. :username :gpg to get all creds for a repo (gh-768) 2012-10-05 06:14:13 -04:00
Chas Emerick
268d723796 Add support for:
* namespaced keywords to control lookup of credentials in env vars
* using a vector to define a number of credential sources to be checked in series

(gh-768)
2012-10-05 06:09:54 -04:00
Phil Hagelberg
856207caf0 Load plugins in set-profiles. Fixes #772. 2012-10-04 16:24:36 -07:00
Phil Hagelberg
ff0e95baf0 Debug output in apply-task. 2012-10-04 09:36:21 -07:00
Justin Balthrop
123b929ec7 Fix environment passing to project JVM.
Runtime#exec takes an array of strings of the form "key=val", but we
were previously passing an array of interspersed keys and vals.
2012-09-27 13:46:35 -07:00
Justin Balthrop
c369447c8b support :os and :arch options in project map
Use :arch option to provide -d32 or -d64 option to project JVM.
2012-09-27 13:44:11 -07:00
Justin Balthrop
b7b61e9655 always extract native deps from snapshot jars
- fixes #796
- also add token param to when-stale, because otherwise multiple callers
  of with-stale can contaminate each other's results
2012-09-27 13:23:34 -07:00
Justin Balthrop
48bea66ea0 use -classpath instead of -cp so that jdb can be used for :java-cmd 2012-09-27 11:22:03 -07:00
Michael S. Klishin
dc9fd48376 Make LEIN_OFFLINE take precedence over what's in project.clj
Per discussion with @technomancy
2012-09-19 03:16:18 +04:00
Michael S. Klishin
387e624838 If LEIN_OFFLINE env var is set, assume offline mode by default. References #678. 2012-09-18 13:00:29 +04:00
Justin Balthrop
d702a234f5 fix truncated doc string for set-profiles 2012-09-10 12:15:47 -07:00
Phil Hagelberg
edfa52753e Wait no, that Postel's law invocation doesn't make sense. 2012-09-10 08:20:22 -07:00
Phil Hagelberg
5d37b41fbe Postel's law, I guess? 2012-09-06 10:26:04 -07:00
Nelson Morris
d254dae544 Reduce output for dependency resolution
Showing every failed repo lookup is bad for users.
They see the failure and get confused.

Hook up a custom listener that has the following behavior:

1. success -> print out artifact name, size, and repository name
2. failure -> ignore unless it is the last repo, then print out failure
   message with artifact name.

Fixes #610.
2012-09-05 14:59:53 -05:00
deduktion
e9386b7362 Update leiningen-core/src/leiningen/core/project.clj
use concat instead of merge to merge values, :plugin-repositories and :repositories are lists again 

with merge you will end up with a value for :repositories like [[repo {:url url}] ([pluginrepo {:url url}])]
instead of [[repo {:url url}] [pluginrepo {:url url}]]
2012-09-04 19:58:03 +03:00