aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lux-lein/src/leiningen/lux/utils.clj2
-rw-r--r--luxc/src/lux.clj8
-rw-r--r--luxc/src/lux/compiler.clj17
3 files changed, 14 insertions, 13 deletions
diff --git a/lux-lein/src/leiningen/lux/utils.clj b/lux-lein/src/leiningen/lux/utils.clj
index c70ec2289..a786a4d6d 100644
--- a/lux-lein/src/leiningen/lux/utils.clj
+++ b/lux-lein/src/leiningen/lux/utils.clj
@@ -90,7 +90,7 @@
(str (java-command project) " -cp " class-path
" " (lux-command project <mode> source-paths))))
- compile-path (str "release " module)
+ compile-path (str "release jvm " module)
repl-path "repl"
)
diff --git a/luxc/src/lux.clj b/luxc/src/lux.clj
index 182ddf46f..2daf0000a 100644
--- a/luxc/src/lux.clj
+++ b/luxc/src/lux.clj
@@ -19,11 +19,11 @@
(defn -main [& args]
(|case (&/->list args)
- (&/$Cons "release" (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Cons target-dir (&/$Nil))))))
- (time (&compiler/compile-program &/$Release program-module (separate-paths resources-dirs) (separate-paths source-dirs) target-dir))
+ (&/$Cons "release" (&/$Cons platform (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Cons target-dir (&/$Nil)))))))
+ (time (&compiler/compile-program platform &/$Release program-module (separate-paths resources-dirs) (separate-paths source-dirs) target-dir))
- (&/$Cons "debug" (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Cons target-dir (&/$Nil))))))
- (time (&compiler/compile-program &/$Debug program-module (separate-paths resources-dirs) (separate-paths source-dirs) target-dir))
+ (&/$Cons "debug" (&/$Cons platform (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Cons target-dir (&/$Nil)))))))
+ (time (&compiler/compile-program platform &/$Debug program-module (separate-paths resources-dirs) (separate-paths source-dirs) target-dir))
(&/$Cons "repl" (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Cons target-dir (&/$Nil)))))
(&repl/repl (separate-paths resources-dirs)
diff --git a/luxc/src/lux/compiler.clj b/luxc/src/lux/compiler.clj
index 0e78fa766..bffedb69e 100644
--- a/luxc/src/lux/compiler.clj
+++ b/luxc/src/lux/compiler.clj
@@ -10,13 +10,14 @@
[js :as &&js]
)))
-(defn init! [resources-dirs ^String target-dir]
+(defn init! [platform resources-dirs ^String target-dir]
(do (reset! &&core/!output-dir target-dir)
(&&parallel/setup!)
(&&io/init-libs!)
(.mkdirs (new java.io.File target-dir))
- (&&jvm/init! resources-dirs target-dir)
- ;; (&&js/init! resources-dirs target-dir)
+ (case platform
+ "jvm" (&&jvm/init! resources-dirs target-dir)
+ "js" (&&js/init! resources-dirs target-dir))
))
(def all-compilers
@@ -28,8 +29,8 @@
(defn compile-module [source-dirs name]
(&&jvm/compile-module source-dirs name))
-(defn compile-program [mode program-module resources-dir source-dirs target-dir]
- (init! resources-dir target-dir)
- (&&jvm/compile-program mode program-module resources-dir source-dirs target-dir)
- ;; (&&js/compile-program mode program-module resources-dir source-dirs target-dir)
- )
+(defn compile-program [platform mode program-module resources-dir source-dirs target-dir]
+ (init! platform resources-dir target-dir)
+ (case platform
+ "jvm" (&&jvm/compile-program mode program-module resources-dir source-dirs target-dir)
+ "js" (&&js/compile-program mode program-module resources-dir source-dirs target-dir)))