Skip to content

Commit 345c21e

Browse files
committed
parameterized
1 parent fc14a99 commit 345c21e

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.cpcache/
22
analysis.edn
3-
/config.clj
3+
/proj.clj
44
/repo/
55
/repo-docs/

build.clj

+17-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,25 @@
1111

1212
(def shared (edn-read "params.clj"))
1313

14+
(def custom
15+
{"core.cache" {:name "A caching library implementing various cache strategies"}
16+
"spec.alpha" {:name "Specifying the structure of data and functions."}
17+
})
18+
1419
(p/merge-params
15-
(merge shared
16-
{:root (str (.getAbsolutePath (File. "repo")) "/")
17-
:output-path (str (.getAbsolutePath (File. "repo-docs")) "/")}))
20+
(merge shared
21+
{:project PROJECT
22+
:project-home (str "https://github.com/clojure/" PROJECT "/")
23+
:name PROJECT
24+
:page-title (str PROJECT " API Reference")
25+
:web-home (str "https://clojure.github.io/" PROJECT "/")
26+
:web-src-dir (str "https://github.com/clojure/" PROJECT "/blob/")
27+
:root (str (.getAbsolutePath (File. "repo")) "/")
28+
:output-path (str (.getAbsolutePath (File. "repo-docs")) "/")
29+
:branches [{:name "master" :version VERSION :status "in development"}]}
30+
(get custom PROJECT)))
1831

19-
(let [branch-info {:name "master" :version "0.6.6" :status "stable" :first? true}
32+
(let [branch-info {:name "master" :version VERSION :status "in development" :first? true}
2033
all-branch-info (:branches shared)]
2134
(h/make-all-pages branch-info all-branch-info (edn-read "analysis.edn")))
2235

build.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
# TODO - remove
6-
PROJECT=core.cache
6+
PROJECT=spec.alpha
77

88
# Create or refresh repo
99
if [[ ! -d repo ]]; then
@@ -13,6 +13,8 @@ else
1313
echo "Refreshing repo area"
1414
(cd repo && git fetch && git reset --hard)
1515
fi
16+
version="$(cd repo && mvn -q -N org.codehaus.mojo:exec-maven-plugin:1.3.1:exec -Dexec.executable='echo' -Dexec.args='${project.version}' | tail -1)"
17+
echo "version=$version"
1618

1719
# Create or clean output directory
1820
if [[ ! -d repo-docs ]]; then
@@ -32,11 +34,12 @@ cp -R site/* repo-docs
3234
# Run autodoc-collect
3335
echo "Analyzing $PROJECT"
3436
rm -f analysis.edn
35-
cat collect.clj | clojure -C:collect -
37+
echo "(def PROJECT \"$PROJECT\") (def VERSION \"$version\")" > proj.clj
38+
cat proj.clj collect.clj | clojure -C:collect -
3639

3740
# Run autodoc
3841
echo "Building $PROJECT"
39-
cat build.clj | clojure -R:build -
42+
cat proj.clj build.clj | clojure -R:build -
4043

4144
# Commit
4245
if [[ ! -z "$COMMIT" ]]; then

collect.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"src/main/clojure"
88

99
;; Analyze these namespaces
10-
"clojure.core.cache"
10+
(str "clojure." PROJECT)
1111

1212
;; Skip loading these namespaces
1313
""

deps.edn

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
:paths []
33

44
:deps {
5-
org.clojure/core.cache {:mvn/version nil}
65
autodoc/autodoc {:mvn/version "1.1.2"}
76
}
87

params.clj

-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
{ ;; Build parameters shared across all branches
2-
:project "core.cache"
3-
:project-home "https://github.com/clojure/core.cache/"
4-
:name "core.cache"
5-
:description "A caching library implementing various cache strategies"
6-
:page-title "core.cache API Reference"
72
:copyright "Copyright 2007-2017 by Rich Hickey and the various contributors"
83
:source-path ["src/main/clojure"]
9-
;; :param-dir "."
10-
;; :template-dir "templates"
11-
:web-home "https://clojure.github.io/core.cache/"
12-
:web-src-dir "https://github.com/clojure/core.cache/blob/"
134
:external-doc-tmpdir "tmp"
145
:file-prefix ""
156
:build-json-index false
167
:build-raw-index false
178
:scm-tool "git"
18-
:branches [{:name "master" :version :from-pom :status "stable"}]
199
}

0 commit comments

Comments
 (0)