Bedework/EclipseIDE: build-proj.xml

Line 
1 <project name="umd-custom-build" default="usage">
2
3         <!--
4            This script modifies the WAR files generated after building bedework,
5            allowing you to customize them with your own files.  You can use
6            it as a template for your own build process.  It's designed so
7            you can just copy it for each project and change the variables
8            at the top of the script.  You can run it from within the eclipse
9            IDE, but you'll need to:
10            
11            - Add the jsch and antcontrib ant task under Window>Preferences>Ant>Runtime(Classpath tab)
12            - Change server,root.dir, etc variables to point to your quickstart install
13            - Pass in user and pass to script.  In eclipse, right click on build.xml (this script),
14              Run as > Ant Build...  In popup window, go to Main tab.  Drag window down a bit
15              so you can see the "Arguments" textbox, and place this text in there:
16              
17              -Dpassword=MyPass -Dusr=MyUsrName
18              
19              Where MyPass is your pass, and MyUsrName is your user name.
20              
21              See the master script for how to kick off these individual scripts. See the
22              bedework wiki for more instructions:
23              
24              http://www.bedework.org/trac/bedework/wiki/Bedework/EclipseIDE
25              
26         -->
27        
28         <property name="server" value="umd-dev-server.umd.edu" />
29
30         <property name="root.dir"
31                   location="F:/bedework-3.4.1/apache-tomcat-5.5.17/webapps/ROOT/caladminrsrc" />
32
33         <property name="proj.dir"
34                   location="F:/bedework-3.4.1/apache-tomcat-5.5.17/webapps/caladmin" />
35
36         <property name="dist.dir"
37                   location="F:/bedework-3.4.1/apache-tomcat-5.5.17/webapps/" />
38
39         <property name="proj.name" value="caladmin" />
40
41         <property name="root.name" value="caladminrsrc" />
42
43
44         <property name="build.dir" location="../../../builds/current" />
45
46
47
48         <target name="usage" description=".">
49
50         </target>
51
52         <target name="build.all">
53                 <antcall target="build.docs"/>
54                 <antcall target="build.war"/>
55         </target>
56        
57         <target name="deploy.all">
58                 <antcall target="deploy.docs"/>
59                 <antcall target="deploy.war"/>
60         </target>
61
62         <target name="build.docs">
63                 <!-- Overwrite ROOT files -->
64                 <copy overwrite="true" todir="${dist.dir}/ROOT/">
65                         <fileset dir="ROOT/">
66                         </fileset>
67                 </copy>
68
69
70                 <!-- Copy updated ROOT files to final dest-->
71                 <copy overwrite="true" todir="${build.dir}/${proj.name}/ROOT/">
72                         <fileset dir="${root.dir}">
73                         </fileset>
74                 </copy>
75         </target>
76  
77                
78         <!-- Custom stuff for building this WAR -->
79         <target name="internal.build.war.custom">
80                  
81                
82         </target>
83                
84         <target name="build.war">
85  
86                 <unzip src="${dist.dir}/${proj.name}.war" dest="${dist.dir}/${proj.name}"/>
87
88                
89                 <!-- Copy common files -->
90
91                 <copy overwrite="true"
92                       file="../common/hibernate.properties"
93                       todir="${proj.dir}/WEB-INF/classes" />
94                 <copy overwrite="true"
95                       file="../common/env.properties"
96                       todir="${proj.dir}/WEB-INF/classes/properties/calendar/" />
97                 <copy overwrite="true"
98                       file="../common/options.xml"
99                       todir="${proj.dir}/WEB-INF/classes/properties/calendar" />
100
101
102                 <!-- Copy updated files that go in WAR to final dest-->
103                 <copy overwrite="true" todir="${proj.dir}/">
104                         <fileset dir="webapp">
105                                 <include name="**/*" />
106                         </fileset>
107                 </copy>
108
109                
110                 <antcall target="internal.build.war.custom"/>
111                
112                 <!-- Create WAR -->
113                 <mkdir dir="${build.dir}/${proj.name}/"/>
114                 <zip destfile="${build.dir}/${proj.name}/${proj.name}.war"
115                      basedir="${proj.dir}" />
116
117         </target>
118
119
120         <target name="deploy.docs">
121                 <!-- upload docs -->
122                 <scp trust="true"
123                      verbose="true"
124                      todir="${usr}:${password}@${server}:/opt/portal/tomcat/bedework/jakarta-tomcat-5.5.17/webapps/ROOT/${root.name}">
125                         <fileset dir="${build.dir}/${proj.name}/ROOT/" />
126                 </scp>
127
128         </target>
129
130         <target name="deploy.war">
131                 <!-- upload war -->
132                 <scp trust="true"
133                      verbose="true"
134                      todir="${usr}:${password}@${server}:/opt/portal/tomcat/bedework/jakarta-tomcat-5.5.17/webapps/">
135
136                         <fileset dir="${build.dir}/${proj.name}/">
137                                 <include name="**/${proj.name}.war" />
138                         </fileset>
139
140                 </scp>
141
142         </target>
143 </project>