平头哥 2016-10-14 10:56:11 4082次浏览 0条评论 0 1 0
  1. composer安装 执行composer install
    {
     "require-dev": {
         "phing/phing": "2.*"
      }
    }
    
  2. 案例 创建build.xml 空文件about.php...

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="FooBar" default="dist">
     <!-- ============================================  -->
     <!-- Target: prepare                               -->
     <!-- ============================================  -->
     <target name="prepare">
         <echo msg="Making directory ./build" />
         <mkdir dir="./build" />
     </target>
    
     <!-- ============================================  -->
     <!-- Target: build                                 -->
     <!-- ============================================  -->
     <target name="build" depends="prepare">
         <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>
    
     <!-- ============================================  -->
     <!-- (DEFAULT)  Target: dist                       -->
     <!-- ============================================  -->
     <target name="dist" depends="build">
         <echo msg="Creating archive..." />
    
         <tar destfile="./build/build.tar.gz" compression="gzip">
             <fileset dir="./build">
                 <include name="*" />
             </fileset>
         </tar>
         <echo msg="Files copied and compressed in build directory OK!" />
     </target>
    </project>
    
  3. 执行命令 ./vendor/phing/phing/bin/phing -f build.xml
  4. 默认执行dist,dist继承build,先执行build,以此类推...
  5. 会创建一个build目录,同时把几个文件复制进去了并压缩成一个包
  6. 纯属记笔记,还是看文档
觉得很赞
    没有找到数据。
您需要登录后才可以评论。登录 | 立即注册