如何判断Phing中的任务是主任务还是子主/依赖

时间:2013-03-21 18:06:39

标签: phing

我的想法是让我的Phing脚本说话,但我希望他们只有在我运行被叫任务时才能说话。如果是父母来电者,是否有人知道在Phing任务内部告诉谁?

示例build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project name="my_project" default="install">

    <target name="install" depends="configure, migrate">
        <!-- I would like to call this only if `phing install`-->
        <phingcall target="talk" />
    </target>

    <target name="configure">

        <!-- I would like to call this only if `phing configure`-->
        <phingcall target="talk" />
    </target>

    <target name="migrate-database">
        <!-- I would like to call this only if `phing migrate-database`-->
        <phingcall target="talk" />
    </target>

    <target name="talk">
        <property name="message" value="Phing deployment operation done" override="true" />
        <echo msg="${message}" />
        <exec command="say '${message}'" />
    </target>

</project>

0 个答案:

没有答案