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/project.clj | 4 +++- lux-lein/src/leiningen/lux/builder.clj | 11 ++--------- lux-lein/src/leiningen/lux/test.clj | 4 ++-- lux-lein/src/leiningen/lux/utils.clj | 4 ++-- 4 files changed, 9 insertions(+), 14 deletions(-) (limited to 'lux-lein') diff --git a/lux-lein/project.clj b/lux-lein/project.clj index d9c1cabc2..9ab37a5f2 100644 --- a/lux-lein/project.clj +++ b/lux-lein/project.clj @@ -1,4 +1,6 @@ -(defproject com.github.luxlang/lein-luxc "0.6.5" +(def version "0.6.6-SNAPSHOT") + +(defproject com.github.luxlang/lein-luxc #=(identity version) :description "The Leiningen plugin for the Lux programming language." :url "https://github.com/LuxLang/lux" :license {:name "Lux License v0.1.2" 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