Embedded Clojure in project.clj

22 views
Skip to first unread message

Pete Steyert-Woods

unread,
Nov 1, 2024, 8:56:46 AM11/1/24
to cur...@googlegroups.com
Hi everyone,

A few of the Clojure projects at our company use embedded Clojure in project.clj in order to load external resources (version numbers, large AOT information).

This works well in lein, but Cursive appears to use its own simple parser for project.clj that does not seem to support embedding Clojure.

Things like the below snippets:

(def project-dir
  "If this file is loaded from another location, we cannot rely on the workdir being the project dir."
  (.getParent (clojure.java.io/file *file*)))

(defproject my-project (try
  (slurp (clojure.java.io/file project-dir ".version"))
    (catch Exception _
      "0.1.1-SNAPSHOT"))

and this:

:profiles {:uberjar
            {:main ^:skip-aot circle.uberjar-init
             :aot ~(clojure.edn/read-string (slurp (clojure.java.io/file project-dir "aot.edn")))}}

One of my colleagues raised a ticket, which I believe this is the underlying issue for some time ago: https://github.com/cursive-ide/cursive/issues/2846

Is there any way the parser can be fixed to behave the same as lein? (e.g. is the lein one available as a library)

Thanks, Pete
Reply all
Reply to author
Forward
0 new messages