Skip to content

Commit b763d8d

Browse files
author
dnolen
committed
fix the obvious cross platform issues with AOT cache
1 parent 1849c17 commit b763d8d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,22 +581,20 @@
581581
".cljs" ".aot_cache" (util/clojurescript-version)
582582
(build-affecting-options-sha path opts))))
583583

584-
;; TODO: we use a URL to get a bunch of file paths, the forward slashes probably
585-
;; aren't going to work for Windows
586584
(defn cacheable-files
587585
([rsrc ext]
588586
(cacheable-files rsrc ext nil))
589587
([rsrc ext opts]
590588
(let [{:keys [ns]} (ana/parse-ns rsrc)
591589
path (cache-base-path (util/path rsrc) opts)
592-
name (util/ns->relpath ns nil)]
590+
name (util/ns->relpath ns nil File/separatorChar)]
593591
(into {}
594592
(map
595593
(fn [[k v]]
596594
[k (io/file path
597-
(if (and (= "cljs/core$macros" name)
595+
(if (and (= (str "cljs" File/separatorChar "core$macros") name)
598596
(= :source k))
599-
(str "cljs/core.cljc")
597+
(str "cljs" File/separatorChar "core.cljc")
600598
(str name v)))]))
601599
{:source (str "." ext)
602600
:output-file ".js"

src/main/clojure/cljs/util.cljc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969
provide the file extension, defaults to :cljs."
7070
([ns] (ns->relpath ns :cljs))
7171
([ns ext]
72-
(cond-> (string/replace (munge-path ns) \. \/)
72+
(ns->relpath ns ext \/))
73+
([ns ext sep]
74+
(cond-> (string/replace (munge-path ns) \. sep)
7375
ext (str "." (name ext)))))
7476

7577
(defn ns->source

0 commit comments

Comments
 (0)