巡航控制 - PHP语法检查通过ANT工具可行,但是在巡航控制中却不行。

6

我正在编写一个用于cruisecontrol的ant buildfile,但遇到了一个奇怪的问题。我已经通过Google搜索过这个问题,但并没有找到明确的解决方案,因此我想在这里发布问题。

我有以下的ant任务:

<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

我不确定为什么会出现“characters ... not part of the command”错误,尽管它看起来像是lint检查确实已经执行。

我需要做什么来修复“characters ... not part of the command”错误?

1个回答

2

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

检查您的CC配置文件中的构建 - 查看是否设置了usedebug或类似的参数。或者,可能使用某种自定义日志记录以调试级别记录日志。


我会查一下并回报结果。但是,即使我切换了详细程度,如果构建文件的内容正确,为什么巡航控制还会报告错误呢? - Mike Purcell
我将把这个标记为被接受的答案。我还没有时间检查巡航控制代码是否在“调试”模式下运行,但即使是这样,如果构建文件格式正确,仍然不清楚为什么会抛出错误。 - Mike Purcell
这些不是错误,只是Ant日志在详细模式下应用/执行命令的一部分。 - martin clayton

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接