题
我使用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大师那里能借我个忙?
解决方案
我怀疑,问题是你的路径/文件集的配置。这是我们用它来包装web2project使用Phing。的“包装”目录是当前工作目录内。
<zip destfile="web2project-${releaseName}.zip">
<fileset dir="packaging/">
<include name="**/**" />
</fileset>
</zip>
不隶属于 StackOverflow