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.
Ensures `-XX:-OmitStackTraceInFastThrow` is always included by default
regardless of user's LEIN_JVM_OPTS. This setting can be overridden in
other profiles by the user.
Aliases are higher order, but also attempts to keep track of tasks via
:arglists metadata. The :arglists update function assumed all tasks
would start with a project arg. However, this isn't necessary: A task
may e.g. have the form [& args] and destructure the project arg inside
the function. This caused lein to incorrectly assume that appending more
arguments to the tasks was an error. (The only tasks I know of right now
that does this is mine, so I should probably take the hint)
I also decided to clean up the drop-partial-args function a bit to make
it more readable.
When we expand composite profiles, we may end up with multiple identical
profiles in the resulting list. However, we should only merge a profile
at most once. To fix this, we dedupe the list and retain the _last_
profile mentioned. We retain the last instead of the first as this
prioritises the last profile merges, which is somewhat important for
tasks like repl, uberjar, and to some extent `with-profile +foo`.
It might be interesting to see if we can get away from this in 3.0.0,
for example by saying that
(= (merge-profiles project [:a]) (merge-profiles project [:a :a])).
Fixes#1824 and fixes#2001.
This isn't a perfect solution to error messages, as GPG bypasses the
stdin and sends data directly to the terminal. As such, things from
"stdin" is printed immediately, whereas stderr is printed through the
JVM. As a consequence, it's almost always the case that the stdin lines
are printed before the stderr lines, even though GPG usually sends them
in the opposite order. But it should give you a better indication when
something bad has happened.
Issue #1904 may accidentally be solved as well, as we now have a
shutdown hook on GPG.
Because on Cygwin JAVA_CMD will be set to an UNIX path. This will result
in a "File not found" exception when the native Leiningen JAVA process
will execute JAVA_CMD.
Checked upgrade command. Condition was wrong and self-modifying batch code
is just ugly.
Testing:
- Remove 2.5.3 JAR file. This will be re-loaded by calling self-install
on the loaded batch file.
- Execute "bin\lein.bat upgrade 2.5.3".
- The batch file will be reverted to the 2.5.3 state and JAR file loaded.