Refactor phpDoc generation

This commit is contained in:
Daniel Rudolf 2015-11-30 00:52:19 +01:00
parent ff02f34e23
commit 4be51a7bee
5 changed files with 42 additions and 28 deletions

10
.gitignore vendored
View file

@ -10,15 +10,17 @@ desktop.ini
.DS_Store
._*
# Travis
/_build/phpdoc-*/
/_build/phpdoc-*.git/
# Composer
/composer.lock
/composer.phar
/vendor
# phpDocumentor
/_build/phpdoc/
/_build/phpdoc.cache/
/_build/phpdoc-*/
/_build/phpdoc-*.git/
# User config
/config/config.php

View file

@ -1,25 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<title><![CDATA[Pico 1.0 API Documentation]]></title>
<parser>
<target>_build/phpdoc.cache</target>
</parser>
<transformer>
<target>_build/phpdoc</target>
</transformer>
<transformations>
<template name="clean"/>
</transformations>
<files>
<directory>lib/*</directory>
<file>plugins/DummyPlugin.php</file>
<directory>.</directory>
<file>index.php</file>
<file>index.php.dist</file>
<!-- exclude build environment -->
<ignore>_build/*</ignore>
<!-- exclude user config -->
<ignore>config/*</ignore>
<ignore>content-sample/*</ignore>
<ignore>themes/*</ignore>
<file>config/config.php.template</file>
<!-- exclude all plugins -->
<ignore>plugins/*</ignore>
<file>plugins/DummyPlugin.php</file>
<!-- exclude vendor dir -->
<ignore>vendor/*</ignore>
<ignore>.htaccess</ignore>
<ignore>*.git</ignore>
<ignore>.gitignore</ignore>
<ignore>*.xml</ignore>
<ignore>*.yml</ignore>
<ignore>*.json</ignore>
<ignore>*.lock</ignore>
<ignore>*.phar</ignore>
<ignore>*.md</ignore>
<ignore>*LICENSE</ignore>
<ignore>index.php</file>
<ignore>index.php.dist</ignore>
</files>
</phpdoc>

View file

@ -18,7 +18,9 @@ fi
PHPDOC_ID="${TRAVIS_BRANCH//\//_}"
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_BUILD_DIR/.phpdoc.xml" \
"$TRAVIS_BUILD_DIR/_build/phpdoc.cache" \
"$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \
"Pico 1.0 API Documentation ($TRAVIS_BRANCH branch)"
[ $? -eq 0 ] || exit 1

View file

@ -5,7 +5,9 @@
PHPDOC_ID="${TRAVIS_BRANCH//\//_}"
generate-phpdoc.sh \
"$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \
"$TRAVIS_BUILD_DIR/.phpdoc.xml" \
"$TRAVIS_BUILD_DIR/_build/phpdoc.cache" \
"$TRAVIS_BUILD_DIR/_build/phpdoc-$PHPDOC_ID" \
"Pico 1.0 API Documentation ($TRAVIS_TAG)"
[ $? -eq 0 ] || exit 1

View file

@ -2,9 +2,10 @@
set -e
# parameters
PHPDOC_SOURCE_DIR="$1"
PHPDOC_TARGET_DIR="$2"
PHPDOC_TITLE="$3"
PHPDOC_CONFIG="$1"
PHPDOC_CACHE_DIR="$3"
PHPDOC_TARGET_DIR="$4"
PHPDOC_TITLE="$5"
# print parameters
echo "Generating phpDocs..."
@ -14,9 +15,9 @@ printf 'PHPDOC_TITLE="%s"\n' "$PHPDOC_TITLE"
echo
# generate phpdoc
phpdoc -d "$PHPDOC_SOURCE_DIR" \
-c "$PHPDOC_SOURCE_DIR/.phpdoc.xml" \
-t "$PHPDOC_TARGET_DIR" \
phpdoc --config "$PHPDOC_CONFIG" \
--cache-folder "$PHPDOC_CACHE_DIR" \
--target "$PHPDOC_TARGET_DIR" \
--title "$PHPDOC_TITLE"
echo