Php Phing只执行默认目标
我对Phing有意见。他只做默认的工作。有没有人遇到过这样的行为?该环境在Windows 10上工作。 谢谢你的帮助Php Phing只执行默认目标,php,jenkins,phing,Php,Jenkins,Phing,我对Phing有意见。他只做默认的工作。有没有人遇到过这样的行为?该环境在Windows 10上工作。 谢谢你的帮助 <?xml version="1.0" encoding="UTF-8"?> <project name="Test" default="start"> <!-- ============================================ --> <!-- Target: start
<?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>
您需要以另一种方式设置依赖项。目标“开始”不会用当前代码触发任何其他目标 试试这个:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="build">
<!-- ============================================ -->
<!-- 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>
执行顺序为:start->prepareDirectory->build
希望能成功 它起作用了。谢谢你的帮助。我已经理解了默认目标的工作原理。对此我很抱歉。我是“StackOverflow”的新手。我还不知道所有的机制。