php - 警告 : PHPLoc enrichment not enabled or phploc. 在 phpDox 中未找到 xml

标签 php jenkins ant build.xml phploc

我在项目构建时使用 Jenkins 和 Ant 为我的 PHP 项目生成 API 文档:

<?xml version="1.0" encoding="UTF-8"?>
<project name="MyProject" default="full-build">
    <property name="pdepend" value="/usr/share/.composer/vendor/bin/pdepend" />
    ...
    <target name="full-build" depends="prepare,static-analysis,phpdox" />
    <target name="prepare" unless="prepare.done" depends="clean">
        <mkdir dir="${basedir}/build/api" />
        ...
    </target>
    <target name="clean" unless="clean.done">
        <delete dir="${basedir}/build/api" />
        ...
    </target>
    <target name="static-analysis">
        <parallel threadCount="2">
            <sequential>
                <antcall target="pdepend" />
                <antcall target="phpmd" />
            </sequential>
            <antcall target="lint" />
            <antcall target="phpcpd" />
            <antcall target="phpcs" />
            <antcall target="phploc" />
        </parallel>
    </target>
    <target name="pdepend" unless="pdepend.done" depends="prepare">
        ...
    </target>
    <target name="phpmd" unless="phpmd.done">
        ...
    </target>
    <target name="lint" unless="lint.done">
        ...
    </target>
    <target name="phpcpd" unless="phpcpd.done">
        ...
    </target>
    <target name="phpcs" unless="phpcs.done">
        ...
    </target>
    <target name="phpdox" depends="phploc,phpcs,phpmd" unless="phpdox.done">
        <exec executable="${phpdox}" dir="${basedir}/build" taskname="phpdox">
            <arg value="--file" />
            <arg value="${basedir}/build/phpdox.xml" />
        </exec>
        <property name="phpdox.done" value="true" />
    </target>
    <target name="phploc" unless="phploc.done">
        ...
    </target>
</project>

当构建完成并打开 API 文档的 index.xhtml 时,会显示一条警告:

Warning: PHPLoc enrichment not enabled or phploc.xml not found.

enter image description here

为什么显示此警告以及如何解决由此引起的问题?

最佳答案

phpDox 需要 phploc.xml要生成的文件。您的目标是phploc生成这样的文件(参数: --log-xml <filename> )?

目标示例 phploc :

<target name="phploc" unless="phploc.done">
    <exec executable="${phploc}" taskname="phploc">
        <arg value="--count-tests" />
        <arg value="--log-csv" />
        <arg path="${basedir}/build/logs/phploc.csv" />
        <arg value="--log-xml" />
        <arg path="${basedir}/build/logs/phploc.xml" />
        <arg path="....." />
    </exec>
    <property name="phploc.done" value="true"/>
</target>

如果尚未找到或启动 PHPLOC 丰富器,则应从 phpDox Ant 构建脚本反馈中省略以下行:

[phpdox] [06.07.2016 - 16:37:58] Registered enricher 'phploc'

关于php - 警告 : PHPLoc enrichment not enabled or phploc. 在 phpDox 中未找到 xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38081749/

相关文章:

javascript - 无法在 PHP 和 Javascript 中更改字体颜色 onClick

php - 如何使带有固定标题和来自mysql的表内容的表可滚动

php - 检查数据库中是否已存在变量数据

nginx - 带有 Nginx 反向代理和解析器的 Jenkins

java - 如何在构建时将从源代码文件名或内容派生的数据添加到资源

php - 提取不包括的跨表重复项。表重复项

svn - Jenkins SVN 使用 https 协议(protocol)

在本地 Jenkins 多分支管道中找不到 Docker 命令

java - 为什么从 axis2 生成的包会包含额外的 "src"?

java - 项目间依赖关系的方法