From b4a4db4dcfce1e4d4bdc637c5221ba9a58ba9642 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Wed, 11 Sep 2019 16:38:59 -0400 Subject: [PATCH] Add flag to skip phpdoc during build. - Serves as workaround for broken documentation build caused by PHPDocumentor bugs. --- build.xml | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/build.xml b/build.xml index 12b877e6890..e25aabfa474 100644 --- a/build.xml +++ b/build.xml @@ -27,6 +27,7 @@ <property name="snooze_multiplier" value="1" /><!-- can be used to slow down tests (selenium only) --> <property name="solr_startup_sleep" value="0" /> <property name="solr_version" value="7.3.1" /> + <property name="skip_phpdoc" value="false" /> <property name="phpdoc_version" value="2.9.0" /> <property name="version" value="6.0" /> @@ -139,30 +140,36 @@ <!-- PHP API Documentation --> <target name="phpdoc"> - <!-- GET phpDocumentor.phar --> + <!-- Skip the whole phpdoc task when disabled --> <if> - <not><available file="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" /></not> + <not><istrue value="${skip_phpdoc}" /></not> <then> - <httpget followRedirects="true" url="https://github.com/phpDocumentor/phpDocumentor2/releases/download/v${phpdoc_version}/phpDocumentor.phar" dir="${srcdir}/vendor/bin" filename="phpDocumentor-${phpdoc_version}.phar" /> - <chmod mode="0755"> - <fileset dir="${srcdir}/vendor/bin"> - <include name="phpDocumentor-${phpdoc_version}.phar" /> + <!-- GET phpDocumentor.phar --> + <if> + <not><available file="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" /></not> + <then> + <httpget followRedirects="true" url="https://github.com/phpDocumentor/phpDocumentor2/releases/download/v${phpdoc_version}/phpDocumentor.phar" dir="${srcdir}/vendor/bin" filename="phpDocumentor-${phpdoc_version}.phar" /> + <chmod mode="0755"> + <fileset dir="${srcdir}/vendor/bin"> + <include name="phpDocumentor-${phpdoc_version}.phar" /> + </fileset> + </chmod> + </then> + </if> + <!-- Run phpdoc --> + <mkdir dir="${builddir}/apidocs" /> + <!-- Old embedded version; no longer works correctly... + <phpdoc2 title="VuFind API Documentation" + pharlocation="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" + destdir="${builddir}/apidocs"> + <fileset dir="."> + <include name="module/*/src/**/*.php" /> </fileset> - </chmod> + </phpdoc2> + --> + <exec command="php ${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar --title="VuFind API Documentation" -t ${builddir}/apidocs -d ${srcdir}/module" passthru="true" /> </then> </if> - <!-- Run phpdoc --> - <mkdir dir="${builddir}/apidocs" /> - <!-- Old embedded version; no longer works correctly... - <phpdoc2 title="VuFind API Documentation" - pharlocation="${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar" - destdir="${builddir}/apidocs"> - <fileset dir="."> - <include name="module/*/src/**/*.php" /> - </fileset> - </phpdoc2> - --> - <exec command="php ${srcdir}/vendor/bin/phpDocumentor-${phpdoc_version}.phar --title="VuFind API Documentation" -t ${builddir}/apidocs -d ${srcdir}/module" passthru="true" /> </target> <!-- PHPUnit --> -- GitLab