2009-10-15 50 views
0

執行任務拉鍊我使用Phing創建構建文件,但我注意到,它似乎並沒有能夠執行的zip任務:不能在Phing在XP

<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

我懷疑是你的路徑/文件集配置的問題。這就是我們使用Phing打包web2project的原因。 「包裝」目錄位於當前工作目錄中。

<zip destfile="web2project-${releaseName}.zip"> 
    <fileset dir="packaging/"> 
    <include name="**/**" /> 
    </fileset> 
</zip> 
+0

A-HA!謝謝你,現在設法做一個拉鍊。 – sunwukung 2009-10-15 21:08:12