Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do full AOT in Leiningen project itself.
Can't get it to boot in under a second otherwise.
  • Loading branch information
technomancy committed Mar 7, 2012
1 parent 6d05f4f commit 201afa4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bin/lein
Expand Up @@ -102,13 +102,16 @@ if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
cd "$ORIG_PWD"
fi

mkdir -p "$LEIN_DIR/target/classes"
export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Dclojure.compile.path=$LEIN_DIR/target/classes"}
CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/src/"
CLASSPATH="$CLASSPATH:$(cat $LEIN_DIR/.lein-classpath 2> /dev/null)"
CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/lib/*"
CLASSPATH="$CLASSPATH:$LEIN_DIR/test:$LEIN_DIR/src:$LEIN_DIR/resources:$LEIN_JAR"
CLASSPATH="$CLASSPATH:$LEIN_DIR/test:$LEIN_DIR/classes:$LEIN_DIR/src:$LEIN_DIR/resources:$LEIN_JAR"
else
# Not running from a checkout
CLASSPATH="$CLASSPATH:$LEIN_JAR"
export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Xbootclasspath/a:$LEIN_JAR"}

if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
"$0" self-install
Expand All @@ -128,7 +131,6 @@ export LEIN_JAVA_CMD=${LEIN_JAVA_CMD:-$JAVA_CMD}

# Support $JAVA_OPTS for backwards-compatibility.
export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Xbootclasspath/a:$LEIN_JAR"}

# 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)
Expand Down
6 changes: 5 additions & 1 deletion project.clj
Expand Up @@ -17,12 +17,16 @@
:profiles {:dev {:resource-paths ["leiningen-core/dev-resources"]
:test-paths ["leiningen-core/test"]}}
:test-selectors {:default (complement :busted)}
:aot [#"leiningen" leiningen.core.main leiningen.core.eval
leiningen.core.project leiningen.core.classpath leiningen.core.user]
:eval-in :leiningen)

;;; Release Checklist

;; * update NEWS, bin/lein, bin/lein.bat, project.clj, pom
;; * rm -rf target, compile :all, generate uberjar, upload
;; * rm -rf target ~/.lein/self-installs/leiningen-*-SNAPSHOT-standalone.jar
;; * temporarily add :aot :all to leiningen-core/project.clj; lein install
;; * bin/lein uberjar, upload
;; * test self-install
;; * git tag
;; * push, push tags, update stable branch
Expand Down
4 changes: 2 additions & 2 deletions src/leiningen/pom.clj
@@ -1,5 +1,5 @@
(ns leiningen.pom
"Write a pom.xml file to disk for Maven interop."
"Write a pom.xml file to disk for Maven interoperability."
(:use [useful.string :only [camelize dasherize]])
(:require [leiningen.core.main :as main]
[leiningen.core.project :as project]
Expand Down Expand Up @@ -268,7 +268,7 @@
(str baos)))

(defn ^{:help-arglists '([])} pom
"Write a pom.xml file to disk for Maven interop."
"Write a pom.xml file to disk for Maven interoperability."
([project pom-location silently?]
(let [pom-file (io/file (:target-path project) pom-location)]
(.mkdirs (.getParentFile pom-file))
Expand Down
2 changes: 1 addition & 1 deletion todo.org
Expand Up @@ -29,13 +29,13 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Update new task
- [X] Switch user-settings to checking :user profile sans project
- [X] Offline mode
- [ ] Fix AOT issues with protocols in nrepl and data.xml
- [ ] Document subcommands in newnew
- [ ] Pretty-print pom
- [ ] Look for :java-cmd in project map
** Other stuff (post-preview)
- [ ] deps :tree and deps :list
- [ ] Honor hooks declared in plugin jar metadata?
- [ ] Show aliases in lein help
- [ ] Task-level profiles (nrepl dep comes from repl profile, etc)
Better visibility than either :default profile or associng straight in
- [ ] Investigate issues with :eval-in :classloader and bootclasspath
Expand Down

0 comments on commit 201afa4

Please sign in to comment.