Phing只是默认目标

时间:2017-07-07 13:43:02

标签: php jenkins phing

我有Phing的问题。他只做默认工作。有没有人遇到过这种行为?环境适用于Windows 10。 谢谢你的帮助。

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="start">
    <!-- ============================================  -->
    <!-- Target: start                                 -->
    <!-- ============================================  -->
    <target name="start">
        <echo msg="Start build" />
    </target>
    <!-- ============================================  -->
    <!-- Target: prepareDirectory                      -->
    <!-- ============================================  -->
    <target name="prepareDirectory" depends="start">
        <echo msg="Making directory build ./build" />
        <mkdir dir="./build" />
        <echo msg="Making directory install ./install" />
        <mkdir dir="./install" />       
    </target>       
    <!-- ============================================  -->
    <!-- Target: build                                 -->
    <!-- ============================================  -->
    <target name="build" depends="prepareDirectory">
        <echo msg="Copying files to build directory..." />

        <echo msg="Copying ./about.php to ./build directory..." />
        <copy file="./about.php" tofile="./build/about.php" />

        <echo msg="Copying ./browsers.php to ./build directory..." />
        <copy file="./browsers.php" tofile="./build/browsers.php" />

        <echo msg="Copying ./contact.php to ./build directory..." />
        <copy file="./contact.php" tofile="./build/contact.php" />
    </target>
</project>

1 个答案:

答案 0 :(得分:1)

您需要以相反的方式设置依赖项。你的目标&#34;开始&#34;不会使用您当前的代码触发任何其他目标。

试试这个:

{{1}}

执行顺序为:开始 - &gt; prepareDirectory - &gt;构建

希望有效!