Skip to content

Commit 2803333

Browse files
committedApr 15, 2017
Maintain a docset feed alongside docs generation.
1 parent a323ced commit 2803333

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed
 

‎.jazzy.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ xcodebuild_arguments:
9393
author: ReactiveCocoa
9494
author_url: https://reactivecocoa.io/
9595
github_url: https://github.com/ReactiveCocoa/ReactiveSwift/
96+
dash_url: http://reactivecocoa.io/reactiveswift/docs/ReactiveSwift.xml

‎Logo/Icons/docset-icon.png

1.4 KB
Loading

‎Logo/Icons/docset-icon@2x.png

2.18 KB
Loading

‎script/feed.xml.template

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<entry>
2+
<version>FRAMEWORK_VERSION</version>
3+
<url>http://reactivecocoa.io/reactiveswift/docs/latest/docsets/ReactiveSwift.tgz</url>
4+
</entry>

‎script/gen-docs

+28-8
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,32 @@ git checkout master
4040
# Create a new branch for the release.
4141
git checkout -b ras-${TRAVIS_TAG}
4242

43+
DOC_PATH=./reactiveswift/docs/${TRAVIS_TAG}
44+
4345
# Copy the generated docs.
44-
mkdir -p ./reactiveswift/docs/${TRAVIS_TAG}
45-
cp -r ../docs/. ./reactiveswift/docs/${TRAVIS_TAG}
46-
rm -rf ./reactiveswift/docs/${TRAVIS_TAG}/docsets/
46+
mkdir -p ${DOC_PATH}
47+
cp -r ../docs/. ${DOC_PATH}
48+
49+
# Copy the icons, and archive the docset.
50+
rm ${DOC_PATH}/docsets/ReactiveSwift.tgz
51+
52+
DOCSET_IMG_PATH=${DOC_PATH}/docsets/ReactiveSwift.docset/Contents/Resources/Documents/Logo/PNG
53+
mkdir -p ${DOCSET_IMG_PATH}
54+
cp ../Logo/PNG/logo-Swift.png ${DOCSET_IMG_PATH}/logo-Swift.png
55+
cp ../Logo/PNG/JoinSlack.png ${DOCSET_IMG_PATH}/JoinSlack.png
56+
cp ../Logo/PNG/Docs.png ${DOCSET_IMG_PATH}/Docs.png
57+
cp ../Logo/Icons/docset-icon.png ${DOC_PATH}/docsets/ReactiveSwift.docset/icon.png
58+
cp ../Logo/Icons/docset-icon@2x.png ${DOC_PATH}/docsets/ReactiveSwift.docset/icon@2x.png
59+
tar --exclude='.DS_Store' -cvzf ${DOC_PATH}/docsets/ReactiveSwift.tgz -C ${DOC_PATH}/docsets/ .
60+
rm -rf ${DOC_PATH}/docsets/ReactiveSwift.docset/
4761

4862
# Copy image assets used by README.md.
49-
mkdir -p ./reactiveswift/docs/${TRAVIS_TAG}/Logo/PNG/
50-
cp ../Logo/PNG/logo-Swift.png ./reactiveswift/docs/${TRAVIS_TAG}/Logo/PNG/logo-Swift.png
51-
cp ../Logo/PNG/JoinSlack.png ./reactiveswift/docs/${TRAVIS_TAG}/Logo/PNG/JoinSlack.png
52-
cp ../Logo/PNG/Docs.png ./reactiveswift/docs/${TRAVIS_TAG}/Logo/PNG/Docs.png
63+
mkdir -p ${DOC_PATH}/Logo/PNG/
64+
cp ../Logo/PNG/logo-Swift.png ${DOC_PATH}/Logo/PNG/logo-Swift.png
65+
cp ../Logo/PNG/JoinSlack.png ${DOC_PATH}/Logo/PNG/JoinSlack.png
66+
cp ../Logo/PNG/Docs.png ${DOC_PATH}/Logo/PNG/Docs.png
5367

54-
git add ./reactiveswift/docs/${TRAVIS_TAG}
68+
git add ${DOC_PATH}
5569

5670
# Ensure Jekyll is not running in `docs`.
5771
touch ./reactiveswift/docs/.nojekyll
@@ -61,6 +75,12 @@ git add ./reactiveswift/docs/.nojekyll
6175
ln -sfn ${TRAVIS_TAG}/ reactiveswift/docs/latest
6276
git add ./reactiveswift/docs/latest
6377

78+
# Update the docset feed.
79+
rm ./reactiveswift/docs/ReactiveSwift.xml
80+
cp ../script/feed.xml.template ./reactiveswift/docs/ReactiveSwift.xml
81+
sed -i -- "s/FRAMEWORK_VERSION/${TRAVIS_TAG}/g" ./reactiveswift/docs/ReactiveSwift.xml
82+
git add ./reactiveswift/docs/ReactiveSwift.xml
83+
6484
# Commit and push to the fork.
6585
git commit -m "Documentation: ReactiveSwift ${TRAVIS_TAG}"
6686
git push -u cibot ras-${TRAVIS_TAG}

0 commit comments

Comments
 (0)
Please sign in to comment.