From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Jul 2022 14:35:38 -0400 Subject: First-class programs instead of having a "lux program" extension. --- lux-lein/src/leiningen/lux/builder.clj | 11 ++--------- lux-lein/src/leiningen/lux/test.clj | 4 ++-- lux-lein/src/leiningen/lux/utils.clj | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) (limited to 'lux-lein/src/leiningen') diff --git a/lux-lein/src/leiningen/lux/builder.clj b/lux-lein/src/leiningen/lux/builder.clj index 408af5c7b..e25d1818f 100644 --- a/lux-lein/src/leiningen/lux/builder.clj +++ b/lux-lein/src/leiningen/lux/builder.clj @@ -4,15 +4,8 @@ [packager :as &packager]))) (defn build [project] - (if-let [program-module (get-in project [:lux :program])] - ;; (if-let [command (&utils/build-jvm project program-module)] - ;; (when (time (&utils/run-process command - ;; nil - ;; "[COMPILATION BEGAN]" - ;; "[COMPILATION ENDED]")) - ;; true) - ;; ) - (let [command (&utils/compile-path project program-module (get project :source-paths (list)))] + (if-let [[program-module program-definition] (get-in project [:lux :program])] + (let [command (&utils/compile-path project program-module program-definition (get project :source-paths (list)))] (when (time (&utils/run-process command nil "[COMPILATION BEGAN]" diff --git a/lux-lein/src/leiningen/lux/test.clj b/lux-lein/src/leiningen/lux/test.clj index 84ba33d58..a51a2c3bc 100644 --- a/lux-lein/src/leiningen/lux/test.clj +++ b/lux-lein/src/leiningen/lux/test.clj @@ -7,8 +7,8 @@ (def missing-module-error "Please provide a test module in [:lux :test]") (defn test [project] - (if-let [test-module (get-in project [:lux :test])] - (when (time (&utils/run-process (&utils/compile-path project test-module (concat (:test-paths project) (:source-paths project))) + (if-let [[test-module test-definition] (get-in project [:lux :test])] + (when (time (&utils/run-process (&utils/compile-path project test-module test-definition (concat (:test-paths project) (:source-paths project))) nil "[COMPILATION BEGAN]" "[COMPILATION ENDED]")) diff --git a/lux-lein/src/leiningen/lux/utils.clj b/lux-lein/src/leiningen/lux/utils.clj index f18da2831..abcd907c6 100644 --- a/lux-lein/src/leiningen/lux/utils.clj +++ b/lux-lein/src/leiningen/lux/utils.clj @@ -87,7 +87,7 @@ " " (get project :target-path default-target-dir))) (do-template [ ] - (defn [project module source-paths] + (defn [project module definition source-paths] (let [is-stdlib? (= stdlib-id (project-id project)) raw-paths (project-jars project) @@ -128,7 +128,7 @@ " -cp " (str compiler-class-path java.io.File/pathSeparator program-class-path) " " (lux-command project program-dependencies source-paths)))) - compile-path (str "release " module) + compile-path (str "release " module " " definition) repl-path "repl" ) -- cgit v1.2.3