ANT

<project name="smt-web" default="entry" basedir=".">
 <description>
     -- Project profile
     Project/Module
        - smartplatform web platform build file
     Version
     - 1.0.0  XXXX XXXX
     Author
     - XXX, XXX-XXX contacts XXXXX@XXXXXXXXXX.com
     
     -- Building profile
     refers Project smt web platform building information.
     
     Author
     - XXXXX
     Version
     - 1.0 XXXXX XXXX
  Directory structure check list related Building
  - ./build
    This directory contains all compiled .class
    file and some resource files
    need to locate into %CLASSPATH% varible
  - ./dist
    This directory contains the need-generated
    archived file of
    the project you builds. officelly is those
    .jar file.
    In this web project, a web distribution file .war
    file would be generated.
    Some others property generated archived file is:
    .ear files
  - ./dist/archive
    See property ${archive}
  - ./test
    This directory contains all test code. All test
    source code locates under
    directory ${test}/function, ${test}/performance, ...
    Besides, the related resource for run all test
    code were under directory
    ${test}/resources
  - ./WebContent
    ./WebContent/WEB-INF/lib
    This checked item you should be unknown.
 </description>
 <!-- set global properties for this build -->
 <property name="project" value="smartplatform-web"/>
 <property name="version" value="1.0.1"/>
 <property name="webapp" location="${project}-${version}"/>
 
 <!--<propertyset id="sourceset">-->
  <property name="src" location="src"/>
  <property name="test" location="test"/>
  <property name="source" location="source"/>
 <!--</propertyset>-->
 <property name="web.dir" location="WebContent"/>
 <property name="lib" location="${web.dir}/WEB-INF/lib"/>
 
 <property name="build.dir" value="build"/>

 <!--<propertyset>-->
  <property name="build.main" location="${build.dir}/main"/>
  <property name="build.test" location="${build.dir}/test"/>
  <!--<propertyset></propertyset>-->
 <!--</propertyset>-->
 
 <property name="dist"  location="dist"/>
 <property name="archive" location="${dist}/${version}"/>

 <path id="project.class.path">
  <fileset dir="${web.dir}/WEB-INF/lib">
   <include name="*.jar"/>
  </fileset>
  <pathelement path="${build.main}"/>
 </path>

 <target name="init">
  <echo>Step 1: init...</echo>
  <!-- Create the time stamp -->
  <tstamp/>
  
  <delete dir="${build.dir}"></delete>
  
  <delete dir="${webapp}"></delete>
  <delete dir="${archive}"></delete>
  <!--<delete dir="${dist}"></delete>-->
  <!-- Create the build directory structure used by compile -->
  
  <mkdir dir="${build.main}"/>
  <mkdir dir="${build.test}"/>
  
  <mkdir dir="${webapp}"/>
  <mkdir dir="${dist}"/>
  <mkdir dir="${archive}"/>
  
   </target>

 <target name="compile" depends="init" description="compile the source " >
  <echo>Step 2: compiling...</echo>
  <!-- Compile the java code from ${src} into ${build} -->
  <javac srcdir="${src}" destdir="${build.main}">
   <classpath refid="project.class.path"></classpath>
  </javac>
  <javac srcdir="${test}" destdir="${build.test}">
   <classpath refid="project.class.path"></classpath>
  </javac>
 </target>

 <target name="distribution" depends="compile"
  description="generate the distribution" >
  <echo>Step 3: distributing...</echo>
  <!--
    Building distribution files, including .jar distribution files and
    web .war distribution files. Belows is a check list files of related
    distribution files:
   
    : smartplatform-web-1.0.0.jar
    : smartplatform-web-test-1.0.0.jar
   
    : smartplatform-web-1.0.0.war
    -->
  <!-- Create the distribution directory -->
  <mkdir dir="${archive}/lib"/>
     <!-- Put everything in ${build} into the smt-web-1.0.0.jar file -->
     <jar jarfile="${archive}/lib/${project}-${version}.jar" basedir="${build.main}"/>
  <jar jarfile="${archive}/lib/${project}-test-${version}.jar" basedir="${build.test}"/>
  
  <copy todir="${webapp}/WEB-INF/lib" file="${archive}/lib/${project}-${version}.jar" overwrite="true"/>
  <copy todir="${webapp}" overwrite="true">
   <fileset dir="${web.dir}">
    <!--
    <exclude name="**/*.java"/>
    -->
   </fileset>
  </copy>
  <jar jarfile="${archive}/${project}-${version}.war" basedir="${webapp}"/>
   </target>

 <target name="entry" depends="distribution, clean">
  <echo>Starting...</echo>
  <echo>Building actions started up!</echo>
  <echo> </echo>
  <echo>Target navigation:</echo>
  <echo> </echo>
  <echo>Step 0: entry...</echo>
  <echo>Step 1: init...</echo>
  <echo>Step 2: compiling...</echo>
  <echo>Step 3: distributing...</echo>
  <echo>Step 4: clean...</echo>
  <echo> </echo>
  <echo>Ended!</echo>
 </target>
 
 <target name="clean" description="clean up">
  <echo>Step 4: clean...</echo>
     <!-- Delete the ${build} and ${dist} directory trees -->
     <delete dir="${build.dir}"/>
     <delete dir="${webapp}"/>
 </target>
</project>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值