|
170 | 170 | :fn-invoke-direct :checked-arrays :closure-module-roots :rewrite-polyfills :use-only-custom-externs
|
171 | 171 | :watch :watch-error-fn :watch-fn :install-deps :process-shim :rename-prefix :rename-prefix-namespace
|
172 | 172 | :closure-variable-map-in :closure-property-map-in :closure-variable-map-out :closure-property-map-out
|
173 |
| - :stable-names :ignore-js-module-exts :opts-cache}) |
| 173 | + :stable-names :ignore-js-module-exts :opts-cache :aot-cache}) |
174 | 174 |
|
175 | 175 | (def string->charset
|
176 | 176 | {"iso-8859-1" StandardCharsets/ISO_8859_1
|
|
635 | 635 | (util/clojurescript-version))
|
636 | 636 | (util/changed? jar-file out-file))
|
637 | 637 | ;; actually compile from JAR
|
638 |
| - (let [cache-path (cache-base-path (util/path jar-file) opts)] |
639 |
| - (when-not (.exists (:output-file cacheable)) |
640 |
| - (-compile (jar-file-to-disk jar-file cache-path opts) |
641 |
| - (assoc opts :output-dir (util/path cache-path)))) |
642 |
| - (doseq [[k ^File f] cacheable] |
643 |
| - (when (.exists f) |
644 |
| - (let [target (io/file (util/output-directory opts) |
645 |
| - (-> (.getAbsolutePath f) |
646 |
| - (string/replace (.getAbsolutePath cache-path) "") |
647 |
| - (subs 1)))] |
648 |
| - (when (and (or ana/*verbose* (:verbose opts)) (= :output-file k)) |
649 |
| - (util/debug-prn (str "Copying cached " f " to " target))) |
650 |
| - (util/mkdirs target) |
651 |
| - (spit target (slurp f)) |
652 |
| - (.setLastModified target (util/last-modified jar-file))))))) |
| 638 | + (if-not (:aot-cache opts) |
| 639 | + (-compile (jar-file-to-disk jar-file (util/output-directory opts) opts) opts) |
| 640 | + (let [cache-path (cache-base-path (util/path jar-file) opts)] |
| 641 | + (when-not (.exists (:output-file cacheable)) |
| 642 | + (-compile (jar-file-to-disk jar-file cache-path opts) |
| 643 | + (assoc opts :output-dir (util/path cache-path)))) |
| 644 | + (doseq [[k ^File f] cacheable] |
| 645 | + (when (.exists f) |
| 646 | + (let [target (io/file (util/output-directory opts) |
| 647 | + (-> (.getAbsolutePath f) |
| 648 | + (string/replace (.getAbsolutePath cache-path) "") |
| 649 | + (subs 1)))] |
| 650 | + (when (and (or ana/*verbose* (:verbose opts)) (= :output-file k)) |
| 651 | + (util/debug-prn (str "Copying cached " f " to " target))) |
| 652 | + (util/mkdirs target) |
| 653 | + (spit target (slurp f)) |
| 654 | + (.setLastModified target (util/last-modified jar-file)))))))) |
653 | 655 | ;; have to call compile-file as it includes more IJavaScript
|
654 | 656 | ;; information than ana/parse-ns for now
|
655 | 657 | (compile-file
|
|
2274 | 2276 | (nil? (:opts-cache opts))
|
2275 | 2277 | (assoc :opts-cache "cljsc_opts.edn")
|
2276 | 2278 |
|
| 2279 | + (nil? (:aot-cache opts)) |
| 2280 | + (assoc :aot-cache true) |
| 2281 | + |
2277 | 2282 | (contains? opts :modules)
|
2278 | 2283 | (ensure-module-opts)
|
2279 | 2284 |
|
|
0 commit comments