aboutsummaryrefslogtreecommitdiff
path: root/lux-lein/src/leiningen
diff options
context:
space:
mode:
Diffstat (limited to 'lux-lein/src/leiningen')
-rw-r--r--lux-lein/src/leiningen/lux/packager.clj5
-rw-r--r--lux-lein/src/leiningen/lux/utils.clj22
2 files changed, 14 insertions, 13 deletions
diff --git a/lux-lein/src/leiningen/lux/packager.clj b/lux-lein/src/leiningen/lux/packager.clj
index 1314ba0be..c5749eaa8 100644
--- a/lux-lein/src/leiningen/lux/packager.clj
+++ b/lux-lein/src/leiningen/lux/packager.clj
@@ -131,9 +131,8 @@
(defn package
"(-> Text (List Text) Null)"
[project module resources-dirs]
- (let [output-dir (get-in project [:lux :target] &utils/default-output-dir)
- output-package-name (get project :jar-name &utils/output-package)
- output-dir (get-in project [:lux :target] &utils/default-output-dir)
+ (let [output-package-name (get project :jar-name &utils/output-package)
+ output-dir (&utils/prepare-path (get-in project [:lux :target] &utils/default-output-dir))
output-package (str output-dir java.io.File/separator output-package-name)
!all-jar-files (atom {})
includes-android? (boolean (some #(-> % first (= 'com.google.android/android))
diff --git a/lux-lein/src/leiningen/lux/utils.clj b/lux-lein/src/leiningen/lux/utils.clj
index 824779a22..1c72ed06b 100644
--- a/lux-lein/src/leiningen/lux/utils.clj
+++ b/lux-lein/src/leiningen/lux/utils.clj
@@ -20,9 +20,10 @@
;; "-server -Xms2048m -Xmx2048m -XX:+OptimizeStringConcat"
)
-(defn ^:private prepare-path [path]
- (let [path (if (and (.startsWith path "/")
- (= "\\" java.io.File/separator))
+(defn prepare-path [path]
+ (let [is-windows? (and (.startsWith path "/")
+ (= "\\" java.io.File/separator))
+ path (if is-windows?
(.substring path 1)
path)
path (.replace path "/" java.io.File/separator)]
@@ -98,6 +99,8 @@
repl-path "repl"
)
+(def ^:private normal-exit 0)
+
(defn run-process [command working-directory pre post]
(let [process (.exec (Runtime/getRuntime) command nil working-directory)]
(with-open [std-out (->> process .getInputStream (new InputStreamReader) (new BufferedReader))
@@ -107,10 +110,9 @@
(when line
(println line)
(recur (.readLine std-out))))
- (let [first-error-line (.readLine std-err)]
- (do (loop [line first-error-line]
- (when line
- (println line)
- (recur (.readLine std-err))))
- (println post)
- (nil? first-error-line))))))
+ (loop [line (.readLine std-err)]
+ (when line
+ (println line)
+ (recur (.readLine std-err))))
+ (println post)
+ (= normal-exit (.waitFor process)))))