File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 56705670 (load-one lib need-ns require )
56715671 @*loaded-libs*))))
56725672
5673+ (defn- already-compiled? [lib]
5674+ (let [path (subs (root-resource lib) 1 )
5675+ clj-path (str path " .clj" )
5676+ class-path (str path " __init.class" )
5677+ loader (clojure.lang.RT/baseLoader )
5678+ compiled-file (java.io.File. (str *compile-path* " /" class-path))
5679+ clj-url (.getResource loader clj-path)]
5680+ (or (and (.exists compiled-file)
5681+ (or (nil? clj-url)
5682+ (> (clojure.lang.RT/lastModified (-> compiled-file .toURI .toURL) class-path)
5683+ (clojure.lang.RT/lastModified clj-url clj-path))))
5684+ (.getResource loader class-path))))
5685+
56735686(defn- load-lib
56745687 " Loads a lib with options"
56755688 [prefix lib & options]
56795692 (let [lib (if prefix (symbol (str prefix \. lib)) lib)
56805693 opts (apply hash-map options)
56815694 {:keys [as reload reload-all require use verbose]} opts
5682- loaded (contains? @*loaded-libs* lib)
5695+ loaded (and (contains? @*loaded-libs* lib)
5696+ (or (not *compile-files*)
5697+ (already-compiled? lib)))
56835698 load (cond reload-all
56845699 load-all
56855700 (or reload (not require ) (not loaded))
You can’t perform that action at this time.
0 commit comments