Skip to content

Commit

Permalink
Changes to make sure that we're always pulling files from the source …
Browse files Browse the repository at this point in the history
…so that we get the right file names
  • Loading branch information
tomfaulhaber committed Nov 24, 2010
1 parent f800d32 commit 880eb6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions params/clojure-contrib/params.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
:status "stable"
:params {:built-clojure-jar "/home/tom/src/clj/clojure-master/clojure-slim.jar"
:source-path "src/main/clojure"
:load-classpath [(str root "/target/classes")]}},
:load-classpath [(str root "/src/main/clojure") (str root "/target/classes")]}},
{:name "master"
:version "v1.3"
:status "in development"
:params {:built-clojure-jar "/home/tom/src/clj/clojure-master/clojure-slim.jar"
:source-path "modules"
:load-classpath [(str root "/target/classes")]}},
:load-classpath [#"/modules/[^/]+/src/main/clojure$" (str root "/target/classes")]}},
{:name "1.1.x"
:version "v1.1"
:status "stable"
Expand Down
12 changes: 11 additions & 1 deletion src/autodoc/branches.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
(system (str "git checkout " branch))
(system (str "git merge origin/" branch))))

(defn expand-wildcards
"Find all the files under root that match re. Not truly wildcard expansion, but..."
[root re]
(if (instance? java.util.regex.Pattern re)
(for [f (file-seq (File. root)) :when (re-find re (.getAbsolutePath f))]
(.getAbsolutePath f))
(list re)))

(defn path-str [path-seq]
(apply str (interpose (System/getProperty "path.separator")
(map #(.getAbsolutePath (file %)) path-seq))))
Expand All @@ -43,9 +51,11 @@
(for [jar-dir jar-dirs]
(filter #(.endsWith (.getName %) ".jar")
(file-seq (java.io.File. jar-dir))))))

(defn do-collect
"Collect the namespace and var info for the checked out branch"
[branch-name]
(println "cp-exp" (mapcat (partial expand-wildcards (params :root)) (params :load-classpath)))
(let [class-path (concat
(filter
identity
Expand All @@ -54,7 +64,7 @@
"src"
(.getPath (File. (params :root) (params :source-path)))
"."])
(params :load-classpath)
(mapcat (partial expand-wildcards (params :root)) (params :load-classpath))
(expand-jar-path (params :load-jar-dirs)))
tmp-file (File/createTempFile "collect-" ".clj")]
(exec-clojure class-path
Expand Down

0 comments on commit 880eb6a

Please sign in to comment.