Commit graph

92 commits

Author SHA1 Message Date
Raymond Huang
7cfa57980a Add test for deploying to a file repo 2016-11-03 23:42:39 -07:00
Chris Price
6c69f563f7 (#2216) Fix bug with managed deps in profiles w/:replace
Prior to this commit, profiles with `^:replace` on the dependencies
list would never end up having their dependencies vector normalized
so that it would have `nil` placeholders for the versions of
dependencies that were inheriting their version from `:managed-dependencies`.

This commit normalizes the dependencies vector of a profile during
initialization, to make sure that it will always be normalized.
2016-10-10 18:55:05 -07:00
Chris Price
5bd091a2bf Don't require nil for version in managed deps - fixes #2195
Prior to this commit, if you wanted to use modifiers such as
`:exclusions` or `:classifier` for a dependency whose version you
were managing with `:managed-dependencies`, you would need to
explicitly pass a `nil` as the version string in the dependency
tuple.  This commit adds some logic to coerce the vectors before
they are processed, so that if the version string is simply
omitted instead of being set to `nil`, the `nil` will be implicitly
inserted and things will continue to work as before.

This provides a slightly nicer and more intuitive UX for the
managed-dependencies feature.
2016-09-18 09:21:04 -07:00
Chris Price
3feae04e76 Fix checking for SNAPSHOT deps with managed deps - fixes #2205
This commit fixes #2205: when using managed dependencies in
a project, if the project itself was a non-SNAPSHOT version,
then when `lein install` and similar tasks were executed,
lein would check to make sure that none of the dependencies
were a SNAPSHOT version.  lein was checking that directly against
the `:dependencies` vector, which would cause an NPE if a dependency
didn't specify a version number (because it was inheriting it from
the `:managed-dependencies` section).

