(cache-file src)
(cache-file src output-dir)
(cache-file src ns-info output-dir)
(cache-file src ns-info output-dir mode)
Given a ClojureScript source file returns the read/write path to the analysis
cache file. Defaults to the read path which is usually also the write path.
Source
(defn cache-file
"Given a ClojureScript source file returns the read/write path to the analysis
cache file. Defaults to the read path which is usually also the write path."
([src] (cache-file src "out"))
([src output-dir] (cache-file src (parse-ns src) output-dir))
([src ns-info output-dir]
(cache-file src (parse-ns src) output-dir :read))
([src ns-info output-dir mode]
{:pre [(map? ns-info)]}
(let [ext (cache-analysis-ext)]
(if-let [core-cache
(and (= mode :read)
(= (:ns ns-info) 'cljs.core)
(io/resource (str "cljs/core.cljs.cache.aot." ext)))]
core-cache
(let [target-file (util/to-target-file output-dir ns-info
(util/ext (:source-file ns-info)))]
(io/file (str target-file ".cache." ext)))))))