Skip to content
Browse files

Make uberjar create a $PROJECT-standalone.jar file.

  • Loading branch information...
1 parent 547e448 commit ab37c75fede616cb8a28ece92ee2d7c21ee31137 @technomancy committed Nov 20, 2009
Showing with 21 additions and 19 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 README.md
  3. +2 −2 bin/lein
  4. +16 −15 src/leiningen/jar.clj
  5. +1 −1 src/leiningen/uberjar.clj
View
1 .gitignore
@@ -6,3 +6,4 @@ leiningen.jar
pom-generated.xml
pom.xml
Manifest.txt
+lein-swank/lein-swank.jar
View
2 README.md
@@ -26,7 +26,7 @@ rather than copying and pasting among each of your projects.
## Installation
-1. Download the script: http://github.com/technomancy/leiningen/raw/master/bin/lein
+1. Download the script: http://github.com/technomancy/leiningen/raw/stable/bin/lein
2. Place it on your path and chmod it to be executable.
3. Run: <tt>lein self-install</tt>
View
4 bin/lein
@@ -9,8 +9,8 @@ LEIN_JAR=$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION.ja
# this needs to exist before the JVM is launched apparently
mkdir -p classes
-# If we are not running from a checkout
-if [ ! -r "bin/lein" ]; then
+# If we are not running from a compiled checkout
+if [ ! -r "classes/leiningen/core.class" -a ! -r "lib/clojure*jar" ]; then
if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
echo "Leiningen is not installed. Please run \"lein self-install\"."
exit 1
View
31 src/leiningen/jar.clj
@@ -15,18 +15,19 @@
"Create a $PROJECT.jar file containing the compiled .class files as well as
the source .clj files. If project.clj contains a :main symbol, it will be used
as the main-class for an executable jar."
- [project & args]
- (compile/compile project)
- (pom "pom-generated.xml" true)
- (let [jar-file (str (:root project) "/" (:name project) ".jar")
- filesets [{:dir *compile-path*}
- {:dir (str (:root project) "/src")}
- ;; TODO: place in META-INF/maven/$groupId/$artifactId/pom.xml
- ;; TODO: pom.properties
- {:file (str (:root project) "/pom-generated.xml")}
- {:file (str (:root project) "/project.clj")}]]
- ;; TODO: support slim, etc
- (apply lancet/jar {:jarfile jar-file
- :manifest (make-manifest project)}
- (map lancet/fileset filesets))
- jar-file))
+ ([project jar-name]
+ (compile/compile project)
+ (pom "pom-generated.xml" true)
+ (let [jar-file (str (:root project) "/" jar-name)
+ filesets [{:dir *compile-path*}
+ {:dir (str (:root project) "/src")}
+ ;; TODO: place in META-INF/maven/$groupId/$artifactId/pom.xml
+ ;; TODO: pom.properties
+ {:file (str (:root project) "/pom-generated.xml")}
+ {:file (str (:root project) "/project.clj")}]]
+ ;; TODO: support slim, etc
+ (apply lancet/jar {:jarfile jar-file
+ :manifest (make-manifest project)}
+ (map lancet/fileset filesets))
+ jar-file))
+ ([project] (jar project (str (:name project) ".jar"))))
View
2 src/leiningen/uberjar.clj
@@ -25,4 +25,4 @@ the dependency jars. Suitable for standalone distribution."
:when (.endsWith (.getName dep) ".jar")]
(println "Unpacking" (.getName dep))
(unzip dep *compile-path*))
- (jar project))
+ (jar project (str (:name project) "-standalone.jar")))

0 comments on commit ab37c75

Please sign in to comment.
Something went wrong with that request. Please try again.