Build system: Use dynamic phpDoc title

This commit is contained in:
Daniel Rudolf 2016-04-24 21:13:47 +02:00
parent 6c4f69c107
commit e01044319a
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538
4 changed files with 13 additions and 3 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<title><![CDATA[Pico 1.0 API Documentation]]></title>
<title><![CDATA[Pico API Documentation]]></title>
<parser>
<target>_build/phpdoc.cache</target>
</parser>

View file

@ -18,6 +18,10 @@ fi
DEPLOYMENT_ID="${TRAVIS_BRANCH//\//_}"
DEPLOYMENT_DIR="$TRAVIS_BUILD_DIR/_build/deploy-$DEPLOYMENT_ID.git"
# get current Pico milestone
VERSION="$(php -r 'require_once(__DIR__ . "/lib/Pico.php"); echo Pico::VERSION;')"
MILESTONE="Pico$([[ "$VERSION" =~ ^([0-9]+\.[0-9]+)\. ]] && echo " ${BASH_REMATCH[1]}")"
# clone repo
echo "Cloning repo..."
git clone --branch="gh-pages" "https://github.com/$TRAVIS_REPO_SLUG.git" "$DEPLOYMENT_DIR"
@ -33,7 +37,7 @@ github-setup.sh
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR/.phpdoc.xml" \
"$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache" "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID" \
"Pico 1.0 API Documentation ($TRAVIS_BRANCH branch)"
"$MILESTONE API Documentation ($TRAVIS_BRANCH branch)"
[ $? -eq 0 ] || exit 1
[ -n "$(git status --porcelain "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID.cache")" ] || exit 0

View file

@ -29,10 +29,14 @@ github-setup.sh
# generate phpDocs
if [ "$DEPLOY_PHPDOC_RELEASES" == "true" ]; then
# get current Pico milestone
MILESTONE="Pico$([[ "$TRAVIS_TAG" =~ ^v([0-9]+\.[0-9]+)\. ]] && echo " ${BASH_REMATCH[1]}")"
# generate phpDocs
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR/.phpdoc.xml" \
"-" "$DEPLOYMENT_DIR/phpDoc/$DEPLOYMENT_ID" \
"Pico 1.0 API Documentation ($TRAVIS_TAG)"
"$MILESTONE API Documentation ($TRAVIS_TAG)"
[ $? -eq 0 ] || exit 1
# commit phpDocs

View file

@ -4,6 +4,7 @@
* Pico
*
* Pico is a stupidly simple, blazing fast, flat file CMS.
*
* - Stupidly Simple: Pico makes creating and maintaining a
* website as simple as editing text files.
* - Blazing Fast: Pico is seriously lightweight and doesn't
@ -16,6 +17,7 @@
* for powerful and flexible themes.
* - Open Source: Pico is completely free and open source,
* released under the MIT license.
*
* See <http://picocms.org/> for more info.
*
* @author Gilbert Pellegrom