]> git.proxmox.com Git - rustc.git/blame - src/liblibc/ci/dox.sh
New upstream version 1.27.1+dfsg1
[rustc.git] / src / liblibc / ci / dox.sh
CommitLineData
92a42be0
SL
1#!/bin/sh
2
3# Builds documentation for all target triples that we have a registered URL for
4# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
5# which has a bunch of `html_root_url` directives we pick up.
6
7set -e
8
9TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
10
11rm -rf target/doc
12mkdir -p target/doc
13
14cp ci/landing-page-head.html target/doc/index.html
15
16for target in $TARGETS; do
17 echo documenting $target
18
83c7162d 19 rustdoc -o target/doc/$target --target $target src/lib.rs --cfg cross_platform_docs \
92a42be0
SL
20 --crate-name libc
21
22 echo "<li><a href="/libc/$target/libc/index.html">$target</a></li>" \
23 >> target/doc/index.html
24done
25
26cat ci/landing-page-footer.html >> target/doc/index.html
27
28# If we're on travis, not a PR, and on the right branch, publish!
29if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
32a655c1 30 pip install ghp_import --install-option="--prefix=$HOME/.local"
92a42be0
SL
31 $HOME/.local/bin/ghp-import -n target/doc
32 git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
33fi