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.
Projects created by "lein new" are meant to be licensed under the EPL as noted
in project.clj and README.md. One requirement of the EPL is, however, that "a
copy of this Agreement [the EPL] must be included with each copy of the
Program." [0].
This means that projects created by leiningen cannot be legally distributed if
the author fails to add the LICENSE him/herself. This patch fixes this issue
by creating a LICENSE file with a plain text copy of the EPL 1.0 (cf. [0]) by
default for new projects.
[0] http://www.eclipse.org/legal/epl-v10.html → 3. REQUIREMENTS
Ref #1260, all uberjars generated without any specific profile
additions/deletions are now put in the folder `target/uberjar+provided`.
That's not intentional, right?
We want missing namespaces in :aot to not be silently ignored.
Implemented by removing the file-existence check from the function
that determines which namespaces need to be compiled.
This means we won't get the error if you compile an existing namespace
and subsequently delete the *.clj file. Oh well.
Despite the documentation on java.util.jar.Manifest [1], the Manifest class
seems to require an endline in its input. If not, it drops the last line (on my
system, version [2], anyway).
[1] http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html
[2] $ java -version
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
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.
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)
Running deps on a project that includes ring causes an error
extracting the zip file for native deps, but only when you do it from
the first test in deps.clj and even then only when doing a full test
run.
Add :signing {:gpg-key "..."} option to project maps (global value)
and to :deploy-repositories maps (per-repo value). Does not yet work
in :repositories specs.
Also:
* Document per-repo :sign-releases option
* Delete unused defn deploy/signature-for
Adds a :classifiers project key that takes a map from classifier keyword to
profile map.
:classifiers {:tests {:source-paths ^:replace ["test"]
:resource-paths ^:replace []}}
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.
Enforces a nREPL dependency and a clojure-complete dependency for the :repl
profile. Previously, the first found :repl profile from
`project.clj`-`profiles.clj`-default was returned and merged into the real
profile. Now all :repl profiles that are found are merged into the active
profile.
The dependencies are tagged with the ^:displace tag, and as such will be
discarded if a collision occurs.
The changes made `repl-profile-in-project` fail as it did not contain
`leiningen.core.project/empty-dependencies`, which has a :reduce tag in its
metadata for handling dependency merging. The dependency merger expands the
version to its url, hence the change to a url map.
Also removed a TODO from the file, fixed by 27fe39d.
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.
The help task will first look for static help under
'leiningen/help/task-subtask', then for a function name 'help-subtask' in the
subtask's namespace, then a docstring on the subtask function. For the latter
two options, the arglists are also printed.
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.
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.
Reading a project should be side affect free. init-project modifies the current
classloader (and possible installs a new context classloader), so should not be
part of leiningen.core.project/read.
We intentionally don't try to support every single Lein 1 option because there is no way
to do everything Ant javac task can do with JDK's javac API. And it's also not necessary
because many of those features are very opinionated at best.
1) add java-source-paths; #474.
2) make some good tests
3) remove :test :dev and :default profiles for maven info
4) use :test, :dev, :default profiles for test info
Take some code from depot
Take the git scm code from lein 1.x
Update sample.project.clj with multiple source/test directories and extensions
Creates a similiar pom for sample.project.clj as lein 1.x
Use build-helper-maven-plugin for multiple source directories
The classpath was changed to use absolute paths for the checkout
dependencies. They were pointing to the wrong directory since the
working directory would be the leiningen project instead of the
test project.
This adds the absolute paths for test projects back, as just
changing the classpath does not help for the other tasks.
The test.helper needed to change the project map for the test projects
because eval-in-project uses get-classpath, which will return the
relative paths for some directories. This breaks in this case since
the working directory is not the root of the test project.
Calling System/gc can help release files on windows.
It will hopefuly help with issues such as #252 and #309.
I wasn't able to reproduce those two issues on Windows
Vista, but I have experienced a related problem when
running the leiningen test suite when some jar files
failed to be deleted. Calling System/gc resolved the
issue in that case.
On Windows, delete-file-recursively sometimes fails
to delete certain jar files, which results in cascading
test failures.
An explicit call to System/gc seems to solve the problem
on Windows Vista.