我正在使用Phing创建构建文件,但我注意到它似乎无法执行zip任务:
<target name="makeroot">
<echo msg="Making directory Template" />
<mkdir dir="./../Template" />
</target>
<target name="makefolders" depends="makeroot">
<echo msg="Making folders within Template" />
<mkdir dir="./../Template/class" />
<mkdir dir="./../Template/function" />
<mkdir dir="./../Template/include" />
<mkdir dir="./../Template/script" />
<mkdir dir="./../Template/style" />
</target>
<target name="build" depends="makefolders">
<echo msg="Copying files to build directory..." />
<copy file="./class/ErrorHandler.class.php" tofile="./../Template/class/ErrorHandler.class.php" />
<copy file="./function/validate.func.php" tofile="./../Template/function/validate.func.php" />
<copy file="./include/standard_form.inc.php" tofile="./../Template/include/standard_form.inc.php" />
</target>
<target name="dist" depends="build">
<echo msg="Creating archive..." />
<zip destfile="temp.zip" basedir="C:\Program Files\wamp\www\sites\Template">
<include name="*" />
</zip>
<echo msg="Files copied and compressed in build directory OK!" />
</target>
前两个任务按预期执行,但最后一个不执行。那里的任何一位Phing大师能够帮我一把吗?
答案 0 :(得分:0)
我怀疑问题在于您的路径/文件集配置。这是我们使用Phing打包web2project的方法。 “打包”目录位于当前工作目录中。
<zip destfile="web2project-${releaseName}.zip">
<fileset dir="packaging/">
<include name="**/**" />
</fileset>
</zip>