This commit fixes the bug by calling the code that merges the
`:dependencies` and `:managed-dependencies` vectors together prior
to performing the SNAPSHOT check.
2016-09-15 21:12:26 -07:00
Chris Price
7ea847d16f Clarify docs, add tests for transitive deps
This commit clarifies some things in the docs based on PR review.
It also adds additional test coverage for managed dependencies;
specifically, a case where two normal dependencies both have
a transitive dependency on the same library, but with different
versions.  The test validates that this conflict is properly
resolved via `:managed-dependencies`.
2016-06-30 10:29:18 -07:00
Chris Price
54fda200d7 (#2067) Improve test coverage for managed dependencies
This commit adds some additional dependencies to the test project
file for managed dependencies, and significantly increases the
coverage of the tests.
2016-06-22 14:24:38 -07:00
Chris Price
27782edb2e (#2067) add support for managed-dependencies
This commit provides initial support for `managed-dependencies`,
where dependency version numbers may be specified in a separate
section called `managed-dependencies`, and those version numbers
will be used for any deps in the main `dependencies` section
that do not explicitly specify a version number.

This is a precursor to being able to specify a "parent" project
that could be used to consolidate version numbers of common
dependencies across a large number of libraries.
2016-06-22 11:20:38 -07:00
Alex Hall
61fd4de9db Catch and handle fixture errors during tests 2016-04-29 21:56:23 +00:00
Jean Niklas L'orange
99d53683eb Print meta when eval-in-subprocess
This fixes the issue with reflection warnings in #2045, but
unfortunately breaks backwards compatibility with 1.1.0. So the lowest
version of Clojure Leiningen now supports is 1.2.0.
2016-02-04 23:24:37 +01:00
Jean Niklas L'orange
51f80c1298 Clojure 1.8.0 2016-01-21 11:08:58 +01:00
Phil Hagelberg
2ea050fc67 Merge pull request #1941 from towler73/master
added fix for components.xml merging.  If the description tag contain…
2015-07-30 08:45:16 +07:00
Brett Morgan
79f0d3a99a added fix for components.xml merging. If the description tag contained embedded html, it needs to be escaped in the resulting merged components.xml. 2015-07-23 11:12:07 -04:00
Stephen Nelson
f413b6d73f Add support for reader conditional files (cljc)
Clojure 1.7.0 will add support for reader conditionals:

http://dev.clojure.org/display/design/Reader+Conditionals

This patch adds reader conditional support to leiningen, in particular for
compilation (including aot and stale files) and testing.
2015-07-19 08:52:49 +12:00
Stephen Nelson
6e0ebc20f7 Upgrade clojure dependency to 1.7.0 2015-07-16 15:11:01 +12:00
Hugo Duncan
942cbee34a Fix jar task for :classifiers
The classified jar files were not being generated due to incorrect
arguments in code.
2014-10-24 21:08:55 -04:00
Jake Basile
8cd298ce33
Updated help text for test 2014-10-22 10:17:24 -05:00
Phil Hagelberg
37f3c2535f Merge pull request #1696 from hugoduncan/fix-profiles-on-aliases
Fix with-profile alias changes
2014-10-11 20:10:02 -07:00
Tim McCormack
225e24b2c5 Add regression test for file.encoding override 2014-09-23 09:29:26 -04:00
Hugo Duncan
c2cc98e660 Add tests for with-profile 2014-09-16 09:16:13 -04:00
Phil Hagelberg
9a0448041a Rename :core-default to :leiningen/default. 2014-09-09 16:24:12 -07:00
Hugo Duncan
2da05e6356 Add profile metadata
Adds :leaky and :pom-scope metadata for profiles.  The :dev, :test,
:base and :provided profiles are implemented in terms of these.

Profiles with :leaky metadata affect the pom and jar creation.

Profiles with a :pom-scope metadata of :test or :provided also affect
the dependencies of a pom.
2014-09-09 13:27:49 -04:00
Phil Hagelberg
c8806ff12e Revert addition of :downstream profile.
We need to revisit this in a way that doesn't involve hard-coding
profile names into the jar and pom tasks. The question of whether the
profile should be visible to downstream consumers should be determined
by data that's part of the profile (or metadata).
2014-09-08 10:05:21 -07:00
Phil Hagelberg
360e63d6b0 Fix a test. 2014-09-05 20:43:13 -07:00
Hugo Duncan
831d2cf0dd Add simple test for :project profile in pom 2014-09-01 13:44:01 -04:00
Phil Hagelberg
88181a4bbf Use dep-key for distinct call in pom task.
group/artifact version tuple isn't enough to de-dupe correctly.

Fixes #1494.
2014-04-22 15:03:34 -07:00
Jean Niklas L'orange
a296ff8918 Bump all Clojure 1.5.1 deps to 1.6.0. 2014-03-26 13:43:38 +01:00
Phil Hagelberg
e8da286ea7 Failing test for #1409. 2014-03-17 14:25:44 -07:00
Phil Hagelberg
a6bebc9459 Merge pull request #1470 from fredericksgary/issue-1469
lein run: don't catch app errors as require errors
2014-03-13 20:06:17 -07:00
Gary Fredericks
b19b305d58 Slightly more homogeneous test project names 2014-03-13 20:24:42 -05:00
Gary Fredericks
cc886d56a3 lein run: don't catch app errors as require errors
closes #1469

`lein run` currently has some special error handling around
FileNotFoundException which helps it decide what exactly it should
do. Unfortunately if the actual running of the given main function
itself throws a FileNotFoundException this is currently caught by
Leiningen and assumed to be a require error.

The simple solution is to run the main method outside of that error
handling block.

Regression test provided.
2014-03-13 20:17:59 -05:00
Trevor Hartman
fb2028b36e Update remaining 2 "great documentation" links 2013-12-17 08:53:36 -07:00
Marshall Bockrath-Vandegrift
5d64d83fd6 More nuanced merging of project defaults. 2013-10-14 19:59:18 -04:00
Marshall Bockrath-Vandegrift
39e3d57ec9 Implement :uberjar-merge-with requested in issue #973. 2013-10-05 13:56:57 -04:00
Jim Crossley
bd008f800e Fallback to .nrepl-port for 'repl :connect' subtask 2013-10-01 15:18:25 -04:00
Jean Niklas L'orange
89f06a49aa Add in a :plugin-tree test. 2013-08-29 15:21:08 +02:00
Jean Niklas L'orange
400d782272 Reenable java main run test.
Also more changes from use to require.
2013-08-24 17:36:21 +02:00
Vadim Platonov
5b97d9a472 fix(jar): Add directory entries to the jar file
According to the [jar file specification](http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html)

> For resource files with non-empty directory prefixes, mappings are also
> recorded at the directory level.  Only for classes with null package
> name, and resource files which reside in the root directory, will the
> mapping be recorded at the individual file level.

If needed, directory entries may be excluded using `:jar-exclusions`
regex like `#"^.*/$"`.
2013-08-21 14:30:10 +03:00
Gary Fredericks
08eaf70781 #1269: Skip tests differently when using :test-selectors
The old method skipped tests by adding a hook to
clojure.test/test-var, the problem being that :each fixtures
associated with the test have already run at that point, which is
unideal.

This change skips test by removing their :test metadata before running
the tests at all, which causes clojure.test to not see it as a test.

We use ns-interns to enumerate the vars, the same way clojure.test
does.
2013-07-31 23:29:19 -05:00
Phil Hagelberg
962ce20ae9 Scope :compile-path and :native-path under :target-path. 2013-07-24 20:55:23 -07:00
Phil Hagelberg
44eb86cfd5 Don't blow up on test failures in test-ns-hook.
Fixes #1201.
2013-07-06 15:57:26 -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
Joshua P. Tilles
437e63daab Adjust compile task to make use of regex fns
Also update documentation.
2013-03-19 16:12:08 -07:00
Marshall T. Vandegrift
24ca286d54 Test :provided profile interpretation by the uberjar task. 2012-11-17 17:38:11 -05:00
Phil Hagelberg
624bf2ae88 Move AOT of :main into uberjar task. Remove :skip-aot. 2012-11-12 15:30:43 -08:00
Jim Crossley
e770d5e649 Include namespace metadata in test-selector predicates, fixes #242
More specific metadata wins, e.g. deftest trumps its namespace.

Also tweaked the tests a bit so that actual/expected results are now
shown in the output.
2012-10-02 19:38:35 -04:00
Phil Hagelberg
5400be18a2 Fix pom and deploy tests. 2012-08-30 10:12:58 -07:00
Phil Hagelberg
22b427aca1 Fix some of the tests. 2012-08-29 19:50:53 -07:00
Phil Hagelberg
b5ea5a0f09 Normalize format of :deploy-repositories and :plugin-repositories too.
Fixes #752.
2012-08-28 09:15:21 -07:00
Phil Hagelberg
e7dadcd7b9 Remove commented-out shell wrapper remainders. 2012-08-01 09:42:20 -07:00
Phil Hagelberg
82d812eccb Fix pom tests to reflect sample project change. 2012-06-26 20:26:37 -07:00