aboutsummaryrefslogtreecommitdiff
path: root/lux-lein/src/leiningen/lux/builder.clj
diff options
context:
space:
mode:
Diffstat (limited to 'lux-lein/src/leiningen/lux/builder.clj')
-rw-r--r--lux-lein/src/leiningen/lux/builder.clj19
1 files changed, 13 insertions, 6 deletions
diff --git a/lux-lein/src/leiningen/lux/builder.clj b/lux-lein/src/leiningen/lux/builder.clj
index ca9088d4c..65f45b90c 100644
--- a/lux-lein/src/leiningen/lux/builder.clj
+++ b/lux-lein/src/leiningen/lux/builder.clj
@@ -4,10 +4,17 @@
[packager :as &packager])))
(defn build [project]
- (if-let [program-module (get-in project [:lux :program])]
- (when (&utils/run-process (&utils/compile-path project program-module (get project :source-paths (list)))
- nil
- "[BUILD BEGIN]"
- "[BUILD END]")
- (&packager/package project program-module (get project :resource-paths (list))))
+ (if-let [program-modules (get-in project [:lux :program])]
+ (do (when-let [jvm-module (get-in program-modules [:jvm])]
+ (when (&utils/run-process (&utils/compile-path project "jvm" jvm-module (get project :source-paths (list)))
+ nil
+ "[BUILD BEGIN]"
+ "[BUILD END]")
+ (&packager/package project "jvm" jvm-module (get project :resource-paths (list)))))
+ (when-let [js-module (get-in program-modules [:js])]
+ (when (&utils/run-process (&utils/compile-path project "js" js-module (get project :source-paths (list)))
+ nil
+ "[BUILD BEGIN]"
+ "[BUILD END]")
+ (&packager/package project "js" js-module (get project :resource-paths (list))))))
(println "Please provide a program main module in [:lux :program]")))