Advertisement
Guest User

TK

a guest
Apr 21st, 2010
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.26 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <project name="beetlemed" basedir="." default="help">
  3.    
  4.     <property file="build.properties"/>
  5.    
  6.     <target name="help">
  7.         <echo>Beetle Med - Please run one of the following commands.</echo>
  8.         <echo>To compile and deploy the web-app, run: </echo>
  9.         <echo>  ant deploy.webapp</echo>
  10.         <echo>To compile and deploy the flex application, run: </echo>
  11.         <echo>  ant compile.flex.main compile.flex.modules deploy.webapp</echo>
  12.         <echo>To compile and run web-app tests, run:</echo>
  13.         <echo>  ant run.webapp.tests</echo>
  14.         <echo>To compile and run flex tests, run:</echo>
  15.         <echo>  ant compile.flex.tests run.flex.tests</echo>
  16.         <echo>To run a clean build of the flex application, run:</echo>
  17.         <echo>  ant clean.flex compile.flex.main compile.flex.modules</echo>
  18.     </target>
  19.    
  20.     <!-- GLOBAL -->
  21.    
  22.     <target name="clean.all">
  23.         <delete dir="${bin.dir}" includes="**/*"
  24.             includeemptydirs="true"/>
  25.     </target>
  26.    
  27.     <target name="clean.java">
  28.         <delete dir="${main.java.bin.dir}" includes="**/*"
  29.             includeemptydirs="true"/>
  30.     </target>
  31.    
  32.     <target name="clean.flex">
  33.         <delete dir="${main.flex.bin.dir}" includes="**/*"
  34.             includeemptydirs="true"/>
  35.     </target>
  36.    
  37.     <target name="clean.tests">
  38.         <delete dir="${test.java.bin.dir}"/>
  39.         <delete dir="${test.java.report.dir}"/>
  40.         <delete dir="${test.java.output.dir}"/>
  41.         <delete dir="${test.flex.report.dir}"/>
  42.         <delete dir="${test.flex.output.dir}"/>
  43.     </target>
  44.    
  45.     <target name="clean.deploy">
  46.         <delete dir="${webapp.build.dir}"/>
  47.     </target>
  48.    
  49.     <target name="prepare">
  50.         <taskdef resource="flexTasks.tasks"
  51.             classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
  52.        
  53.         <mkdir dir="${main.java.bin.dir}"/>
  54.         <mkdir dir="${main.flex.bin.dir}"/>
  55.         <mkdir dir="${main.flex.modules.bin.dir}"/>
  56.         <mkdir dir="${test.java.bin.dir}"/>
  57.         <mkdir dir="${test.flex.bin.dir}"/>
  58.         <mkdir dir="${test.java.output.dir}"/>
  59.         <mkdir dir="${test.java.report.dir}"/>
  60.         <mkdir dir="${test.flex.output.dir}"/>
  61.         <mkdir dir="${test.flex.report.dir}"/>
  62.     </target>
  63.    
  64.     <!-- WEBAPP -->
  65.    
  66.     <target name="compile.webapp" depends="prepare">       
  67.         <javac srcdir="${main.java.src.dir}"
  68.                 destdir="${main.java.bin.dir}"
  69.                 optimize="${java.compiler.optimize}"
  70.                 fork="${java.compiler.fork}"
  71.                 memorymaximumsize="${java.compiler.maxmemory}">
  72.             <classpath>
  73.                 <filelist>
  74.                     <file name="${red5.home}/red5.jar"/>
  75.                     <file name="${red5.home}/boot.jar"/>
  76.                 </filelist>
  77.                 <fileset dir="${red5.lib.dir}" includes="**/*"/>
  78.                 <fileset dir="${main.java.lib.dir}" includes="**/*"/>
  79.             </classpath>
  80.         </javac>
  81.        
  82.         <copy todir="${main.java.bin.dir}">
  83.             <fileset dir="${main.java.src.dir}"
  84.                 excludes="**/*.java"/>
  85.         </copy>
  86.        
  87.         <jar destfile="${main.java.jar.file}">
  88.             <fileset dir="${main.java.bin.dir}"/>
  89.         </jar>
  90.     </target>
  91.    
  92.     <target name="deploy.webapp" depends="compile.webapp">
  93.         <mkdir dir="${webapp.build.dir}/${ant.project.name}/WEB-INF/lib"/>
  94.         <copy todir="${webapp.build.dir}/${ant.project.name}/WEB-INF/lib"
  95.             file="${main.java.jar.file}"/>
  96.         <copy todir="${webapp.build.dir}/${ant.project.name}/WEB-INF/lib">
  97.             <fileset dir="${main.java.lib.dir}" includes="**/*"/>
  98.         </copy>
  99.         <copy todir="${webapp.build.dir}/${ant.project.name}">
  100.             <fileset dir="${web.dir}" includes="**/*"/>
  101.         </copy>
  102.         <copy todir="${webapp.build.dir}/${ant.project.name}">
  103.             <fileset dir="${main.flex.bin.dir}"
  104.                 includes="**/*.swf"/>
  105.         </copy>
  106.         <copy todir="${red5.webapps.dir}">
  107.             <fileset dir="${webapp.build.dir}"
  108.                 includes="**/*"/>
  109.         </copy>
  110.     </target>
  111.    
  112.     <target name="compile.webapp.tests" depends="compile.webapp">
  113.         <javac srcdir="${test.java.src.dir}"
  114.                 destdir="${test.java.bin.dir}">
  115.             <classpath>
  116.                 <filelist>
  117.                     <file name="${red5.home}/red5.jar"/>
  118.                     <file name="${red5.home}/boot.jar"/>
  119.                     <file name="${bin.dir}/${ant.project.name}.jar"/>
  120.                 </filelist>
  121.                 <fileset dir="${red5.lib.dir}" includes="**/*"/>
  122.                 <fileset dir="${main.java.lib.dir}" includes="**/*"/>
  123.                 <fileset dir="${test.java.lib.dir}" includes="**/*"/>
  124.             </classpath>
  125.         </javac>
  126.     </target>
  127.    
  128.     <target name="run.webapp.tests" depends="compile.webapp.tests">
  129.         <junit printsummary="true">
  130.             <classpath>
  131.                 <filelist>
  132.                     <file name="${red5.home}/red5.jar"/>
  133.                     <file name="${red5.home}/boot.jar"/>
  134.                     <file name="${bin.dir}/${ant.project.name}.jar"/>
  135.                 </filelist>
  136.                 <fileset dir="${red5.lib.dir}" includes="**/*.jar"/>
  137.                 <fileset dir="${main.java.lib.dir}" includes="**/*.jar"/>
  138.                 <fileset dir="${test.java.lib.dir}" includes="**/*.jar"/>
  139.                 <fileset dir="${test.java.bin.dir}" includes="**/*.class"/>
  140.             </classpath>
  141.            
  142.             <formatter type="xml"/>
  143.            
  144.             <batchtest todir="${test.java.output.dir}">
  145.                 <fileset dir="${test.java.bin.dir}" includes="**/*TestCase*"/>
  146.             </batchtest>
  147.         </junit>
  148.        
  149.         <junitreport>
  150.             <fileset dir="${test.java.output.dir}" includes="**/*"/>
  151.             <report todir="${test.java.report.dir}"/>
  152.         </junitreport>
  153.     </target>
  154.    
  155.     <!-- FLEX -->
  156.    
  157.     <macrodef name="compile-application">
  158.         <attribute name="target"/>
  159.         <attribute name="destfile"/>
  160.         <sequential>
  161.             <mxmlc file="@target@"/>
  162.         </sequential>
  163.     </macrodef>
  164.    
  165.     <target name="compile.flex.main" depends="prepare">
  166.        
  167.     </target>
  168.    
  169.     <target name="compile.flex.modules" depends="prepare">
  170.    
  171.     </target>
  172. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement