Documentation, news, todo updates.

This commit is contained in:
Phil Hagelberg 2012-06-27 16:06:48 -07:00
parent c79349d568
commit a6659e15fa
8 changed files with 58 additions and 61 deletions

10
NEWS.md
View file

@ -2,15 +2,17 @@
## 2.0.0-preview7 / 2012-06-??
* Fix a bug where failed javac wouldn't abort. (Michael Klishin)
* Check task aliases everywhere tasks are invoked.
* Sign jars and poms of releases upon deploy by default.
* Don't decrypt `credentials.clj.gpg` for every request.
* Support setting `:mirrors` in project.clj. (Chas Emerick, Nelson Morris)
* Allow aliases shadowing task names to invoke shadowed tasks.
* Emit `doc/intro.md` in new project templates.
* Allow :scm to be set in project.clj for pom inclusion. (Florian Anderiasch)
* Fix a bug where dependency :classifiers and :extensions would be ignored.
* Speed up subprocess launches when :bootclasspath is set.
* Set user agent. (Bruce Adams)
* Allow `:scm` to be set in project.clj for pom inclusion. (Florian Anderiasch)
* Fix a bug where dependency `:classifier` and `:extension` would be ignored.
* Speed up subprocess launches when `:bootclasspath` is set.
* Set user agent for HTTP requests. (Bruce Adams)
* Verify signatures of dependencies with `lein deps :verify`.
* Move task chaining to `do` task in order to allow for higher-order use.

View file

@ -3,40 +3,21 @@
Getting your library into [Clojars](http://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).
However, deploying is not always as straightforward as the process
described there.
## Clojars Forks
Sometimes you'll need to publish libraries that you don't directly
maintain, either because the original maintainer hasn't published it
or because you need some bugfixes that haven't been applied upstream
yet. Don't do this if it's at all possible to get the upstream project
to release a snapshot somewhere with the changes you need, but in some
cases it's unavoidable.
In this case you don't want to publish it under its original group-id,
since either you won't have permission to do so (if it's already on
Clojars) or it will conflict with the same artifact on other
repositories. You should use "org.clojars.$USERNAME" as the group-id
instead.
If it's a Clojure project that already has a project.clj file, it's
easy enough to just follow the regular `lein deploy clojars`
path. If you don't have a readily-available project.clj, you can create a
dummy project with `lein new`. Edit project.clj to include your
`org.clojars.$USERNAME` group-id, the project's original artifact name,
and the version. Then deploy from there.
However, deploying is not always that straightforward.
## Private Repositories
There may be times when you want to make a library available to your
team without making it public. This is best done by setting up a
private repository. Both [Archiva](http://archiva.apache.org/)
and [Nexus](http://nexus.sonatype.org/) will allow you to set up
private, password-protected repositories. These also provide proxying
to other repositories, so you can set `:omit-default-repositories`
in project.clj, and dependency downloads will speed up by quite a bit
private repository. The simplest kind of private repository is an
[Amazon S3](http://aws.amazon.com/s3/) bucket. You can deploy to S3
buckets using [S3 wagon private](https://github.com/technomancy/s3-wagon-private).
Alternatively you can run a private repository on your own server.
Both [Archiva](http://archiva.apache.org/) and
[Nexus](http://nexus.sonatype.org/) provide this as well as proxying
to other repositories, so you can set `:omit-default-repositories` in
project.clj, and dependency downloads will speed up by quite a bit
with only one server to check.
The private server will need to be added to the `:repositories`
@ -59,24 +40,33 @@ projects may also be specified in the `:user` profile in `~/.lein/profiles.clj`:
{:user {:deploy-repositories {"internal" "http://blueant.com/archiva/internal"}}}
```
### Authentication
## Authentication
Deploying and reading from private repositories needs authentication
credentials. Check your repository's documentation for details, but
you'll usually need to provide either a `:username`/`:password`
combination or a `:private-key` location with or without a
you'll usually need to provide a `:username` and `:password` or
`:passphrase`. Leiningen will prompt you for a password if you 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](http://www.gnupg.org/) installed and a key pair configured.
If you specify `:gpg` in one of your `:repositories` settings maps,
Leiningen will decrypt `~/.lein/credentials.clj.gpg` and use that to
find the proper credentials for the given repository.
```clj
:repositories {"releases" {:url "http://blueant.com/archiva/internal"
:username "milgrim" :password :gpg}}
```
First write your credentials map to `~/.lein/credentials.clj` like so:
```clj
{#"https://clojars.org/repo"
{#"blueant" {:password "locative1"}
#"https://clojars.org/repo"
{:username "milgrim" :password "locative1"}
"s3p://s3-repo-bucket/releases"
{:username "AKIAIN..." :password "1TChrGK4s..."}}
{:username "AKIAIN..." :passphrase "1TChrGK4s..."}}
```
Then encrypt it with `gpg`:
@ -95,7 +85,12 @@ haven't entered it. If yours does not, you can install
[Keychain](https://github.com/funtoo/keychain), which provides this
functionality portably.
### Deployment
Unattended builds can specify `:env` instead of `:gpg` in the
repository specification to have credentials looked up in the
environment. For example, specifying `:password :env` will cause
Leiningen to look up `(System/getenv "LEIN_PASSWORD")` for that value.
## Deployment
Once you've set up a private repository and configured project.clj
appropriately, you can deploy to it:

View file

@ -86,10 +86,12 @@
example.) Otherwise you can use the basic `lein repl`.
**Q:** Still too slow; what else can make startup faster?
**A:** If you are running an older version of Leiningen (before 1.7)
you can `export LEIN_JVM_OPTS=-XX:+TieredCompilation` to improve
boot time. This requires Hotspot version 20 or newer. On newer versions
of Leiningen it is enabled automatically.
**A:** You can usually set `:bootclasspath true` in project.clj to
speed up project launches, though there are compatibility issues in
some cases. If you are running an older version of Leiningen (before
1.7) you can also `export LEIN_JVM_OPTS=-XX:+TieredCompilation` to
improve boot time. This requires Hotspot version 20 or newer. On
newer versions of Leiningen it is enabled automatically.
**Q:** Why is Leiningen 2 still in a preview release?
**A:** As of the preview3 release, Leiningen 2 is very stable and

View file

@ -17,11 +17,11 @@ lein-myplugin`, and edit the `myplugin` defn in the
`leiningen.myplugin` namespace. You'll notice the `project.clj` file
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 should not declare a dependency on
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/master/project.clj)
will be available. However, it doesn't hurt to be specific since
Leiningen's dependencies may change in future versions.
Leiningen's other dependencies may change in future versions.
See the `lein-pprint` directory
[in the Leiningen source](https://github.com/technomancy/leiningen/tree/master/lein-pprint)
@ -106,6 +106,8 @@ need. For example, this is done in the `lein-swank` plugin like so:
(swank-form project port host opts))))
```
TODO: switch to profiles for this
The code in the `swank-clojure` dependency is needed inside the
project, so it's `conj`ed into the `:dependencies`.
@ -151,23 +153,18 @@ that call `add-hook`. You may place calls to `add-hook` at the
top-level of the namespace, but if an `activate` defn is present it
will be called; this is the best place to put `add-hook` invocations.
If you need to use hooks from code that runs inside the project's
process, you may use `leiningen.core.injected/add-hook`, which is an
isolated copy of `robert.hooke/add-hook` injected into the project in
order to support features like test selectors.
See [the documentation for
Hooke](https://github.com/technomancy/robert-hooke/blob/master/README.md)
for more details.
## Clojure Version
Leiningen 2.0.0 uses Clojure 1.3.0. If you need to use a different
Leiningen 2.0.0 uses Clojure 1.4.0. If you need to use a different
version of Clojure from within a Leiningen plugin, you can use
`eval-in-project` with a dummy project argument:
```clj
(eval-in-project {:dependencies '[[org.clojure/clojure "1.4.0-beta1"]]}
(eval-in-project {:dependencies '[[org.clojure/clojure "1.5.0-alpha"]]}
'(println "hello from" *clojure-version*))
```
@ -284,8 +281,8 @@ feel free to fork the project and submit a pull request.
## Have Fun
Please add your plugins to [the list on the
wiki](http://wiki.github.com/technomancy/leiningen/plugins).
Please add your plugin to [the list on the
wiki](http://wiki.github.com/technomancy/leiningen/plugins) once it's ready.
Hopefully the plugin mechanism is simple and flexible enough to let
you bend Leiningen to your will.

View file

@ -52,8 +52,9 @@ a collection and replacing it if it's not. Profiles specified earlier
take precedence when replacing. The dev profile takes precedence over
user by default. Maps are merged recursively, sets are combined with
`clojure.set/union`, and lists/vectors are concatenated. You can add
hints via metadata that a given value should take precedence or be
displaced if you want to override this logic:
hints via metadata that a given value should take precedence
(`:replace`) or defer to values from a different profile (`:displace`)
if you want to override this logic:
```clj
{:profiles {:dev {:prep-tasks ^:replace ["clean" "compile"]
@ -116,5 +117,5 @@ In order to prevent profile settings from being propagated to other
projects that depend upon yours, the default profiles are removed from
your project when generating the pom, jar, and uberjar. Profiles
activated through an explicit `with-profile` invocation will be
preserved. The `repl` task uses its own profile in order to inject
dependencies needed for the repl to function.
preserved. The `repl` and `test` tasks use their own profile in order
to inject needed functionality.

View file

@ -86,7 +86,6 @@
;; logic, but since :dependencies are a vector, the :replace/:displace
;; calculations don't apply to nested vectors inside :dependencies.
(let [[seen-dep] (filter #(= (first %) (first x)) deps)]
;; TODO: this stomps on :classifier and :extension non-dupes
(if (or (:displace (meta seen-dep)) (:replace (meta x)))
[(assoc deps (.indexOf deps seen-dep) x) seen]
[deps seen]))

View file

@ -13,7 +13,6 @@
(io/file (System/getProperty "user.home") ".lein"))]
(.getAbsolutePath (doto lein-home .mkdirs))))
;; TODO: is this still needed now that we have the user profile?
(def init
"Load the user's ~/.lein/init.clj file, if present."
(memoize (fn []

View file

@ -4,6 +4,8 @@ See also https://github.com/technomancy/leiningen/issues
* For 2.0.0
** 2.0.0-final
- [ ] Implement add-profiles task (#661)
- [ ] Allow trampoline to work with chaining in do task (#665)
- [ ] Reduce Aether verbosity (#610)
- [ ] Improve speed of trampoline restarts (#573)
- [ ] Isolate target dir per profile (#468)
@ -17,7 +19,7 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Check project for :scm (#640)
- [X] Mirror support (#271)
- [X] Only look up repo credentials when necessary (#657)
- [ ] Allow jars to be signed, document in deploying guide. (#519)
- [X] Allow jars to be signed, document in deploying guide. (#519)
- [X] Fix javac to abort on failure (#658)
** preview4
- [X] Don't re-extract native deps (#535)