1

我的想法是让我的 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>
4

0 回答 0