# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
by making it just parse the task source code files instead of actually
requiring/compiling them (second try).
This results in a 70% speed improvement on my machine (14s to 4s).
This will break when you do crazy stuff like:
$ lein trampoline do with-profile production compile, repl
but it's better than the old behaviour.
Fixes#1277.
0 arg task arglist was printing as `""` since passing `[project]` to
`next` resulted in `nil` which prints as `""`. Used `(comp vec next)`
instead to force it into `[]` which prints as `"[]"`.
This dependency pulls in a number of other dependencies which we don't
use but which are difficult for downstream packagers to deal with.
Include our own version of map-vals (because seriously, why is this
not already part of Clojure) and update-first (because re-forming
those problems without it crazy convoluted). But our implementation is
a fair bit shorter because it doesn't have to handle all the edge
cases.
Whenever composite profiles were added to project maps, their children
were also attached as active profiles. This confuses `with-profile` and
profile merging task where excluded profiles only remove the name of the
composite profile, not the subprofiles. This allows uberjar to exclude
the default profile without excluding subprofiles, without excluding
active subprofiles themselves.
So these task actions now produce sensible results:
`lein with-profile +dev uberjar` -> uberjar with dev-dependencies, but
without the other default profiles
`lein -U uberjar` -> uberjar with snapshot updates, but not with any
default dependencies added.
Fixes#1233.
This seem to handle #1233 correctly, but breaks a pom test. I assume
there's some part of the merge logic I've forgotten, so feel free to
peek around and comment on what I've currently done.
When the default behavior for `:jvm-opts` is additive, it can lead to
unexpected results if a project tries to add its own options which
conflict with the defaults. For example, the following setting:
:jvm-opts ["-XX:-TieredCompilation"]
Results in a JVM command line like this, in which the project's JVM
options are overridden by the defaults:
-XX:-TieredCompilation -XX:+TieredCompilation -XX:TieredStopAtLevel=1
By setting :displace metadata on the default :jvm-opts, any project
configuration of :jvm-opts will replace the defaults.
Fixes issues when a task is applied via trampoline:
Exception in thread "main" java.io.FileNotFoundException: /tmp/form-init2098686718977910298.clj (No such file or directory)
Ensures that the form can be read by read-string. Fixes issues when
the form is lazy, which result in invalid init files like:
clojure.lang.LazySeq@451d3cd3
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.
It turns out that #1162 wasn't that helpful because the project
argument keeps changing. This new version makes the real worker get a
filtered version of project, so that memoization hits are much more
likely.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
get-dependencies is expensive and sometimes gets called multiple times
with the same arguments. This pretty consistently knocks a couple
tenths of a second off of the extremely common
`lein repl < /dev/null`.
For odd cases where leiningen is called without the wrapper shell script, any occurence of `:min-lein-version` will throw an exception since `leiningen-version` will return nil.
This fixesjenkinsci/leiningen-plugin#1 for instance.
I see two other ways to fix this:
- have the version be propagated from project.clj directly, through substitution
- let leiningen-version return a string that always passes or always fails (not sure which is best) the `:min-lein-version` requirement
Fixes#1061.
This also incorporates the new environment variable
LEIN_NEW_UNIX_NEWLINES, for people who prefer to have '\n' as their
newline on non-unix operating systems.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This eliminates the need to exclude dynapath, since pomegranate and
bultitude now use the same version. This also updates core's pom.xml
with other recent version updates.
Mostly gets project maps in a format suitable for eval-in-project
(including the repositories), but also number-ifies port for aether (the
way the real URL.getPort method behaves).
Use the new :repository-session-fn keyword for pomegranate
to add a DependencyChainFilter that checks for version ranges.
We store them in an atom because this might happen on another thread,
and we need to allow all of the ranges to be found.
Fixes#734
Throws an ex-info rather than calling abort to avoid the "Leiningen has
encountered a critical error and will now exit." message.
Adds a check for a :suppress-msg key before printing the exception message in
leiningen.core.main/main.
This fixes the issue causing the build failures. The root of it is
that dynapath was allowing pomegranate to modify the boot classloader,
which caused multiple copies of the same class to be loaded.
Refactored warn-user-repos to take an argument to enable testing.
The tests are different depending on whether
LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS is set or not. This is not ideal, but
there doesn't seem to be a good way of altering the environment variables in
clojure.
Can be used to suppress warnings about repositories in user level profiles. Also
adds the list of profiles containing :repositories when not suppressed.
An alias such as {"doc" ["with-profile" "+doc" "doc"]} was leading to a stack
overflow when executed.
This was due to the project being reload when with-profile calls set-profiles,
thus re-instating the aliases that have been removed by remove-alias.
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.)
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.)
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.
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.
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).
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.
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.
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.
Previously the output for downloading files would just say "failed to find".
Instead output the fact checksums were invalid, and from which repository.
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.
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*.
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.
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?
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.
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.
* 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)
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.
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}]]
On some platforms, eg. Mac, it may be more desirable to use an executable other
than 'gpg' for signing and encryption, and it may not be possible to symlink to
'gpg'. This allows the gpg executable used in lein to be specified via LEIN_GPG.
You can use ~/.lein/leinrc or ~/.leinrc to set LEIN_GPG by adding
'export LEIN_GPG=your-gpg' to either of those files.
On a coworker's Mac, the default file encoding was apparently
MacRoman. The -Dfile.encoding=UTF-8 that's in the lein shell script
wasn't being propogated to subprocesses which caused rage and the
replacement character.
Don't call set-profiles from leiningen.core.project/read because it
calls load-middleware, and we want to wait to do that for the first time
in init-project. To solve this, I added init-profiles which is called by
both read and set-profiles.
Also clean up init-project and move code duplicated in set-profiles into
activate-middleware. We now always load hooks and certificates when
activating middleware, and load-certificates is actually called twice in
the course of init-project. To make sure load-certificates is
idempotent, we memoized leiningen.core.ssl/register-scheme.
Both now expect a full var, though hooks will fall back to activate in
the provided namespace for compatibility.
Also, use the following convention for plugin auto hooks and middleware:
- Assuming your plugin is called lein-config
- Put hooks you want auto-loaded in lein-config.plugin/hooks
- Put middleware you want auto-applied in lein-config.plugin/middleware