Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 10.19 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <project name="MedReminder" default="build" basedir=".">
  3.   <!-- Arguments to gwtc and devmode targets -->
  4.   <property name="gwt.args" value="" />
  5.   <property name="server" value="148.251.68.83" />
  6.   <property name="user" value="obadmin" />
  7.   <property name="password" value="silent-6AzF4pj" />
  8.     <property name="jenkins-path" value="usr/share/tomcat/.jenkins/workspace/Deploy-MedReminder" />
  9.   <!-- Configure path to GWT SDK -->
  10.   <property name="gwt.sdk" location="/usr/lib/gwt/gwt-2.7.0" />
  11.  
  12.    
  13.   <path id="gateway-libs">
  14.     <fileset dir="/usr/share/tomcat/.jenkins/workspace/Deploy-MedReminder/MedReminderGateway">
  15.     <include name="*.jar"/>
  16.     </fileset>
  17.     <!-- Add any additional non-server libs (such as JUnit) here -->
  18.   </path>
  19.  
  20.   <path id="project.class.path">
  21.     <pathelement location="MedReminder/war/WEB-INF/classes"/>
  22.     <pathelement location="${gwt.sdk}/gwt-user.jar"/>
  23.     <pathelement location="${gwt.sdk}/gwt-dev.jar"/>
  24.     <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar"/>
  25.     <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar"/>
  26.     <fileset dir="MedReminder/war/WEB-INF/lib" includes="**/*.jar"/>
  27.     <!-- Add any additional non-server libs (such as JUnit) here -->
  28.   </path>
  29.  
  30.   <target name="libs" description="Copy libs to WEB-INF/lib">
  31.     <mkdir dir="MedReminder/war/WEB-INF/lib" />
  32.     <copy todir="MedReminder/war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
  33.     <copy todir="MedReminder/war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />
  34.     <!-- Add any additional server libs that need to be copied -->
  35.   </target>
  36.  
  37.   <target name="javac" depends="libs" description="Compile java source to bytecode">
  38.     <mkdir dir="MedReminder/war/WEB-INF/classes"/>
  39.     <javac includeantruntime="false" srcdir="MedReminder/src" includes="**" encoding="utf-8"
  40.       destdir="MedReminder/war/WEB-INF/classes"
  41.       source="1.7" target="1.7" nowarn="true"
  42.       debug="true" debuglevel="lines,vars,source">
  43.       <classpath refid="project.class.path"/>
  44.     </javac>
  45.     <copy todir="MedReminder/war/WEB-INF/classes">
  46.       <fileset dir="MedReminder/src" excludes="**/*.java"/>
  47.     </copy>
  48.   </target>
  49.  
  50.   <target name="gwtc" depends="javac" description="GWT compile to JavaScript (production mode)">
  51.     <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="256m">
  52.       <classpath>
  53.         <pathelement location="MedReminder/src"/>
  54.         <path refid="project.class.path"/>
  55.       </classpath>
  56.       <arg line="-war"/>
  57.       <arg value="MedReminder/war"/>
  58.       <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
  59.       <jvmarg value="-Xmx1024m"/>
  60.       <jvmarg value="-Djava.util.prefs.userRoot=/usr/lib/javaPreferences/rprefs"/>
  61.       <jvmarg value="-Djava.util.prefs.systemRoot=/usr/lib/javaPreferences/sprefs"/>
  62.       <arg line="${gwt.args}"/>
  63.       <arg value="org.observis.medreminder.MedReminder"/>
  64.     </java>
  65.   </target>
  66.  
  67.   <target name="devmode" depends="javac" description="Run development mode (pass -Dgwt.args=-nosuperDevMode to fallback to classic DevMode)">
  68.     <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" maxmemory="1g">
  69.       <classpath>
  70.         <pathelement location="MedReminder/src"/>
  71.         <path refid="project.class.path"/>
  72.         <pathelement location="${gwt.sdk}/gwt-codeserver.jar"/>
  73.       </classpath>
  74.       <arg value="-startupUrl"/>
  75.       <arg value="MedReminder/MyWebApp.html"/>
  76.       <arg line="-war"/>
  77.       <arg value="war"/>
  78.       <!-- Additional arguments like -style PRETTY, -logLevel DEBUG or -nosuperDevMode -->
  79.       <arg line="${gwt.args}"/>
  80.       <arg value="com.test.test.MyWebApp"/>
  81.       <arg value="com.test.test.MyWebApp"/>
  82.     </java>
  83.   </target>
  84.  <!--
  85.   <target name="buildscheduler" description="Compile sms scheduler.">
  86.    <mkdir dir="MedReminderGateway/bin/"/>
  87.    <javac includeantruntime="false" srcdir="MedReminderGateway/src" includes="**" encoding="utf-8"
  88.       destdir="MedReminderGateway/bin"
  89.       source="1.7" target="1.7" nowarn="true"
  90.       debug="true" debuglevel="lines,vars,source">
  91.      <classpath refid="project.class.path"/>
  92.    </javac>
  93.    <copy todir="MedReminderGateway/bin">
  94.      <fileset dir="MedReminderGateway/src" excludes="**/*.java"/>
  95.    </copy>
  96.  </target>
  97.  -->
  98.   <target name ="no-cleanGateway" description="Skips cleaning MedReminderGateway."/>
  99.   <target name ="no-buildscheduler" description="Skips building MedReminderGateway."/>
  100.   <target name ="no-deployGateway" description="Skips deploying MedReminderGateway."/>
  101.   <target name ="cleanGateway" description="Deletes previous version of MedReminderGateway.">
  102.    <delete dir="MedReminderGateway/bin" failonerror="false" />
  103.   </target>
  104.  
  105.   <target name ="buildscheduler" depends="cleanGateway"  description="Compile sms scheduler.">
  106.    <mkdir dir = "MedReminderGateway/bin"/>
  107.    <javac includeantruntime="false" srcdir="MedReminderGateway/src" includes="**" encoding="utf-8"
  108.     destdir="MedReminderGateway/bin"
  109.     source="1.7" target="1.7" nowarn="true"
  110.     debug="true" debuglevel="lines,vars,source">
  111.     <classpath refid="gateway-libs"/>
  112.    </javac>
  113.    <copy todir="MedReminderGateway/bin">
  114.     <fileset dir ="MedReminderGateway/src" excludes="**/*.java"/>
  115.    </copy>
  116.   </target>
  117.    
  118.   <target name="deployGateway" description="Deploys MedGateway" >
  119.    <zip destfile="MedGateway/medgateway.zip" basedir="MedReminderGateway/bin"/>  
  120.     <sshexec host="${server}"
  121.     username="${user}"
  122.     password="${password}"
  123.     trust="yes"
  124.     usepty="true"
  125.     failonerror="false"
  126.     command="echo ${password} | sudo -S rm ~/MedReminder/medgateway.zip" />
  127.      <scp localFile="/usr/share/tomcat/.jenkins/workspace/Deploy-MedReminder/MedGateway/medgateway.zip" remoteTodir="${user}:${password}@${server}:~/MedReminder" trust="true" />
  128.     <sshexec host="${server}"
  129.     username="${user}"
  130.     password="${password}"
  131.     trust="yes"
  132.     usepty="true"
  133.     failonerror="false"
  134.     command="cd ~/MedReminder | echo ${password} | sudo -S sh /home/obadmin/MedReminder/deploy.sh" />
  135.   </target>
  136.  
  137.  
  138. <!--
  139. Test targets suppressed because -junit argument was not specified when running webAppCreator.
  140.  
  141. <target name="javac.tests" depends="javac" description="Compiles test code">
  142.   <javac srcdir="test" includes="**" encoding="utf-8"
  143.     source="1.7" target="1.7" nowarn="true"
  144.     destdir="war/WEB-INF/classes"
  145.     debug="true" debuglevel="lines,vars,source">
  146.     <classpath location="path_to_the_junit_jar"/>
  147.     <classpath refid="project.class.path"/>
  148.   </javac>
  149. </target>
  150.  
  151. <target name="test.dev" depends="javac.tests" description="Run development mode tests">
  152.   <mkdir dir="reports/htmlunit.dev" />
  153.   <junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
  154.     <sysproperty key="gwt.args" value="-logLevel WARN -war www-test" />
  155.     <sysproperty key="java.awt.headless" value="true" />
  156.     <classpath>
  157.       <pathelement location="src" />
  158.       <pathelement location="test" />
  159.       <path refid="project.class.path" />
  160.       <pathelement location="/home/obadmin/gwt/gwt-2.7.0/validation-api-1.0.0.GA.jar" />
  161.       <pathelement location="/home/obadmin/gwt/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar" />
  162.       <pathelement location="path_to_the_junit_jar" />
  163.     </classpath>
  164.     <batchtest todir="reports/htmlunit.dev" >
  165.       <fileset dir="test" >
  166.         <include name="**/*Test.java" />
  167.       </fileset>
  168.     </batchtest>
  169.     <formatter type="plain" />
  170.     <formatter type="xml" />
  171.   </junit>
  172. </target>
  173.  
  174. <target name="test.prod" depends="javac.tests" description="Run production mode tests">
  175.   <mkdir dir="reports/htmlunit.prod" />
  176.   <junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
  177.     <sysproperty key="gwt.args" value="-prod -logLevel WARN -war www-test" />
  178.     <sysproperty key="java.awt.headless" value="true" />
  179.     <classpath>
  180.       <pathelement location="src" />
  181.       <pathelement location="test" />
  182.       <path refid="project.class.path" />
  183.       <pathelement location="/home/obadmin/gwt/gwt-2.7.0/validation-api-1.0.0.GA.jar" />
  184.       <pathelement location="/home/obadmin/gwt/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar" />
  185.       <pathelement location="path_to_the_junit_jar" />
  186.     </classpath>
  187.     <batchtest todir="reports/htmlunit.prod" >
  188.       <fileset dir="test" >
  189.         <include name="**/*Test.java" />
  190.       </fileset>
  191.     </batchtest>
  192.     <formatter type="plain" />
  193.     <formatter type="xml" />
  194.   </junit>
  195. </target>
  196.  
  197. <target name="test" description="Run development and production mode tests">
  198.   <antcall target="test.dev" />
  199.   <antcall target="test.prod" />
  200. </target>
  201. -->
  202.  
  203.   <target name="build" depends="gwtc" description="Build this project" />
  204.  
  205.   <target name="war" depends="build" description="Create a war file">
  206.     <zip destfile="MedReminder.war" basedir="MedReminder/war"/>
  207.   </target>
  208.  
  209.   <target name="deploy" description="Copies war to tomcat.">
  210.    <copy todir="/usr/share/tomcat/webapps/">
  211.     <fileset dir=".">
  212.      <include name="MedReminder.war"/>
  213.      <type type="file"/>
  214.     </fileset>
  215.    </copy>
  216.   </target>
  217.  
  218.   <target name="clean" description="Cleans this project">
  219.     <delete dir="MedReminder/war/WEB-INF/classes" failonerror="false" />
  220.     <delete dir="MedReminder/war/MedReminder" failonerror="false" />
  221.     <delete file="MedReminder.war" failonerror="false" />
  222.   </target>
  223.   <target name="deploy-remote" description="Uploads MedReminder.war to the remote server and cleans the old file before redeploying.">
  224.  
  225.   <!--   -->
  226.   <scp localFile="/usr/share/tomcat/.jenkins/workspace/Deploy-MedReminder/MedReminder.war" remoteTodir="${user}:${password}@${server}:~/MedReminder" trust="true" />
  227.  
  228.   <sshexec host="${server}"
  229.  username="${user}"
  230.  password="${password}"
  231.  trust="yes"
  232.  usepty="true"
  233.  failonerror="false"
  234.  command="echo ${password} | sudo -S rm /usr/share/tomcat6/webapps/MedReminder.war" />
  235.  
  236.   <sshexec host="${server}"
  237.  username="${user}"
  238.  password="${password}"
  239.  trust="yes"
  240.  usepty="true"
  241.  failonerror="false"
  242.  command="echo ${password} | sudo -S cp /home/obadmin/MedReminder/MedReminder.war /usr/share/tomcat6/webapps" />
  243.   </target>
  244. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement