代码之家  ›  专栏  ›  技术社区  ›  Mike Purcell

CruiseControl-PHP lint检查通过ANT工作,但不通过CruiseControl

  •  6
  • Mike Purcell  · 技术社区  · 12 年前

    因此,我正在编写一个ant构建文件,该文件将在cruisecontrol中使用,但遇到了一个奇怪的问题。我已经在谷歌上搜索了这个问题,但还没有找到任何具体的解决方案,所以我想我会把这个问题发布在这里。

    我有以下蚂蚁任务:

    <target name="module.lint">
        <apply executable="/usr/bin/php" failonerror="true">
            <arg value="-l" />
            <fileset dir="/path/to/my/elite/code" includes="**/*.php" />
        </apply>
    </target>
    

    当我运行它时,使用:

    ant -buildfile /path/to/my/elite/buildfiles/project/elite/build.xml module.lint
    

    它运行良好,但当我试图通过CruiseControl GUI构建项目时,我会遇到以下错误:

    [cc]Aug-09 15:51:04 ScriptRunner  - fileset: Setup scanner in dir /path/to/my/elite/code with patternSet{ includes: [**/*.php] excludes: [] }
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] Executing '/usr/bin/php' with arguments:
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] '-l'
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] '/path/to/my/elite/code/Script.php'
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply]
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] The ' characters around the executable and arguments are
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] not part of the command.
    [cc]Aug-09 15:51:04 ScriptRunner  - Execute:Java13CommandLauncher: Executing '/usr/bin/php' with arguments:
    [cc]Aug-09 15:51:04 ScriptRunner  - '-l'
    [cc]Aug-09 15:51:04 ScriptRunner  - '/path/to/my/elite/code/Script.php'
    [cc]Aug-09 15:51:04 ScriptRunner  -
    [cc]Aug-09 15:51:04 ScriptRunner  - The ' characters around the executable and arguments are
    [cc]Aug-09 15:51:04 ScriptRunner  - not part of the command.
    [cc]Aug-09 15:51:04 ScriptRunner  -     [apply] No syntax errors detected in /path/to/my/elite/code/Script.php
    

    不确定为什么我会得到“字符…不是命令的一部分”错误,尽管看起来确实执行了lint检查。

    我需要做些什么来修复“字符…不是命令的一部分”错误?

    1 回复  |  直到 12 年前
        1
  •  2
  •   martin clayton egrunin    12 年前

    这些消息表明,当从CruiseControl运行构建时,Ant正以详细或调试模式运行。(尝试使用 -v 选择自己看。)

    检查您的CC配置以获取构建-查看是否 usedebug 或类似的设置。或者,可以使用某种在调试级别进行日志记录的自定义日志记录。