I have the following code in a cljc file:
(ns proj #?(:cljs (:require-macros [proj :refer [define-project-version]]))) (declare project-version) #?(:clj (defmacro define-project-version [] `(def ~'project-version ~(first (drop 2 (read-string (slurp "project.clj"))))))) (define-project-version)
This works when used in clj files and when running REPL. However, as soon as I create uberjar and try to run it, I get an exception regarding project.clj - "There is no such file or directory." The error occurs from the ClojureScript part. Uberbar compiled just fine.
Why is the code trying to download project.clj? Are you supposed to run macros at compile time?
source share