Advertisement
Guest User

Untitled

a guest
Oct 9th, 2012
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 6.06 KB | None | 0 0
  1. <project name="GrahamsProj1.0" basedir="." default="package">
  2.     <description>Grahams Project Build Script</description>
  3.    
  4.     <property name="my_basedir" location="."/>
  5.     <property name="final.build.dir" location="./build"/>
  6.     <property name="final.dist.dir" location="./dist"/>
  7.     <property name="client.basedir" location="./../GrahamsProjClient"/>
  8.     <property name="server.basedir" location="./../GrahamsProjServer"/>
  9.    
  10.     <target name="final.init">
  11.         <mkdir dir="${final.build.dir}"/>
  12.         <mkdir dir="${final.dist.dir}"/>
  13.     </target>
  14.    
  15.     <!-- ============================================= -->
  16.     <!--       Import Server/Client Build Files        -->
  17.     <!-- ============================================= -->
  18.     <import file="${client.basedir}/build-client.xml"/>
  19.     <import file="${server.basedir}/build-server.xml"/>
  20.  
  21.     <!-- ============================================= -->
  22.     <!--            Housekeeping Targets               -->
  23.     <!-- ============================================= -->
  24.     <!-- <target name="-update-build-info" depends="PWClient.-update-client-build-info" /> -->
  25.  
  26.     <!-- <target name="-prepare" depends="-dependencies,PWServer.-prepare,PWClient.-prepare" /> -->
  27.  
  28.    
  29.     <!-- ============================================= -->
  30.     <!--            Create Server Application          -->
  31.     <!-- ============================================= -->
  32.     <property name="my_basedir" location="${server.basedir}"/>
  33.     <target name="prepare_server" depends="server.app_package" description="Creates server and moves it to the correct directory.">
  34.         <copy file="${server.dist}/GrahamsProjServer.ear" todir="${final.build.dir}" />
  35.     </target>
  36.     <property name="my_basedir" location="."/>
  37.     <!-- ============================================= -->
  38.     <!--            Create Client Application          -->
  39.     <!-- ============================================= -->
  40.     <property name="my_basedir" location="${client.basedir}"/>
  41.     <path id="client.lib.class.path">
  42.       <fileset dir="${client.basedir}">
  43.           <include name="/lib/*.jar"/>
  44.           <!-- <exclude name="jboss-servlet-api_3.0_spec-1.0.0.Final.jar" /> -->
  45.       </fileset>
  46.     </path>
  47.    
  48.     <pathconvert property="client.lib.classpath" pathsep=" ">
  49.         <path refid="client.lib.class.path"/>
  50.         <mapper>
  51.                 <chainedmapper>
  52.                         <flattenmapper/>
  53.                         <globmapper from="*.jar" to="lib/*.jar"/>
  54.                 </chainedmapper>
  55.         </mapper>
  56.     </pathconvert>
  57.    
  58.     <path id="client.server.classpath">
  59.       <fileset dir="${final.build.dir}">
  60.           <include name="GrahamsProjServer/GrahamsProjServer.jar"/>
  61.       </fileset>
  62.     </path>
  63.    
  64.     <path id="client.mf.classpath">
  65.         <path refid="${client.lib.classpath}"/>
  66.         <path refid="${client.server.classpath}"/>
  67.     </path>
  68.    
  69.     <target name="prepare_client" depends="prepare_server" description="Creates client and moves it to the correct directory.">
  70.         <jar destfile="${client.app}/GrahamsProjClient.jar" basedir="${client.dist}">
  71.             <fileset dir="${client.basedir}/properties">
  72.                 <include name="*.properties"/>
  73.             </fileset>
  74.             <fileset dir="${client.basedir}">
  75.                 <include name="lib/*.jar"/>
  76.                 <!-- <exclude name="lib/jboss-servlet-api_3.0_spec-1.0.0.Final.jar" />-->
  77.             </fileset>
  78.             <manifest>
  79.                 <attribute name="Class-Path" value="${client.mf.classpath}"/>
  80.                 <attribute name="Main-Class" value="grahamsprojclient.main.Start"/>
  81.             </manifest>
  82.         </jar>
  83.        
  84.         <javac srcdir="${client.basedir}/src/grahamsprojclient/servlet"
  85.                destdir="${client.basedir}/WEB-INF/classes/grahamsprojclient/servlet" >
  86.             <classpath>
  87.                 <path refid="war.class.path"/>
  88.             </classpath>
  89.         </javac>
  90.        
  91.         <war destfile="${final.build.dir}/GrahamsProjClient.war" webxml="${client.basedir}/WEB-INF/web.xml">
  92.             <metainf dir="${client.basedir}/META-INF" includes="context.xml" />
  93.             <lib dir="${client.basedir}/WEB-INF/lib">
  94.                 <exclude name="/CopyLibs"/>
  95.                 <exclude name="*.ex" />
  96.             </lib>
  97.             <classes dir="${client.basedir}/WEB-INF/classes/grahamsprojclient/servlet" >
  98.                 <exclude name="*.java" />
  99.             </classes>
  100.             <fileset dir="${clientbasedir}" >
  101.                 <include name="GrahamsProjClient-webstart.jnlp"/>
  102.                 <include name="app/GrahamsProjClient.jar"/>
  103.                 <include name="GrahamsProjStartAppPage.html"/>
  104.                 <!-- <include name="lib/*.jar"/>
  105.                <include name="lib/jboss-servlet-api_3.0_spec-1.0.0.Final.jar"/> -->
  106.             </fileset>
  107.       </war>
  108.     </target>
  109.     <property name="my_basedir" location="."/>
  110.     <!-- ============================================= -->
  111.     <!--            Package Application                -->
  112.     <!-- ============================================= -->
  113.     <target name="full_package" description="Package Grahams Project as a single deployable file.">
  114.         <mkdir dir="${basedir}/dist" />
  115.        
  116.         <jar jarfile="${basedir}/dist/GrahamsProj-app.ear">
  117.             <metainf dir="${basedir}/META-INF">
  118.                     <include name="application.xml"/>
  119.             </metainf>
  120.             <fileset file="${basedir}/../GrahamsProjServer/dist/GrahamsProjServer.ear" />
  121.             <fileset file="${basedir}/../GrahamsProjClient/done/GrahamsProjClient.war" />
  122.         </jar>
  123.     </target>
  124.    
  125.  
  126.     <!-- ============================================= -->
  127.     <!--            Deployment Targets                 -->
  128.     <!-- ============================================= -->
  129.  
  130.     <target name="full_deploy" depends="full_package" description="Deploy PROPworks to the provided JBoss deploy directory.">
  131.         <copy file="${basedir}/dist/GrahamsProj-app.ear" todir="${deploy.location}" />
  132.     </target>
  133. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement