Leiningen plugin for non-AOT uberjars
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind timmc:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
README.md
project.clj

README.md

lein-jit

Leiningen plugin to produce non-AOT uberjars.

An uberjar's main class must be AOT-compiled for the jar to work as an executable. Since AOT compilation is infectious (or "transitive"), most or all of the jar is also AOT'd, along with any linked libraries. This reduces portability.

lein-jit works by injecting a sacrificial loader class that is AOT compiled. This class inspects the jar's manifest file for an attribute (injected when the jar was created) bearing the name of the :main namespace, and calls clojure.main/main -m with that namespace. Because the loader is not statically linked against the rest of your codebase, the AOT compilation is restricted to the loader and any namespaces asking for gen-class (and anything they link against, of course.)

Usage

:dev-dependencies [[org.timmc/lein-jit "0.0.1"]]

$ lein deps, uberjar-jit

Currently, only the standalone jar is any good -- to produce a working non-uber jar, use lein jar instead. (TODO: fix jar case)

Compatible with Clojure 1.2 and 1.3. (Tested on 1.3.)

License

Copyright (C) 2012 Tim McCormack

Distributed under the Eclipse Public License, the same as Clojure.