There was a file handle leak in the code as it was. It would never close the open reader against the jar resource. This will eventually cause JVM to be unable to open new files.
Functional Tests
----------------------
I'm using the code as I wrote it in my own project and there is now no file handle leak.
Passing in the project map as a parameter to eval-in-subprocess causes
havoc, as it has references to the functions reduce-dep-step and
reduce-repo-step in its metadata.
Changes to a native dependency that is not cleaned up will be warned
about to the user. In addition, when a dependency changes, only the
dependencies that actually changed will be checked for native
dependencies, speeding up restart time significantly when you change a
single dependency in a big project.
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.
Prior to this commit, the `lein release` task was not
really usable for releases that had qualifiers such
as `-alpha1`, `-beta2`, or `-RC1`.
The reason for this is that the code for parsing the
semver could not handle a qualifier like `-alpha1`
AND a `-SNAPSHOT` qualifier at the same time.
The default `:release-tasks` include a `bump-version`
at the `:release` level, and then the release, and
then a `bump-version` at the `:patch` level. If
you had a version that started out as `1.0.0-alpha1` *or*
`1.0.0-alpha1-SNAPSHOT`, then the `:release` bump
would always set the version to `1.0.0`. Then the
actual release would occur, and then the `:patch` bump
would take you to `1.0.1-SNAPSHOT`.
With this commit, `qualifier` and `snapshot` are
separated into two separate fields in the version map.
This allows us to modify the `bump-version` behavior
so that it works as one would expect with a qualifier
like `alpha`:
```clj
(is (= (bump-version "1.0.0-alpha1-SNAPSHOT" :release)
"1.0.0-alpha1"))
(is (= (bump-version "1.0.0-alpha1")
"1.0.0-alpha2-SNAPSHOT"))
```
This allows the default `:release-tasks` setup to be
used with qualifiers like alpha/beta.
The commit also adds a new `level` that can be passed
to the `change` task: `:qualifier`. If this level
is passed, then the qualifier will be incremented
instead of the major/minor/patch. It is a superset
of the existing alpha/beta/RC behavior but works with
arbitrary qualifier strings.
When namespaces use agents during load time, threads
are started in the agent threadpool which take 60 seconds to
end. This adds up to 60 seconds of stall time after the compile
task runs.
This patch checks to see if clojure.core/set-agent-send-off-executor!
exists, and if so, calls it with a Thread pool that has the keep
alive time set to 100 milliseconds.
Technically this could cause Thread churn, but practically most
namespace loading doesn't fire up enough Threads for thread
instantiation costs to add up to much.