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.