@@ -13,31 +13,36 @@
Leiningen is for automating Clojure projects without setting your hair on fire.
+Note: the canonical repository for Leiningen is [on
+Codeberg](https://codeberg.org/leiningen/leiningen) but we maintain [a
+mirror on GitHub](https://github.com/technomancy/leiningen) for the
+time being in order to ease the transition. Please update your links
+and git remotes.
+
## Installation
-If your preferred
-[package manager](https://github.com/technomancy/leiningen/wiki/Packaging)
-offers a recent version of Leiningen, try that first as long as it has version 2.x.
+If your preferred [package manager](https://wiki.leiningen.org/Packaging)
+offers a recent version of Leiningen, try that first.
Leiningen installs itself on the first run of the `lein` shell script; there is no
separate install script. Follow these instructions to install Leiningen manually:
-1. Make sure you have Java installed; OpenJDK version 8 is recommended at this time.
-2. [Download the `lein` script from the `stable` branch](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein)
- of this project.
-3. Place it on your `$PATH`. (`~/bin` is a good choice if it is on your path.)
-4. Set it to be executable. (`chmod +x ~/bin/lein`)
+1. Make sure you have Java installed; [OpenJDK](https://adoptium.net) is recommended
+2. [Download the `lein` script from the `stable` branch](https://codeberg.org/leiningen/leiningen/raw/branch/stable/bin/lein)
+ of this project
+3. Place it on your `$PATH` (`/usr/local/bin` for example)
+4. Set it to be executable. (`sudo chmod +x /usr/local/bin/lein`)
5. Run it.
Windows users can use the above script in the Linux subsystem or try
-[the batch file](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat) or
-[Powershell version](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.ps1)
+[the batch file](https://codeberg.org/leiningen/leiningen/raw/branch/stable/bin/lein.bat) or
+[PowerShell version](https://codeberg.org/leiningen/leiningen/raw/branch/stable/bin/lein.ps1)
instead.
## Basic Usage
The
-[tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
+[tutorial](https://codeberg.org/leiningen/leiningen/src/stable/doc/TUTORIAL.md)
has a detailed walk-through of the steps involved in creating a new
project, but here are the commonly-used tasks:
@@ -73,19 +78,19 @@ The `project.clj` file in the project root should look like this:
(defproject myproject "0.5.0-SNAPSHOT"
:description "A project for doing things."
:license "Eclipse Public License 1.0"
- :url "http://github.com/technomancy/myproject"
+ :url "https://codelab.org/technomancy/myproject"
:dependencies [[org.clojure/clojure "1.8.0"]]
:plugins [[lein-tar "3.2.0"]])
```
The `lein new` task generates a project skeleton with an appropriate
starting point from which you can work. See the
-[sample.project.clj](https://github.com/technomancy/leiningen/blob/stable/sample.project.clj)
+[sample.project.clj](https://codeberg.org/leiningen/leiningen/src/stable/sample.project.clj)
file (also available via `lein help sample`) for a detailed listing of
configuration options.
The `project.clj` file can be customized further with the use of
-[profiles](https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md).
+[profiles](https://codeberg.org/leiningen/leiningen/src/stable/doc/PROFILES.md).
## Documentation
@@ -93,38 +98,38 @@ Leiningen documentation is organized as a number of guides:
### Usage
- * [Tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md) (start here if you are new)
- * [FAQ](https://github.com/technomancy/leiningen/blob/stable/doc/FAQ.md)
- * [Profiles](https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md)
- * [Deployment & Distribution of Libraries](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
- * [Sample project.clj](https://github.com/technomancy/leiningen/blob/stable/sample.project.clj)
- * [Polyglot (e.g. Clojure/Java) projects](https://github.com/technomancy/leiningen/blob/stable/doc/MIXED_PROJECTS.md)
+ * [Tutorial](https://codeberg.org/leiningen/leiningen/src/stable/doc/TUTORIAL.md) (start here if you are new)
+ * [FAQ](https://codeberg.org/leiningen/leiningen/src/stable/doc/FAQ.md)
+ * [Profiles](https://codeberg.org/leiningen/leiningen/src/stable/doc/PROFILES.md)
+ * [Deployment & Distribution of Libraries](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)
+ * [Sample project.clj](https://codeberg.org/leiningen/leiningen/src/stable/sample.project.clj)
+ * [Polyglot (e.g. Clojure/Java) projects](https://codeberg.org/leiningen/leiningen/src/stable/doc/MIXED_PROJECTS.md)
### Development
-* [Writing Plugins](https://github.com/technomancy/leiningen/blob/stable/doc/PLUGINS.md)
-* [Writing Templates](https://github.com/technomancy/leiningen/blob/stable/doc/TEMPLATES.md)
-* [Contributing](https://github.com/technomancy/leiningen/blob/stable/CONTRIBUTING.md)
-* [Building Leiningen](https://github.com/technomancy/leiningen/blob/stable/CONTRIBUTING.md#bootstrapping)
+* [Writing Plugins](https://codeberg.org/leiningen/leiningen/src/stable/doc/PLUGINS.md)
+* [Writing Templates](https://codeberg.org/leiningen/leiningen/src/stable/doc/TEMPLATES.md)
+* [Contributing](https://codeberg.org/leiningen/leiningen/src/stable/CONTRIBUTING.md)
+* [Building Leiningen](https://codeberg.org/leiningen/leiningen/src/stable/CONTRIBUTING.md#bootstrapping)
## Plugins
Leiningen supports plugins which may introduce new tasks. See
-[the plugins wiki page](https://github.com/technomancy/leiningen/wiki/Plugins)
+[the plugins wiki page](https://wiki.leiningen.org/Plugins)
for a full list. If a plugin is needed for successful test or build
runs, (such as `lein-tar`) then it should be added to `:plugins` in
project.clj, but if it's for your own convenience (such as
`lein-pprint`) then it should be added to the `:plugins` list in the
`:user` profile in `~/.lein/profiles.clj`. See the
-[profiles guide](https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md)
+[profiles guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/PROFILES.md)
for details on how to add to your `:user` profile. The
-[plugin guide](https://github.com/technomancy/leiningen/blob/stable/doc/PLUGINS.md)
+[plugin guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/PLUGINS.md)
explains how to write plugins.
## License
-Source Copyright © 2009-2021 Phil Hagelberg, Alex Osborne, Dan Larkin, and
-[contributors](https://github.com/technomancy/leiningen/contributors).
+Source Copyright © 2009-2022 Phil Hagelberg, Alex Osborne, Dan Larkin, and
+contributors.
Distributed under the Eclipse Public License, the same as Clojure
uses. See the file COPYING.
diff --git a/bin/lein b/bin/lein
index a24bce5a7..b883b7b02 100755
--- a/bin/lein
+++ b/bin/lein
@@ -4,13 +4,9 @@
# somewhere on your $PATH, like ~/bin. The rest of Leiningen will be
# installed upon first run into the ~/.lein/self-installs directory.
-function msg {
- echo "$@" 1>&2
-}
-
-export LEIN_VERSION="2.9.9-SNAPSHOT"
+export LEIN_VERSION="2.11.3-SNAPSHOT"
# Must be sha256sum, will be replaced by bin/release
-export LEIN_CHECKSUM='2a0e9114e0d623c748a9ade5d72b54128b31b5ddb13f51b04c533f104bb0c48d'
+export LEIN_CHECKSUM='7d31ae23ae769e927438b0cd55d15a93e7dabab09fd4fc15877979161e108774'
case $LEIN_VERSION in
*SNAPSHOT) SNAPSHOT="YES" ;;
@@ -36,6 +32,10 @@ else
cygwin=false
fi
+function msg {
+ echo "$@" 1>&2
+}
+
function command_not_found {
msg "Leiningen couldn't find $1 in your \$PATH ($PATH), which is required."
exit 1
@@ -119,87 +119,7 @@ function self_install {
fi
}
-NOT_FOUND=1
-ORIGINAL_PWD="$PWD"
-while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
-do
- cd ..
- if [ "$(dirname "$PWD")" = "/" ]; then
- NOT_FOUND=0
- cd "$ORIGINAL_PWD"
- fi
-done
-
-export LEIN_HOME="${LEIN_HOME:-"$HOME/.lein"}"
-
-for f in "/etc/leinrc" "$LEIN_HOME/leinrc" ".leinrc"; do
- if [ -e "$f" ]; then
- source "$f"
- fi
-done
-
-if $cygwin; then
- export LEIN_HOME=$(cygpath -w "$LEIN_HOME")
-fi
-
-LEIN_JAR="${LEIN_JAR:-${LEIN_HOME}/self-installs/leiningen-${LEIN_VERSION}-standalone.jar}"
-
-# normalize $0 on certain BSDs
-if [ "$(dirname "$0")" = "." ]; then
- SCRIPT="$(which "$(basename "$0")")"
- if [ -z "$SCRIPT" ]; then
- SCRIPT="$0"
- fi
-else
- SCRIPT="$0"
-fi
-
-# resolve symlinks to the script itself portably
-while [ -h "$SCRIPT" ] ; do
- ls=$(ls -ld "$SCRIPT")
- link=$(expr "$ls" : '.*-> \(.*\)$')
- if expr "$link" : '/.*' > /dev/null; then
- SCRIPT="$link"
- else
- SCRIPT="$(dirname "$SCRIPT"$)/$link"
- fi
-done
-
-BIN_DIR="$(dirname "$SCRIPT")"
-
-export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
-
-# This needs to be defined before we call HTTP_CLIENT below
-if [ "$HTTP_CLIENT" = "" ]; then
- if type -p curl >/dev/null 2>&1; then
- if [ "$https_proxy" != "" ]; then
- CURL_PROXY="-x $https_proxy"
- fi
- HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
- else
- HTTP_CLIENT="wget -O"
- fi
-fi
-
-# This needs to be defined before we call SHASUM_CMD below
-if [ "$SHASUM_CMD" = "" ]; then
- if type -p sha256sum >/dev/null 2>&1; then
- export SHASUM_CMD="sha256sum"
- elif type -p shasum >/dev/null 2>&1; then
- export SHASUM_CMD="shasum --algorithm 256"
- elif type -p sha256 >/dev/null 2>&1; then
- export SHASUM_CMD="sha256 -q"
- else
- command_not_found sha256sum
- fi
-fi
-
-# When :eval-in :classloader we need more memory
-grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null && \
- export LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Xms64m -Xmx512m"
-
-if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
- # Running from source checkout
+function run_from_source() {
LEIN_DIR="$(cd $(dirname "$BIN_DIR");pwd -P)"
# Need to use lein release to bootstrap the leiningen-core library (for aether)
@@ -242,52 +162,17 @@ if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
else
add_path CLASSPATH "$(cat "$LEIN_DIR/leiningen-core/.lein-bootstrap" 2> /dev/null)"
fi
-else # Not running from a checkout
+}
+
+function run_from_checkout() {
add_path CLASSPATH "$LEIN_JAR"
if [ "$LEIN_USE_BOOTCLASSPATH" != "no" ]; then
LEIN_JVM_OPTS="-Xbootclasspath/a:$LEIN_JAR $LEIN_JVM_OPTS"
fi
+}
- if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
- self_install
- fi
-fi
-
-if [ ! -x "$JAVA_CMD" ] && ! type -f java >/dev/null
-then
- msg "Leiningen couldn't find 'java' executable, which is required."
- msg "Please either set JAVA_CMD or put java (>=1.6) in your \$PATH ($PATH)."
- exit 1
-fi
-
-export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-${JAVA_CMD:-java}}"
-
-if [[ -z "${DRIP_INIT+x}" && "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
- export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
- export DRIP_INIT_CLASS="clojure.main"
-fi
-
-# Support $JAVA_OPTS for backwards-compatibility.
-export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
-
-# Handle jline issue with cygwin not propagating OSTYPE through java subprocesses: https://github.com/jline/jline2/issues/62
-cygterm=false
-if $cygwin; then
- case "$TERM" in
- rxvt* | xterm* | vt*) cygterm=true ;;
- esac
-fi
-
-if $cygterm; then
- LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Djline.terminal=jline.UnixTerminal"
- stty -icanon min 1 -echo > /dev/null 2>&1
-fi
-
-# TODO: investigate http://skife.org/java/unix/2011/06/20/really_executable_jars.html
-# If you're packaging this for a package manager (.deb, homebrew, etc)
-# you need to remove the self-install and upgrade functionality or see lein-pkg.
-if [ "$1" = "self-install" ]; then
+function cmd_self_install() {
if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
cat <<-'EOS' 1>&2
Running self-install from a checkout is not supported.
@@ -297,7 +182,9 @@ if [ "$1" = "self-install" ]; then
fi
msg "Manual self-install is deprecated; it will run automatically when necessary."
self_install
-elif [ "$1" = "upgrade" ] || [ "$1" = "downgrade" ]; then
+}
+
+function cmd_up_downgrade() {
if [ "$LEIN_DIR" != "" ]; then
msg "The upgrade task is not meant to be run from a checkout."
exit 1
@@ -347,7 +234,9 @@ elif [ "$1" = "upgrade" ] || [ "$1" = "downgrade" ]; then
exit 1;;
esac
fi
-else
+}
+
+function cmd_run {
if $cygwin; then
# When running on Cygwin, use Windows-style paths for java
ORIGINAL_PWD=$(cygpath -w "$ORIGINAL_PWD")
@@ -396,7 +285,6 @@ else
"$LEIN_JAVA_CMD" \
-Dfile.encoding=UTF-8 \
-Dmaven.wagon.http.ssl.easy=false \
- -Dmaven.wagon.rto=10000 \
$LEIN_JVM_OPTS \
-Dleiningen.input-checksum="$INPUT_CHECKSUM" \
-Dleiningen.original.pwd="$ORIGINAL_PWD" \
@@ -424,4 +312,146 @@ else
exit $EXIT_CODE
fi
fi
+}
+
+# cd to the project root, if applicable
+NOT_FOUND=1
+ORIGINAL_PWD="$PWD"
+while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
+do
+ cd ..
+ if [ "$(dirname "$PWD")" = "/" ]; then
+ NOT_FOUND=0
+ cd "$ORIGINAL_PWD"
+ fi
+done
+
+# User init
+if [ "$LEIN_HOME" = "" ]; then
+ # Prefer the old location if present
+ if [ -d "$HOME/.lein" ]; then
+ export LEIN_HOME="$HOME/.lein"
+ elif [ -d "$XDG_CACHE_HOME/leiningen" ]; then
+ export LEIN_HOME="$XDG_CACHE_HOME/leiningen"
+ else
+ export LEIN_HOME="$HOME/.lein"
+ fi
+fi
+
+for f in "/etc/leinrc" "$LEIN_HOME/leinrc" ".leinrc"; do
+ if [ -e "$f" ]; then
+ source "$f"
+ fi
+done
+
+if $cygwin; then
+ export LEIN_HOME=$(cygpath -m "$LEIN_HOME")
+fi
+
+# normalize $0 on certain BSDs
+if [ "$(dirname "$0")" = "." ]; then
+ SCRIPT="$(which "$(basename "$0")")"
+ if [ -z "$SCRIPT" ]; then
+ SCRIPT="$0"
+ fi
+else
+ SCRIPT="$0"
+fi
+
+# resolve symlinks to the script itself portably
+while [ -h "$SCRIPT" ] ; do
+ ls=$(ls -ld "$SCRIPT")
+ link=$(expr "$ls" : '.*-> \(.*\)$')
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT="$(dirname "$SCRIPT"$)/$link"
+ fi
+done
+
+BIN_DIR="$(dirname "$SCRIPT")"
+
+
+LEIN_JAR="${LEIN_JAR:-${LEIN_HOME}/self-installs/leiningen-${LEIN_VERSION}-standalone.jar}"
+
+export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
+
+# This needs to be defined before we call HTTP_CLIENT below
+if [ "$HTTP_CLIENT" = "" ]; then
+ if type -p curl >/dev/null 2>&1; then
+ if [ "$https_proxy" != "" ]; then
+ CURL_PROXY="-x $https_proxy"
+ fi
+ HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
+ else
+ HTTP_CLIENT="wget -O"
+ fi
+fi
+
+# This needs to be defined before we call SHASUM_CMD below
+if [ "$SHASUM_CMD" = "" ]; then
+ if type -p sha256sum >/dev/null 2>&1; then
+ export SHASUM_CMD="sha256sum"
+ elif type -p shasum >/dev/null 2>&1; then
+ export SHASUM_CMD="shasum --algorithm 256"
+ elif type -p sha256 >/dev/null 2>&1; then
+ export SHASUM_CMD="sha256 -q"
+ else
+ command_not_found sha256sum
+ fi
+fi
+
+# When :eval-in :classloader we need more memory
+grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null && \
+ export LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Xms64m -Xmx512m"
+
+if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
+ run_from_source "$1"
+else
+ run_from_checkout "$1"
+
+ if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
+ self_install
+ fi
+fi
+
+if [ ! -x "$JAVA_CMD" ] && ! type -f java >/dev/null
+then
+ msg "Leiningen couldn't find 'java' executable, which is required."
+ msg "Please either set JAVA_CMD or put java (>=1.6) in your \$PATH ($PATH)."
+ exit 1
+fi
+
+export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-${JAVA_CMD:-java}}"
+
+if [[ -z "${DRIP_INIT+x}" && "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
+ export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
+ export DRIP_INIT_CLASS="clojure.main"
+fi
+
+# Support $JAVA_OPTS for backwards-compatibility.
+export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
+
+# Handle jline issue with cygwin not propagating OSTYPE through java subprocesses: https://github.com/jline/jline2/issues/62
+cygterm=false
+if $cygwin; then
+ case "$TERM" in
+ rxvt* | xterm* | vt*) cygterm=true ;;
+ esac
+fi
+
+if $cygterm; then
+ LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Djline.terminal=jline.UnixTerminal"
+ stty -icanon min 1 -echo > /dev/null 2>&1
+fi
+
+# TODO: investigate http://skife.org/java/unix/2.11.3-SNAPSHOT6/20/really_executable_jars.html
+# If you're packaging this for a package manager (.deb, homebrew, etc)
+# you need to remove the self-install and upgrade functionality or see lein-pkg.
+if [ "$1" = "self-install" ]; then
+ cmd_self_install
+elif [ "$1" = "upgrade" ] || [ "$1" = "downgrade" ]; then
+ cmd_up_downgrade "$@"
+else
+ cmd_run "$@"
fi
diff --git a/bin/lein-pkg b/bin/lein-pkg
index fc298c746..55cb20c33 100644
--- a/bin/lein-pkg
+++ b/bin/lein-pkg
@@ -1,15 +1,156 @@
-#!/bin/bash
+#!/usr/bin/env bash
# This variant of the lein script is meant for downstream packagers.
# It has all the cross-platform stuff stripped out as well as the
# logic for running from a source checkout and self-install/upgrading.
-export LEIN_VERSION="2.9.9-SNAPSHOT"
+export LEIN_VERSION="2.11.3-SNAPSHOT"
+
+if [[ "$CLASSPATH" != "" ]]; then
+ cat <<-'EOS' 1>&2
+ WARNING: You have $CLASSPATH set, probably by accident.
+ It is strongly recommended to unset this before proceeding.
+ EOS
+fi
+
+if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then
+ delimiter=";"
+else
+ delimiter=":"
+fi
+
+if [[ "$OSTYPE" == "cygwin" ]]; then
+ cygwin=true
+else
+ cygwin=false
+fi
+
+function msg {
+ echo "$@" 1>&2
+}
+
+function command_not_found {
+ msg "Leiningen couldn't find $1 in your \$PATH ($PATH), which is required."
+ exit 1
+}
+
+function make_native_path {
+ # ensure we have native paths
+ if $cygwin && [[ "$1" == /* ]]; then
+ echo -n "$(cygpath -wp "$1")"
+ elif [[ "$OSTYPE" == "msys" && "$1" == /?/* ]]; then
+ echo -n "$(sh -c "(cd $1 2/dev/null; then
+ # Check if mktemp is available before using it
+ TRAMPOLINE_FILE="$(mktemp -t lein-trampoline-XXXXXXXXXXXXX)"
+ else
+ TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+ fi
+ trap 'rm -f $TRAMPOLINE_FILE' EXIT
+ fi
+
+ if $cygwin; then
+ TRAMPOLINE_FILE=$(cygpath -w "$TRAMPOLINE_FILE")
+ fi
+
+ if [ "$INPUT_CHECKSUM" != "" ] && [ -r "$TRAMPOLINE_FILE" ]; then
+ if [ -n "$DEBUG" ]; then
+ msg "Fast trampoline with $TRAMPOLINE_FILE."
+ fi
+ exec sh -c "exec $(cat "$TRAMPOLINE_FILE")"
+ else
+ export TRAMPOLINE_FILE
+ "$LEIN_JAVA_CMD" \
+ -Dfile.encoding=UTF-8 \
+ -Dmaven.wagon.http.ssl.easy=false \
+ $LEIN_JVM_OPTS \
+ -Dleiningen.input-checksum="$INPUT_CHECKSUM" \
+ -Dleiningen.original.pwd="$ORIGINAL_PWD" \
+ -Dleiningen.script="$SCRIPT" \
+ -classpath "$CLASSPATH" \
+ clojure.main -m leiningen.core.main "$@"
+
+ EXIT_CODE=$?
+
+ if $cygterm ; then
+ stty icanon echo > /dev/null 2>&1
+ fi
+
+ if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
+ TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
+ if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
+ rm "$TRAMPOLINE_FILE"
+ fi
+ if [ "$TRAMPOLINE" = "" ]; then
+ exit $EXIT_CODE
+ else
+ exec sh -c "exec $TRAMPOLINE"
+ fi
+ else
+ exit $EXIT_CODE
+ fi
+ fi
+}
# cd to the project root, if applicable
NOT_FOUND=1
ORIGINAL_PWD="$PWD"
-while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]; do
+while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ]
+do
cd ..
if [ "$(dirname "$PWD")" = "/" ]; then
NOT_FOUND=0
@@ -17,91 +158,96 @@ while [ ! -r "$PWD/project.clj" ] && [ "$PWD" != "/" ] && [ $NOT_FOUND -ne 0 ];
fi
done
-if [[ "$CLASSPATH" != "" ]]; then
- echo "WARNING: You have \$CLASSPATH set, probably by accident."
- echo "It is strongly recommended to unset this before proceeding."
-fi
-
# User init
export LEIN_HOME="${LEIN_HOME:-"$HOME/.lein"}"
-# Support $JAVA_OPTS for backwards-compatibility.
-JVM_OPTS=${JVM_OPTS:-"$JAVA_OPTS"}
-JAVA_CMD=${JAVA_CMD:-"java"}
-
for f in "/etc/leinrc" "$LEIN_HOME/leinrc" ".leinrc"; do
- if [ -e "$f" ]; then
- source "$f"
- fi
+ if [ -e "$f" ]; then
+ source "$f"
+ fi
done
-export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
+if $cygwin; then
+ export LEIN_HOME=$(cygpath -w "$LEIN_HOME")
+fi
-grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null &&
-LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-'-Xms64m -Xmx512m'}"
+# normalize $0 on certain BSDs
+if [ "$(dirname "$0")" = "." ]; then
+ SCRIPT="$(which "$(basename "$0")")"
+ if [ -z "$SCRIPT" ]; then
+ SCRIPT="$0"
+ fi
+else
+ SCRIPT="$0"
+fi
+
+# resolve symlinks to the script itself portably
+while [ -h "$SCRIPT" ] ; do
+ ls=$(ls -ld "$SCRIPT")
+ link=$(expr "$ls" : '.*-> \(.*\)$')
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT="$(dirname "$SCRIPT"$)/$link"
+ fi
+done
+
+BIN_DIR="$(dirname "$SCRIPT")"
# If you're not using an uberjar you'll need to list each dependency
# and add them individually to the classpath/bootclasspath as well.
LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar
-# Do not use installed leiningen jar during self-compilation
-if ! { [ "$1" = "compile" ] &&
- grep -qsE 'defproject leiningen[[:space:]]+"[[:digit:].]+"' \
- project.clj ;}; then
- CLASSPATH="$CLASSPATH":"$LEIN_JAR"
- if [ "$LEIN_USE_BOOTCLASSPATH" != "no" ]; then
- LEIN_JVM_OPTS="-Xbootclasspath/a:$LEIN_JAR $LEIN_JVM_OPTS"
+export LEIN_JVM_OPTS="${LEIN_JVM_OPTS-"-XX:+TieredCompilation -XX:TieredStopAtLevel=1"}"
+
+# This needs to be defined before we call SHASUM_CMD below
+if [ "$SHASUM_CMD" = "" ]; then
+ if type -p sha256sum >/dev/null 2>&1; then
+ export SHASUM_CMD="sha256sum"
+ elif type -p shasum >/dev/null 2>&1; then
+ export SHASUM_CMD="shasum --algorithm 256"
+ elif type -p sha256 >/dev/null 2>&1; then
+ export SHASUM_CMD="sha256 -q"
+ else
+ command_not_found sha256sum
fi
fi
-# apply context specific CLASSPATH entries
-if [ -f .lein-classpath ]; then
- CLASSPATH="$(cat .lein-classpath):$CLASSPATH"
-fi
+# When :eval-in :classloader we need more memory
+grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null && \
+ export LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Xms64m -Xmx512m"
-if [ -n "$DEBUG" ]; then
- echo "Leiningen's classpath: $CLASSPATH"
-fi
+run_from_checkout "$1"
-# Which Java?
+if [ ! -x "$JAVA_CMD" ] && ! type -f java >/dev/null
+then
+ msg "Leiningen couldn't find 'java' executable, which is required."
+ msg "Please either set JAVA_CMD or put java (>=1.6) in your \$PATH ($PATH)."
+ exit 1
+fi
-export JAVA_CMD="${JAVA_CMD:-"java"}"
-export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-$JAVA_CMD}"
+export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-${JAVA_CMD:-java}}"
-if [[ "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
+if [[ -z "${DRIP_INIT+x}" && "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
+ export DRIP_INIT_CLASS="clojure.main"
fi
# Support $JAVA_OPTS for backwards-compatibility.
export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
-function command_not_found {
- >&2 echo "Leiningen couldn't find $1 in your \$PATH ($PATH), which is required."
- exit 1
-}
-
-if [ -r .lein-fast-trampoline ]; then
- export LEIN_FAST_TRAMPOLINE='y'
+# Handle jline issue with cygwin not propagating OSTYPE through java subprocesses: https://github.com/jline/jline2/issues/62
+cygterm=false
+if $cygwin; then
+ case "$TERM" in
+ rxvt* | xterm* | vt*) cygterm=true ;;
+ esac
fi
-if [ "$LEIN_FAST_TRAMPOLINE" != "" ] && [ -r project.clj ]; then
- INPUTS="$* $(cat project.clj) $LEIN_VERSION $(test -f "$LEIN_HOME/profiles.clj" && cat "$LEIN_HOME/profiles.clj") $(test -f profiles.clj && cat profiles.clj)"
-
- if command -v shasum >/dev/null 2>&1; then
- SUM="shasum"
- elif command -v sha1sum >/dev/null 2>&1; then
- SUM="sha1sum"
- else
- command_not_found "sha1sum or shasum"
- fi
-
- INPUT_CHECKSUM=$(echo "$INPUTS" | $SUM | cut -f 1 -d " ")
- # Just don't change :target-path in project.clj, mkay?
- TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
-else
- TRAMPOLINE_FILE="$(mktemp /tmp/lein-trampoline-XXXXXXXXXXXXX)"
- trap 'rm -f $TRAMPOLINE_FILE' EXIT
+if $cygterm; then
+ LEIN_JVM_OPTS="$LEIN_JVM_OPTS -Djline.terminal=jline.UnixTerminal"
+ stty -icanon min 1 -echo > /dev/null 2>&1
fi
if [ "$1" = "upgrade" ]; then
@@ -111,37 +257,4 @@ if [ "$1" = "upgrade" ]; then
exit 1
fi
-if [ "$INPUT_CHECKSUM" != "" ] && [ -r "$TRAMPOLINE_FILE" ]; then
- if [ -n "$DEBUG" ]; then
- echo "Fast trampoline with $TRAMPOLINE_FILE."
- fi
- exec sh -c "exec $(cat $TRAMPOLINE_FILE)"
-else
- export TRAMPOLINE_FILE
- "$LEIN_JAVA_CMD" \
- -Dfile.encoding=UTF-8 \
- -Dmaven.wagon.http.ssl.easy=false \
- -Dmaven.wagon.rto=10000 \
- $LEIN_JVM_OPTS \
- -Dleiningen.input-checksum="$INPUT_CHECKSUM" \
- -Dleiningen.original.pwd="$ORIGINAL_PWD" \
- -Dleiningen.script="$0" \
- -classpath "$CLASSPATH" \
- clojure.main -m leiningen.core.main "$@"
-
- EXIT_CODE=$?
-
- if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
- TRAMPOLINE="$(cat "$TRAMPOLINE_FILE")"
- if [ "$INPUT_CHECKSUM" = "" ]; then # not using fast trampoline
- rm "$TRAMPOLINE_FILE"
- fi
- if [ "$TRAMPOLINE" = "" ]; then
- exit $EXIT_CODE
- else
- exec sh -c "exec $TRAMPOLINE"
- fi
- else
- exit $EXIT_CODE
- fi
-fi
+cmd_run "$@"
diff --git a/bin/lein.bat b/bin/lein.bat
index d05c2aaca..0d577fe73 100755
--- a/bin/lein.bat
+++ b/bin/lein.bat
@@ -2,7 +2,7 @@
setLocal EnableExtensions EnableDelayedExpansion
-set LEIN_VERSION=2.9.9-SNAPSHOT
+set LEIN_VERSION=2.11.3-SNAPSHOT
if "%LEIN_VERSION:~-9%" == "-SNAPSHOT" (
set SNAPSHOT=YES
diff --git a/bin/lein.ps1 b/bin/lein.ps1
index 1b2635b8b..7af3abcfb 100644
--- a/bin/lein.ps1
+++ b/bin/lein.ps1
@@ -34,7 +34,7 @@ function Set-ParentLocation([string]$file)
function Initialize-Environment
{
- $env:LEIN_VERSION = '2.9.9-SNAPSHOT'
+ $env:LEIN_VERSION = '2.11.3-SNAPSHOT'
$env:SNAPSHOT = if($env:LEIN_VERSION -like '*-SNAPSHOT'){'YES'}else{'NO'} #TODO: Still needed?
$env:ORIGINAL_PWD = $PWD -replace '\\$','\\'
Set-ParentLocation project.clj
diff --git a/bin/release b/bin/release
index 5d918eac8..4cd3b2cc7 100755
--- a/bin/release
+++ b/bin/release
@@ -1,21 +1,26 @@
#!/bin/bash
-set -e -u
-
if [ "$1" = "" ]; then
echo "usage: $0 VERSION"
exit 1
fi
+set -e -u
+
RELEASE_VERSION=$1
CURRENT_VERSION="$RELEASE_VERSION-SNAPSHOT"
+LEIN_STABLE=$2
+
+if [ "$LEIN_STABLE" = "" ]; then
+ LEIN_STABLE=lein-stable
+fi
# Would like to use `lein release` here, but we don't have a way to
# update the bash scripts or watch for boot slowdowns that way. Maybe
# try adding lein-shell?
-if [ ! -x `which lein-stable` ]; then
- echo "Install a stable version of Leiningen as lein-stable."
+if [ ! -x `which $LEIN_STABLE` ]; then
+ echo "Install a stable version of Leiningen as $LEIN_STABLE."
exit 1
fi
@@ -34,7 +39,7 @@ LEIN_ROOT=$PWD
echo "Bootstrapping..."
cd leiningen-core
-lein-stable do clean, bootstrap
+$LEIN_STABLE do clean, bootstrap
cd ..
echo "Generating uberjar..."
@@ -43,6 +48,7 @@ bin/lein uberjar
RELEASE_JAR=$PWD/target/leiningen-$RELEASE_VERSION-standalone.jar
RELEASE_JAR_CHECKSUM="$(sha256sum $RELEASE_JAR | awk '{ print $1 }')"
SELF_INSTALL_JAR=$HOME/.lein/self-installs/$(basename $RELEASE_JAR)
+mkdir -p $HOME/.lein/self-installs
cp $RELEASE_JAR $SELF_INSTALL_JAR
sed -i "s/export LEIN_CHECKSUM=.*/export LEIN_CHECKSUM='$RELEASE_JAR_CHECKSUM'/" bin/lein
@@ -62,7 +68,7 @@ time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
echo "Check that these are about the same boot times as with the last version."
-echo "Run this in a project: time lein-stable run -m clojure.main/main -e nil"
+echo "Run this in a project: time $LEIN_STABLE run -m clojure.main/main -e nil"
echo "Proceeding here will publish the new version to the git repo."
echo "Are these acceptable times? (~3s) [Y\n]"
read CONTINUE
@@ -78,14 +84,18 @@ cd $LEIN_ROOT
git commit -a -m "Release $RELEASE_VERSION"
git tag -s $RELEASE_VERSION -m "Release $RELEASE_VERSION"
-git push && git push --tags && git push origin master:stable
+git push && git push --tags && git push origin main:stable
-echo "Upload $SELF_INSTALL_JAR and $SELF_INSTALL_JAR.asc to GitHub:"
+echo "Upload to Codeberg and Github:"
+echo " $SELF_INSTALL_JAR"
+echo " $SELF_INSTALL_JAR.asc"
+echo
+echo "https://codeberg.org/leiningen/leiningen/releases/new?tag=$RELEASE_VERSION"
echo "https://github.com/technomancy/leiningen/releases/new?tag=$RELEASE_VERSION"
-echo "Copy this version's section of NEWS.md to the GitHub release description."
+echo "Copy this version's section of NEWS.md to the release description."
rm -rf target leiningen-core/target
echo "Test self-install. If things are good, run this:"
-echo "$ lein deploy clojars && cd leiningen-core && lein deploy clojars"
+echo " lein deploy clojars && cd leiningen-core && lein deploy clojars"
echo ""
-echo "Then run: bin/bump $RELEASE_VERSION NEXT_VERSION"
+echo "Then run: bin/bump $RELEASE_VERSION NEXT_VERSION-SNAPSHOT"
diff --git a/doc/BEGINNER_MISTAKES.md b/doc/BEGINNER_MISTAKES.md
new file mode 100644
index 000000000..0e4144b79
--- /dev/null
+++ b/doc/BEGINNER_MISTAKES.md
@@ -0,0 +1,25 @@
+
+
+**Table of Contents**
+
+- [BEGINNER_MISTAKES](#beginner_mistakes)
+
+
+
+# Beginner Mistakes
+
+**Q:** When I have no `project.clj` the command `lein repl` works, but I
+ added one and now `lein repl` crashes with:
+```
+Error: Could not find or load main class clojure.main
+Caused by: java.lang.ClassNotFoundException: clojure.main
+Subprocess failed (exit code: 1)
+```
+**A:** When you don't have a `project.clj` Leiningen automatically includes
+ the core Clojure language for you. When you add a `project.clj`,
+ Leiningen expects you to specify which version of Clojure you'll
+ use. If you're just experimenting with Clojure, remove `project.clj`.
+ Otherwise, make sure your `project.clj` has a `:dependencies` section
+ with at least `[org.clojure/clojure "1.11.1"]` in it. (Change the version
+ from `1.11.1` as necessary.)
+
diff --git a/doc/DEPLOY.md b/doc/DEPLOY.md
index 44f8f23c1..7b0c2c800 100644
--- a/doc/DEPLOY.md
+++ b/doc/DEPLOY.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Deploying Libraries](#deploying-libraries)
- [Private Repositories](#private-repositories)
@@ -25,7 +25,7 @@
Getting your library into [Clojars](https://clojars.org) is fairly
straightforward as is documented near the end of
-[the Leiningen tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md).
+[the Leiningen tutorial](https://codeberg.org/leiningen/leiningen/src/stable/doc/TUTORIAL.md).
However, deploying elsewhere is not always that straightforward.
## Private Repositories
@@ -77,7 +77,7 @@ you can deploy to S3 buckets using the
The most full-featured and complex route is to run a full-fledged
repository manager. Both [Artifactory](https://www.jfrog.com/open-source/#os-arti), [Archiva](https://archiva.apache.org/) and
-[Nexus](http://nexus.sonatype.org/) provide this. They also proxy to
+[Nexus](https://nexus.sonatype.org/) provide this. They also proxy to
other repositories, so you can set `^:replace` metadata on
`:repositories` in project.clj, and dependency downloads will speed up
by quite a bit since Clojars and Maven Central won't need to be
@@ -137,7 +137,7 @@ haven't set up credentials, but it's convenient to set it so you don't have to
re-enter it every time you want to deploy. You will need
[gpg](https://www.gnupg.org/) installed and a key pair configured. If
you need help with either of those, see the
-[GPG guide](https://github.com/technomancy/leiningen/blob/stable/doc/GPG.md).
+[GPG guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/GPG.md).
### GPG
@@ -249,6 +249,22 @@ your `project.clj`:
You can use this to alias any `:repositories` entry; Clojars is just the most
common use case.
+## Signing Artifacts
+
+By default Leiningen will attempt to sign all artifacts that are deployed
+using GPG. If you prefer, you can [sign them using
+SSH](https://www.agwa.name/blog/post/ssh_signatures) instead. If you don't
+already use GPG, this may be more convenient for you. Edit your
+`~/.lein/profiles.clj` file to add a `:user` profile with a `:signing` map:
+
+```clj
+{:user {:signing {:gpg-key false
+ :ssh-key "~/.ssh/id_rsa"}}}
+```
+
+If you want to keep signing with both SSH and GPG at the same time, you can
+omit the `:gpg-key false` setting.
+
## Releasing Simplified
Once you have your repositories and user credentials configured for deploying,
@@ -346,7 +362,7 @@ to the task, like so: `["vcs" "commit" "Version %s [skip ci]"]`.
### Tagging
-By default `["vcs" "tag"]` will create a GPG signed tag with your project version
+By default `["vcs" "tag"]` will create a signed tag with your project version
number. You can add a tag prefix by passing the prefix after `"tag"`,
for example: `["vcs" "tag" "v"]`. You can disable tag signing by passing `--no-sign`,
for example: `["vcs" "tag" "v" "--no-sign"]` or `["vcs" "tag" "--no-sign"]`.
diff --git a/doc/FAQ.md b/doc/FAQ.md
index fbfbb25f3..6d8179558 100644
--- a/doc/FAQ.md
+++ b/doc/FAQ.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [FAQ](#faq)
@@ -13,11 +13,11 @@
**Q:** What's a group ID? How do snapshots work?
**A:** See the
- [tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
+ [tutorial](https://codeberg.org/leiningen/leiningen/src/stable/doc/TUTORIAL.md)
for background.
**Q:** How should I pick my version numbers?
-**A:** Use [semantic versioning](http://semver.org) to communicate
+**A:** Use [semantic versioning](https://semver.org) to communicate
intentions to downstream users of your library, but don't make
assumptions that libraries you use stick with it consistently. Remember
that the difference between a breaking change and a bug fix is often
@@ -25,7 +25,7 @@
**Q:** What if my project depends on jars that aren't in any repository?
**A:** You will need to get them in a repository. The
- [deploy guide](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
+ [deploy guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)
explains how to set up a private repository. In general it's easiest
to deploy them to a static HTTP server or a private S3 bucket. Once
the repo is set up, `lein deploy private-repo com.mycorp/somejar
@@ -38,7 +38,7 @@
**Q:** I want to hack a project and one of its dependencies, but it's annoying to switch between them.
**A:** Leiningen provides a feature called *checkout dependencies* to
make this smoother. See the
- [tutorial](https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md)
+ [tutorial](https://codeberg.org/leiningen/leiningen/src/stable/doc/TUTORIAL.md)
to learn more.
**Q:** Is it possible to exclude indirect dependencies?
@@ -119,7 +119,7 @@
**Q:** Still too slow; what else can make startup faster?
**A:** The wiki has a page covering
- [ways to improve startup time](https://github.com/technomancy/leiningen/wiki/Faster).
+ [ways to improve startup time](https://wiki.leiningen.org/Faster).
**Q:** What if I care more about long-term performance than startup time?
**A:** Leiningen 2.1.0 onward get a speed boost by disabling optimized
@@ -239,7 +239,7 @@ happens it is strongly recommended to add an `:exclusion` and report a
bug with the dependency which does this.
**Q:** `lein`/`lein.bat` won't download `leiningen-x.y.z-SNAPSHOT.jar`
-**A:** You probably downloaded `lein`/`lein.bat` from the [master branch](https://github.com/technomancy/leiningen/tree/master/bin). Unless you plan to build leiningen yourself or help develop it, we suggest you use the latest stable version: [lein](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein)/[lein.bat](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat)
+**A:** You probably downloaded `lein`/`lein.bat` from the [main branch](https://codeberg.org/leiningen/leiningen/src/main/bin). Unless you plan to build leiningen yourself or help develop it, we suggest you use the latest stable version: [lein](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein)/[lein.bat](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat)
**Q:** I have a dependency whose group ID and/or artifact ID starts with a
number (which is invalid for symbols in Clojure). How can I add it to my
diff --git a/doc/GPG.md b/doc/GPG.md
index 8f432b913..8cb393d48 100644
--- a/doc/GPG.md
+++ b/doc/GPG.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Using GPG](#using-gpg)
- [What is it?](#what-is-it)
@@ -183,7 +183,7 @@ Leiningen uses GPG for three things: decrypting credential files,
signing release artifacts, and signing tags. We'll focus on artifact
signing here; for information on credentials encryption/decryption,
see the
-[deploy guide](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md). Once
+[deploy guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md). Once
you are configured to sign releases, signing tags should be
straightforward.
diff --git a/doc/MIXED_PROJECTS.md b/doc/MIXED_PROJECTS.md
index 53a0ae5a7..8cb0c85aa 100644
--- a/doc/MIXED_PROJECTS.md
+++ b/doc/MIXED_PROJECTS.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Polyglot (Clojure, Java) Projects With Leiningen](#polyglot-clojure-java-projects-with-leiningen)
- [Source Layout](#source-layout)
diff --git a/doc/PLUGINS.md b/doc/PLUGINS.md
index c6b9979bc..dc1414fdf 100644
--- a/doc/PLUGINS.md
+++ b/doc/PLUGINS.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Leiningen Plugins](#leiningen-plugins)
- [Writing a Plugin](#writing-a-plugin)
@@ -76,7 +76,8 @@ on that argument.
However, if you need to call other Leiningen functions or have no need
to run anything inside the context of the project's own process,
-making a plugin might be the right choice if one doesn't [exist already](https://github.com/technomancy/leiningen/wiki/plugins),
+making a plugin might be the right choice if one doesn't
+[exist already](https://wiki.leiningen.org/Plugins).
## Writing a Plugin
@@ -87,11 +88,11 @@ has `:eval-in-leiningen true`, which causes all tasks to operate
inside the leiningen process rather than starting a subprocess to
isolate the project's code. Plugins need not declare a dependency on
Clojure itself; in fact
-[all of Leiningen's own dependencies](https://github.com/technomancy/leiningen/blob/stable/project.clj)
+[all of Leiningen's own dependencies](https://codeberg.org/leiningen/leiningen/src/stable/project.clj)
will be available.
See the `lein-pprint` directory
-[in the Leiningen source](https://github.com/technomancy/leiningen/tree/stable/lein-pprint)
+[in the Leiningen source](https://codeberg.org/leiningen/leiningen/src/stable/lein-pprint)
for a sample of a very simple plugin.
When emitting output, please use `leiningen.core.main/info`,
@@ -542,7 +543,7 @@ the argument list so that the `-main` function running inside the
project code gets access to it.
The vast majority of these cases are already covered by
-[existing plugins](https://github.com/technomancy/leiningen/wiki/plugins),
+[existing plugins](https://wiki.leiningen.org/Plugins),
but if you have a case that doesn't exist and for some reason can't
spin it off into its own separate plugin, you can enable this behavior
by placing the `foo.clj` file defining the new task in
@@ -569,7 +570,7 @@ proper plugin.
## Have Fun
Please add your plugin to [the list on the
-wiki](https://github.com/technomancy/leiningen/wiki/plugins) once it's ready.
+wiki](https://wiki.leiningen.org/Plugins) once it's ready.
Hopefully the plugin mechanism is simple and flexible enough to let
you bend Leiningen to your will.
diff --git a/doc/PROFILES.md b/doc/PROFILES.md
index bef12a2a6..7b2586a49 100644
--- a/doc/PROFILES.md
+++ b/doc/PROFILES.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Profiles](#profiles)
- [Declaring Profiles](#declaring-profiles)
@@ -201,12 +201,12 @@ Multiple profiles may be executed in series with colons:
$ lein with-profile 1.3:1.4 test :database
The above invocations activate the given profiles in place of the
-defaults. To activate a profile in addition to the defaults, prepend
-it with a `+`:
+defaults. To activate the profiles in addition to the defaults, prepend
+them with a `+`:
- $ lein with-profile +server run
+ $ lein with-profile +server,+fast run
-You can also use `-` to deactivate a profile.
+You can also use `-` to deactivate profiles.
By default all profiles will share the same `:target-path`, which can
cause problems if settings from one profile leak over into
@@ -227,8 +227,11 @@ This can be used to avoid duplication:
:production [:shared :prod-servers]}
```
-It is not recommended to make a composite profile which contains both
-keywords and maps; they should either be all keywords or all maps.
+The vector should contain keywords referencing other profiles which
+will be merged together.
+
+While it is possible to make a composite profile which contains both
+keywords and maps, this will become an error in a future version of Leiningen.
Composite profiles also cannot have certain types of metadata
propagated, which makes them incompatible with the `:provided`
@@ -252,7 +255,7 @@ Here is an example of such a case:
## Debugging
To see how a given profile affects your project map, use the
-[lein-pprint](https://github.com/technomancy/leiningen/tree/stable/lein-pprint)
+[lein-pprint](https://codeberg.org/leiningen/leiningen/src/stable/lein-pprint)
plugin:
$ lein with-profile 1.4 pprint
diff --git a/doc/TEMPLATES.md b/doc/TEMPLATES.md
index 93e2f5d71..e71293c40 100644
--- a/doc/TEMPLATES.md
+++ b/doc/TEMPLATES.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Writing Templates](#writing-templates)
- [Structure](#structure)
@@ -67,7 +67,7 @@ you wish to be part of your template. For everything you add, make sure the
`liquid_cool.clj` file receives corresponding entries in that `->files`
call. For examples to follow, have a look inside [the \*.clj files for the
built-in
-templates](https://github.com/technomancy/leiningen/tree/stable/resources/leiningen/new).
+templates](https://codeberg.org/leiningen/leiningen/src/stable/resources/leiningen/new).
## Testing Your Template
diff --git a/doc/TUTORIAL.md b/doc/TUTORIAL.md
index 51d397f1f..0dcd08b0e 100644
--- a/doc/TUTORIAL.md
+++ b/doc/TUTORIAL.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Tutorial](#tutorial)
- [What This Tutorial Covers](#what-this-tutorial-covers)
@@ -37,7 +37,7 @@
Leiningen is for automating Clojure projects without setting your hair
on fire. If you experience your hair catching on fire or any other
frustrations while following this tutorial, please
-[let us know](https://github.com/technomancy/leiningen/issues/new).
+[let us know](https://codeberg.org/leiningen/leiningen/issues/new).
It offers various project-related tasks and can:
@@ -63,8 +63,8 @@ tool.
This tutorial will briefly cover project structure, dependency
management, running tests, the REPL, and topics related to deployment.
-For those of you new to the JVM who have never touched [Ant](http://ant.apache.org/)
or [Maven](https://maven.apache.org/) in anger: don't panic. Leiningen is designed
+For those of you new to the JVM who have never touched [Ant](https://ant.apache.org/)
with you in mind. This tutorial will help you get started and explain Leiningen's
take on project automation and JVM-land dependency management.
@@ -102,7 +102,7 @@ Next let's take a look at how projects are created.
## Creating a Project
We'll assume you've got Leiningen installed as per the
-[README](https://github.com/technomancy/leiningen/blob/stable/README.md).
+[README](https://codeberg.org/leiningen/leiningen/src/stable/README.md).
Generating a new project is easy:
$ lein new app my-stuff
@@ -161,7 +161,7 @@ read up on them elsewhere, for example [here](https://8thlight.com/blog/colin-jo
Your `project.clj` file will start off looking something like this:
-```clj
+```clojure
(defproject my-stuff "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "https://example.com/FIXME"
@@ -271,7 +271,7 @@ wider JVM community.
You can add third-party repositories by setting the `:repositories` key
in project.clj. See the
-[sample.project.clj](https://github.com/technomancy/leiningen/blob/stable/sample.project.clj)
+[sample.project.clj](https://codeberg.org/leiningen/leiningen/src/stable/sample.project.clj)
for examples on how to do so. This sample uses additional repositories such as the Sonatype
repository which gives access to the latest SNAPSHOT development version of a library (Clojure or Java).
It also contains other relevant settings regarding repositories such as update frequency.
@@ -323,12 +323,13 @@ resolved, either from a remote repo or via `lein install` locally. That is,
given the above directory hierarchy, `project.clj` should contain something
like:
- :dependencies [[org.clojure/clojure "1.9.0"]
- ...
- [suchwow "0.3.9"]
- [com.megacorp/commons "1.3.5"]
- ...]
-
+```clj
+:dependencies [[org.clojure/clojure "1.9.0"]
+ ...
+ [suchwow "0.3.9"]
+ [com.megacorp/commons "1.3.5"]
+ ...]
+```
Note here that the Maven groupid `com.megacorp` has no effect on the way checkouts work.
The `suchwow` and `commons` links look the same in `checkouts`, and the groupid
@@ -336,7 +337,7 @@ hierarchy doesn't need to appear in the way `commons` is actually laid out on di
After you've updated `:dependencies`, `lein` will still need to be able
to find the library in some repository like clojars or your `~/.m2`
-directory. If `lein` complains with a message like "Could not find artifact suchwow:jar:0.3.9",
+directory. If `lein` complains with a message like `"Could not find artifact suchwow:jar:0.3.9"`,
it's possible that `project.clj` and `suchwow/project.clj` use different version numbers.
It's also possible that you're working on the main project and `suchwow` at the same time,
have bumped the version number in both project files, but still have the old version in your
@@ -365,14 +366,14 @@ Central and Clojars is supported.
### Maven Read Timeout
-The underlying [Maven Wagon](https://maven.apache.org/wagon/) transport
-reads the `maven.wagon.rto` system property to determine the timeout used
-when downloading artifacts from a repository. The `lein` script sets that property to be 10000.
-If that timeout isn't long enough (for example, when using a slow corporate mirror),
-it can be overridden via `LEIN_JVM_OPTS`:
+The underlying [Maven Wagon](https://maven.apache.org/wagon/)
+transport reads the `maven.wagon.rto` system property to determine the
+timeout (in milliseconds) used when communicating with a repository.
+If the default timeout isn't right, it can be overridden via
+`LEIN_JVM_OPTS`:
```bash
-export LEIN_JVM_OPTS="-Dmaven.wagon.rto=1800000"
+export LEIN_JVM_OPTS="-Dmaven.wagon.rto=30000"
```
## Setting JVM Options
@@ -381,13 +382,13 @@ To pass extra arguments to the JVM, set the `:jvm-opts` vector. This will overri
any default JVM opts set by Leiningen.
```clj
- :jvm-opts ["-Xmx1g"]
+:jvm-opts ["-Xmx1g"]
```
If you want to pass [compiler options](https://clojure.org/reference/compilation#_compiler_options)
to the Clojure compiler, you also do this here.
-```
+```clj
:jvm-opts ["-Dclojure.compiler.disable-locals-clearing=true"
"-Dclojure.compiler.elide-meta=[:doc :file :line :added]"
; notice the array is not quoted like it would be if you passed it directly on the command line.
@@ -496,6 +497,16 @@ namespaces at a time; `lein test my-stuff.core-test` will do that. You
also might want to break up your tests using test selectors; see `lein
help test` for more details.
+The built-in `test` command wraps the basic runner from `clojure.test`
+and adds a few small features, but many people prefer to replace it
+with a more full-featured test runner like [kaocha](https://github.com/lambdaisland/kaocha).
+By adding an alias for `test` along with an entry in `:dependencies`,
+it's easy to make a third-party runner replace the built-in test task:
+
+```clj
+:aliases {"test" ["run" "-m" "kaocha.runner"]}
+```
+
Running `lein test` from the command-line is suitable for regression
testing, but the slow startup time of the JVM makes it a poor fit for
testing styles that require tighter feedback loops. In these cases,
@@ -653,8 +664,7 @@ There are many ways to get your project deployed as a server-side
application. Aside from the obvious uberjar approach, simple programs can be
packaged up as [tarballs](https://en.wikipedia.org/wiki/Tar_(computing)) with
accompanied shell scripts using the [lein-tar plugin](https://github.com/technomancy/lein-tar)
-and then deployed using [pallet](http://palletops.com/), [chef](https://chef.io/),
-or other mechanisms.
+and then deployed using [chef](https://chef.io/) or other mechanisms.
Web applications may be deployed as uberjars using embedded Jetty with
`ring-jetty-adapter` or as [war (web application archive) files](https://en.wikipedia.org/wiki/WAR_(file_format))
@@ -672,7 +682,7 @@ Leiningen's own JVM will stay up and consume unnecessary memory.
In addition it's very important to ensure you take steps to freeze all
the dependencies before deploying, otherwise it could be easy to end
up with
-[unrepeatable deployments](https://github.com/technomancy/leiningen/wiki/Repeatability).
+[unrepeatable deployments](https://wiki.leiningen.org/Repeatability).
Consider including `~/.m2/repository` in your unit of deployment
(tarball, .deb file, etc) along with your project code. It's
recommended to use Leiningen to create a deployable artifact in a
@@ -703,7 +713,7 @@ Given these pitfalls, it's best to use an uberjar if possible.
If your project is a library and you would like others to be able to
use it as a dependency in their projects, you will need to get it into
a public repository. While it's possible to [maintain your own private
-repository](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
+repository](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)
or get it into [Central](https://search.maven.org), the easiest way is
to publish it at [Clojars](https://clojars.org). Once you have
[created an account](https://clojars.org/register) there, publishing
@@ -747,9 +757,10 @@ Once that succeeds it will be available as a package on which other
projects may depend. For instructions on storing your credentials so
they don't have to be re-entered every time, see `lein help
deploying`. When deploying a release that's not a snapshot, Leiningen
-will attempt to sign it using [GPG](https://gnupg.org) to prove your
+will attempt to sign it using [GPG](https://gnupg.org) or
+[SSH](https://www.agwa.name/blog/post/ssh_signatures) to prove your
authorship of the release. See the
-[deploy guide](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
+[deploy guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)
for details of how to set that up. The deploy guide includes
instructions for deploying to other repositories as well.
diff --git a/doc/ja/PLUGINS_ja.md b/doc/ja/PLUGINS_ja.md
index 2d9e7303d..ecf1b0b58 100644
--- a/doc/ja/PLUGINS_ja.md
+++ b/doc/ja/PLUGINS_ja.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [Leiningen プラグイン](#leiningen-%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3)
- [プラグインを書く](#%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E6%9B%B8%E3%81%8F)
@@ -36,9 +36,9 @@ Leiningenのタスクはleiningen.$TASK名前空間にある$TASKという名前
## プラグインを書く
`lein new plugin myplugin`でプロジェクトを作成するところからはじめ、`leiningen.myplugin`名前空間の`myplugin`関数を編集してください。`project.clj`内にある`:eval-in-leningen true`によって、タスクはサブプロセスではなく、leiningenプロセス内部で動作します。プラグインは、clojureそのものへの依存関係を宣言する必要はありません。
-[Leiningen本体の依存関係全て](https://github.com/technomancy/leiningen/blob/stable/project.clj)がプラグインから利用可能です。
+[Leiningen本体の依存関係全て](https://codeberg.org/leiningen/leiningen/src/stable/project.clj)がプラグインから利用可能です。
-非常に単純なプラグインの例として、 [ソースコード内の](https://github.com/technomancy/leiningen/tree/stable/lein-pprint)
+非常に単純なプラグインの例として、 [ソースコード内の](https://codeberg.org/leiningen/leiningen/src/stable/lein-pprint)
`lein-pprint`ディレクトリを参照してください。
プラグインの開発中、プロジェクト内で`lein install`を再実行し、それからテストプロジェクトに切り替えるのは非常に手間がかかります。一度プラグインをインストールすれば、テストプロジェクト内の`.lein-classpath`ファイルに、プラグインの`src`ディレクトリのパスを記述しておくことでこの手間を省くことができます。そのプラグインが別の開発中のライブラリに依存している場合は、`.lein-classpath`にUNIXでは`:`、Windowsでは`;`のクラスパスセパレータで区切ってライブラリのディレクトリを追加することができます。
@@ -285,7 +285,7 @@ Leiningenタスクを記述する必要があるのは、例えば`eval-in-proje
この例ではプロジェクトマップの`:version`フィールドを引数リストに渡すことで、プロジェクト内で実行される`-main`関数が値にアクセスできるようにしています。
-こういった例の多くは[既存のプラグイン](https://github.com/technomancy/leiningen/wiki/plugins)でカバーされているはずですが、もし類似の例が見つからず、何らかの理由で別のブラグインに分離できない場合、`tasks/leiningen/`の下に新しいタスクを定義した`foo.clj`ファイルを作成し、`tasks`を`.lein-classpath`に追加することでこのふるまいを実現することができます。
+こういった例の多くは[既存のプラグイン](https://wiki.leiningen.org/Plugins)でカバーされているはずですが、もし類似の例が見つからず、何らかの理由で別のブラグインに分離できない場合、`tasks/leiningen/`の下に新しいタスクを定義した`foo.clj`ファイルを作成し、`tasks`を`.lein-classpath`に追加することでこのふるまいを実現することができます。
```
$ ls
@@ -304,7 +304,7 @@ Hello, Foo!
## 楽しんでください
-あなたのプラグインができあがったら、[Wiki上のリスト](https://github.com/technomancy/leiningen/wiki/plugins)に追加してください。
+あなたのプラグインができあがったら、[Wiki上のリスト](https://github.com/technomnacy/leiningen/wiki/plugins)に追加してください。
このプラグインシステムが、あなたの思いのままにLeiningenをカスタマイズするための簡単で、柔軟なシステムを提供していることを願っています。
diff --git a/doc/ja/TUTORIAL_ja.md b/doc/ja/TUTORIAL_ja.md
index f9c84a276..95420a96d 100644
--- a/doc/ja/TUTORIAL_ja.md
+++ b/doc/ja/TUTORIAL_ja.md
@@ -1,6 +1,6 @@
-**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
+**Table of Contents**
- [チュートリアル](#%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB)
- [このチュートリアルの取り扱い範囲](#%E3%81%93%E3%81%AE%E3%83%81%E3%83%A5%E3%83%BC%E3%83%88%E3%83%AA%E3%82%A2%E3%83%AB%E3%81%AE%E5%8F%96%E3%82%8A%E6%89%B1%E3%81%84%E7%AF%84%E5%9B%B2)
@@ -38,7 +38,7 @@
Leiningen は Clojure プロジェクトを、髪の毛が燃え上がるような思いをせずに、
自動化するためのものです。もしこのチュートリアルにしたがっていて、
髪の毛が燃え上がるような思いをしたり何かイライラするようなことがあった場合は、
-ぜひ[私達に知らせてください](https://github.com/technomancy/leiningen/issues/new)。
+ぜひ[私達に知らせてください](https://codeberg.org/leiningen/leiningen/issues/new)。
Leiningen は様々なプロジェクトに関連するタスクを提案します:
@@ -109,7 +109,7 @@ Leiningen は*プロジェクト*とともに動作します。
## プロジェクトの作成
わたしたちは、あなたが
-[README](https://github.com/technomancy/leiningen/blob/stable/README.md)
+[README](https://codeberg.org/leiningen/leiningen/src/stable/README.md)
にしたがって Leiningen をインストールしたと仮定します。
この時新しいプロジェクトを生成することは簡単です:
@@ -282,7 +282,7 @@ maven レポジトリで、 [Central](https://search.maven.org/) は
サードパーティのレポジトリは `:repositories` キーを project.clj に指定することで追加出来ます。
どのようにすれば良いのか
-[sample.project.clj](https://github.com/technomancy/leiningen/blob/stable/sample.project.clj)
+[sample.project.clj](https://codeberg.org/leiningen/leiningen/src/stable/sample.project.clj)
を見てみましょう。このサンプルは追加のレポジトリとして Sonatype レポジトリを使っていますが、
これは(Clojure や Java の)ライブラリの、最新のスナップショット開発バージョンへのアクセスを提供します。
このサンプルには同様に、レポジトリに関連する更新頻度などの設定が含まれています。
@@ -690,7 +690,7 @@ uberjar 以上のことをしようとした場合、サーバサイドデプロ
Leiningen の自分自身の JVM は実行され続け、不必要なメモリを消費します。
加えて非常に重要なこととして、デプロイする前に全ての依存関係を凍結するステップを踏まなければなりません。
-そうしなければ[繰り返せないデプロイ](https://github.com/technomancy/leiningen/wiki/Repeatability)
+そうしなければ[繰り返せないデプロイ](https://wiki.leiningen.org/Repeatability)
問題によって止まってしまいます。一つのデプロイ(tar ファイル, .deb ファイルなど)にプロジェクトのコードに加えて、
`~/.m2/repository` を含むことを検討すべきです。継続インテグレーションを設定する際には、
デプロイ可能なアーティファクトを作るために Leiningen を使う事が推奨されます。
@@ -716,7 +716,7 @@ Leiningen の自分自身の JVM は実行され続け、不必要なメモリ
もしプロジェクトがライブラリで、他の人がプロジェクトの中で
依存関係としてそのライブラリを使えるようにしたいときは、
そのライブラリをパブリックレポジトリに置く必要が出てきます。
-自分自身の[プライベートレポジトリを運用する](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)
+自分自身の[プライベートレポジトリを運用する](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)
こともできますし、
[Central](https://search.maven.org)に置くことも出来ますが、
最も簡単なのは[Clojars](https://clojars.org)で公開する方法でしょう。
@@ -749,7 +749,7 @@ Leiningen の自分自身の JVM は実行され続け、不必要なメモリ
スナップショット版ではなくリリース版をデプロイするときは、
Leiningen は [GPG](https://gnupg.org) を使って署名を行い、
リリースの著作権を証明します。どのように設定を行うかの詳細については、
-[デプロイガイド](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md)を参考にしてください。
+[デプロイガイド](https://codeberg.org/leiningen/leiningen/src/stable/doc/DEPLOY.md)を参考にしてください。
デプロイガイドでは他のレポジトリへのデプロイ方法の説明もしています。
## おわり!
diff --git a/doc/ja/lein_ja.1 b/doc/ja/lein_ja.1
index 9f949ad6c..9e22d68e9 100644
--- a/doc/ja/lein_ja.1
+++ b/doc/ja/lein_ja.1
@@ -173,7 +173,7 @@ Leiningen はその設定ファイルとして、プロジェクトのルート
.SH バグ
-https://github.com/technomancy/leiningen/issues を見て、
+https://codeberg.org/leiningen/leiningen/issues を見て、
あなたの問題が既知のものかどうか確認してください。
その際には、
diff --git a/doc/lein.1 b/doc/lein.1
index f66fe2b89..5c1175fcc 100644
--- a/doc/lein.1
+++ b/doc/lein.1
@@ -172,7 +172,7 @@ You can customize your project map further with profiles; see
.SH BUGS
-Check https://github.com/technomancy/leiningen/issues to see if your
+Check https://codeberg.org/leiningen/leiningen/issues to see if your
problem is a known issue. If not, please open a new issue on that site.
Please include the output of
.B lein version
diff --git a/lein-pprint/project.clj b/lein-pprint/project.clj
index 92dea4ffa..1f022ddff 100644
--- a/lein-pprint/project.clj
+++ b/lein-pprint/project.clj
@@ -1,6 +1,6 @@
-(defproject lein-pprint "1.3.2"
+(defproject lein-pprint "1.3.3-SNAPSHOT"
:description "Pretty-print a representation of the project map."
- :url "https://github.com/technomancy/leiningen"
+ :url "https://codeberg.org/leiningen/leiningen"
:license {:name "Eclipse Public License"
- :url "http://www.eclipse.org/legal/epl-v10.html"}
+ :url "https://www.eclipse.org/legal/epl-v10.html"}
:eval-in-leiningen true)
diff --git a/leiningen-core/README.md b/leiningen-core/README.md
index fa2c30d4d..b79a7b368 100644
--- a/leiningen-core/README.md
+++ b/leiningen-core/README.md
@@ -5,9 +5,6 @@ consists of the task execution implementation, project configuration,
and helper functions. The built-in tasks and the launcher scripts are
kept in the main `leiningen` project.
-More detailed [API reference](https://leiningen.org/reference.html) is
-available.
-
## Namespaces
* **leiningen.core.main** contains the `-main` entry point along with
@@ -32,7 +29,7 @@ it looks up the task which was invoked. Tasks are just functions named
after the task they implement and defined in the `leiningen.the-task`
namespace. They usually take a project map as their argument, but can
also run outside the context of a project. See the
-[plugin guide](https://github.com/technomancy/leiningen/blob/stable/doc/PLUGINS.md)
+[plugin guide](https://codeberg.org/leiningen/leiningen/src/stable/doc/PLUGINS.md)
for more details on how tasks are written. The `apply-task` function
looks up the task function, checks to make sure it can be applied to
the provided arguments, and then calls it.
@@ -69,7 +66,6 @@ itself, there's no need to enforce this isolation.
## License
-Copyright © 2011-2021 Phil Hagelberg and
-[contributors](https://github.com/technomancy/leiningen/graphs/contributors).
+Copyright © 2011-2022 Phil Hagelberg and contributors.
Distributed under the Eclipse Public License, the same as Clojure.
diff --git a/leiningen-core/dev-resources/leiningen/downloads.clj b/leiningen-core/dev-resources/leiningen/downloads.clj
deleted file mode 100644
index 107e8933d..000000000
--- a/leiningen-core/dev-resources/leiningen/downloads.clj
+++ /dev/null
@@ -1,110 +0,0 @@
-(use '[cemerick.pomegranate :only (add-dependencies)])
-
-(add-dependencies :coordinates '[[clj-aws-s3 "0.3.6"]
- [tentacles "0.2.4"]]
- :repositories (merge cemerick.pomegranate.aether/maven-central
- {"clojars" "https://clojars.org/repo"}))
-
-(ns leiningen.downloads
- "Calculate download statistics from logs."
- (:require [aws.sdk.s3 :as s3]
- [clojure.java.io :as io]
- [tentacles.repos :as repo]
- [clojure.pprint :refer [pprint]]
- [leiningen.core.main :as main])
- (:import (java.io File)))
-
-(defn ^:internal aws-cred []
-
- ;; in order to run, you need to define a map with the appropriate AWS
- ;; credentials in ~/.secrets/leiningen_downloads_aws_cred.clj:
-
- ;; {:access-key "AWS_ACCESS_KEY"
- ;; :secret-key "AWS_SECRET_KEY"}
- (let [f (File. (System/getenv "HOME")
- "/.secrets/leiningen_downloads_aws_cred.clj")]
- (if (.exists f)
- (read-string (slurp f))
- (main/abort "Missing credentials file:" f))))
-
-(defn- list-all-objects
- [bucket & [objects next-marker]]
- (let [response (s3/list-objects (aws-cred) bucket {:marker next-marker})
- truncated? (:truncated? response)
- next-marker (:next-marker response)
- objects (concat objects (:objects response))]
- (if (not truncated?)
- objects
- (recur bucket [objects next-marker]))))
-
-(defn- fetch-all-objects
- [bucket]
- (for [object (list-all-objects bucket)]
- (do
- (println (str "Processing: " (:key object)))
- (s3/get-object (aws-cred) bucket (:key object)))))
-
-(defn- file-for-line
- [line]
- (let [[_ file] (re-find #"\"GET ([^ ]+) " line)]
- (if file
- (last (.split file "/")))))
-
-(defn- ip-for-line
- [line]
- (re-find #"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b" line))
-
-(defn- status-for-line
- [line]
- (second (re-find #"\" (\d\d\d)" line)))
-
-(defn- parse-files
- [content]
- (with-open [rdr (io/reader content)]
- (doall (for [line (line-seq rdr)]
- {:file (file-for-line line)
- :status (status-for-line line)
- :ip (ip-for-line line)}))))
-
-(defn- s3-downloads
- []
- (flatten
- (for [logfile (map :content (fetch-all-objects "leiningen-logs"))]
- (filter #(and (get % :file) ;; file is present
- (re-find #"\.jar\b" (get % :file)) ;; file is a jar
- (= "200" (get % :status))) ;; and only HTTP 200 responses
- (parse-files logfile)))))
-
-(defn- github-downloads
- []
- (reverse
- (sort-by #(first (vals %))
- (filter #(re-find #"\.jar$" (first (keys %)))
- (let [downloads {}]
- (for [download (repo/downloads "technomancy" "leiningen")]
- (assoc downloads
- (:name download)
- (:download_count download))))))))
-
-(defn ^:no-project-needed downloads [project]
- (let [s3-downloads (s3-downloads)
- s3-download-count (count s3-downloads)
- github-downloads (github-downloads)
- github-download-count
- (reduce + (map #(first (vals %)) github-downloads))]
- (println (str "GitHub Downloads: " github-download-count))
- (println (str "S3 Downloads: " s3-download-count))
- (println (str "Unique IP Addresses (S3 Downloads Only): "
- (count (distinct (map :ip s3-downloads)))))
- (println (str "Total Downloads: "
- (+ github-download-count s3-download-count)))
- (print "\n\n")
- (println "GitHub downloads by file:")
- (print "\n\n")
- (pprint github-downloads)
- (print "\n\n")
- (println "S3 downloads by file:")
- (print "\n\n")
- (pprint (frequencies (map :file s3-downloads)))
- (println ""))) ;; need this last println for some reason or else
- ;; the above doesn't print out using lein run...
diff --git a/leiningen-core/pom.xml b/leiningen-core/pom.xml
index b96f2ad73..63bab4c33 100644
--- a/leiningen-core/pom.xml
+++ b/leiningen-core/pom.xml
@@ -1,121 +1,160 @@
-
-
+ Sorry. Couldn't Find That Page! You probably want + to go home?
+