ANT实例脚本

<project name="bw_distribution_xh" default="bw.distribution.xh.update.hotfix" basedir=".">

    <dirname property="bw.bw_distribution_xh.dir" file="${ant.file.bw_distribution_xh}"/>
    <property file="${bw.bw_distribution_xh.dir}/build.properties"/>
    <import file="${bw.bw_distribution_xh.dir}/distribution.xml"/>
   
    <!--mkdir-->
    <target name="bw.mkdir" description="Initialization">
       <mkdir dir="${hotfix_dest}\bw" />
    </target>
   
    <target name="admin.mkdir" description="Initialization">
       <mkdir dir="${hotfix_dest}\admin" />
    </target>
   
    <!--unzip-->
    <target name="bw.TIB.bw.distribution.unzip">
        <unzip src="${hotfix_name}" dest="${hotfix_dest}\bw" />
    </target>
   
     <target name="admin.TIB.admin.distribution.unzip">
        <unzip src="${hotfix_name_admin}" dest="${hotfix_dest}\admin" />
    </target>
   
    <target name="bw.hotfix.unzip">
       <unzip src="${bw_hotfix}" dest="${bw_hotfix_dest}" />
       <echo>${bw_hotfix}</echo>
      <delete file="${bw_hotfix}"/>
    </target>
   
    <target name="bw.distribution.get.xh.name">
     <substring text="${bw.installer.name}" start="4"  property="subtext" />
        <property name="bw.distribution.xh.name"
                  value="${dest}/${prefix}_bw_${bw.installer.version}.${bw.hotfix.version}_${bw.installer.platform}_distribution_gridlib"/>
    </target>

    <target name="bw.distribution.xh.update.hotfix" depends="bw.mkdir, admin.mkdir, bw.TIB.bw.distribution.unzip, admin.TIB.admin.distribution.unzip, bw.hotfix.unzip, bw.distribution.get.name, bw.distribution.get.xh.name">
      <echo>${bw.distribution.name}</echo>
      <property name="bw.xh.work.dir" value="${bw.distribution.xh.name}"/>
      <mkdir dir="${bw.xh.work.dir}"/>
      <echo>${bw.xh.work.dir}</echo>
      <unzip src="${bw.distribution.name}" dest="${bw.xh.work.dir}"/>
      <!--unzip src="${hotfix.name}"        dest="${bw.xh.work.dir}"/-->
      <replaceregexp match="&lt;grid-library-version&gt;.*&lt;/grid-library-version&gt;"
                        replace="&lt;grid-library-version&gt;${bw.installer.version}.${bw.hotfix.version}&lt;/grid-library-version&gt;" byline="true">
              <fileset file="${bw.xh.work.dir}/grid-library.xml"/>
      </replaceregexp>
     
       <copy todir="${bw.xh.work.dir}/bw/5.9/hotfix">
      <fileset dir="${bw_copy_Original_hotfix}" />
     </copy>
     
      <copy todir="${admin_copy_New_hotfix}"  file="${admin_copy_Original_hotfix}" >
     </copy>

      <zip destfile="${bw.distribution.xh.name}.zip">
            <zipfileset dir="${bw.xh.work.dir}"/>
      </zip>
      <delete dir="${bw.xh.work.dir}"/>
    </target>

</project>

 

http://www.ibm.com/developerworks/cn/java/j-lo-ant-eclipse/    经典的文章!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值