-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.xml
More file actions
130 lines (119 loc) · 7.08 KB
/
build.xml
File metadata and controls
130 lines (119 loc) · 7.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?xml version="1.0" encoding="utf-8" ?>
<project name="cing" default="iCing-servlet-install" basedir=".">
<description>Builds, tests, and runs the project cing.</description>
<echo>Starting Ant with updated build file</echo>
<property file="cing.properties" />
<!-- Added for functionality. Requires a ant-contrib.jar in classpath. -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<target name="init" description="init">
<!-- Set the below to development 0 or production 1-->
<property name="isProduction" value="1" />
<if>
<equals arg1="${isProduction}" arg2="1" />
<then>
<echo message="Now in CING environment for production." />
<property name="home.web.port" value="${home.web.port.prod}" />
<property name="home.web.machine" value="${home.web.machine.prod}" />
<property name="home.web.machine.looped" value="${home.web.machine.looped.prod}" />
<property name="home.web.user" value="${home.web.user.prod}" />
<property name="home.web.dir" value="${home.web.dir.prod}" />
<property name="icing.webapp.dir" value="${icing.webapp.dir.prod}" />
</then>
<else>
<echo message="Now in CING environment for development." />
<property name="home.web.port" value="${home.web.port.dev}" />
<property name="home.web.machine" value="${home.web.machine.dev}" />
<property name="home.web.machine.looped" value="${home.web.machine.looped.dev}" />
<property name="home.web.user" value="${home.web.user.dev}" />
<property name="home.web.dir" value="${home.web.dir.dev}" />
<property name="icing.webapp.dir" value="${icing.webapp.dir.dev}" />
</else>
</if>
<property name="home.web.url" value="${home.web.machine}/${ant.project.name}" />
<property name="home.web.usermachine" value="${home.web.user}@${home.web.machine}" />
<if>
<not>
<available file="${build.classes.dir}" />
</not>
<then>
<echo message="Creating the path: ${build.classes.dir}." />
<mkdir dir="${build.classes.dir}" />
</then>
</if>
<copy verbose="true" file="python/cing/valSets.cfg" todir="war/example" />
<echo message="Synced configuration file to iCing examples." />
<echo message="Initiating CING revision" />
<antcall target="set_revision" />
<echo message="home.web.port : ${home.web.port}" />
<echo message="home.web.machine : ${home.web.machine}" />
<echo message="home.web.machine.looped: ${home.web.machine.looped}" />
<echo message="home.web.user : ${home.web.user}" />
<echo message="home.web.dir : ${home.web.dir}" />
<echo message="home.web.local.dir : ${home.web.local.dir}" />
<echo message="icing.webapp.dir : ${icing.webapp.dir}" />
</target>
<!--
<target name="set-version" depends="init">
<tstamp>
<format property="cing_version" pattern="yyyyMMdd-HHmm" />
</tstamp>
<echo message="Initiating cing version: ${cing_version}" />
<replaceregexp file="java/src/cing/client/Settings.java" match="String VERSION = (.*)" replace='String VERSION = "${cing_version}";' byline="true" />
<echo message="Changed Settings.java to reflect new version." />
</target>
-->
<target name="iweb-CING-install" depends="init">
<echo message="Please insure that the iWeb sites have been compiled (saved and patched by tool) first. This ant target can alternatively be done from within iWeb." />
<echo message="Installing HTML from ${home.web.local.dir} to cing home: ${home.web.user}@${home.web.machine.looped}:${home.web.dir}" />
<scp todir="${home.web.user}@${home.web.machine.looped}:${home.web.dir}"
keyfile="${home.web.keyfile}"
knownhosts="${home.web.knownhosts}"
passphrase="${home.web.passphrase}"
port="${home.web.port}"
verbose="false">
<fileset dir="${home.web.local.dir}" />
</scp>
<!--
<sync verbose="true"></sync>
<copydir dest="" src="" ></copydir>
-->
</target>
<target name="iCing-servlet-install" depends="init,war">
<echo message="TODO MANUALLY on server: sudo rm ${icing.webapp.dir}/icing.war" />
<echo message="Ensure that the tomcat and apache are already setup. As well as the production staging area. Do gwt compile before calling." />
<echo message="The gwt compile is done from the Eclipse 'GWT compile project' button (red, near the top-left)" />
<echo message="toDir: ${home.web.user}@${home.web.machine.looped}:${icing.webapp.dir}" />
<echo message="with port = ${home.web.port} and knownhosts=${home.web.knownhosts} passphrase=${home.web.passphrase} keyfile=${home.web.keyfile} " />
<scp todir="${home.web.user}@${home.web.machine.looped}:${icing.webapp.dir}"
keyfile="${home.web.keyfile}" knownhosts="${home.web.knownhosts}" passphrase="${home.web.passphrase}" verbose="true" port="${home.web.port}">
<fileset file="${icing.war.file}" />
</scp>
<echo message="TODO MANUALLY: sudo chown tomcat6:tomcat6 ${icing.webapp.dir}/icing.war" />
<echo message="TODO MANUALLY: check that the new war is deployed with: tail -f $CATALINA_BASE/logs/*" />
<echo message="TODO MANUALLY: if not deployed force it to reload with: sudo /etc/init.d/tomcat6 restart" />
</target>
<target name="war" description="Create a war file" depends="init">
<zip destfile="${icing.war.file}" basedir="war"/>
</target>
<target name="set_revision" >
<!-- <property name="cing_revision" value="9998" /> -->
<!-- Can't use errorproperty because Wattos doesn't split streams. -->
<exec executable="java" outputproperty="cing_revision" resultproperty="cing_rev_result">
<arg value="Wattos.Utils.Programs.GetRevision"/>
<arg value="CINGROOT"/>
</exec>
<echo message="Found output: ${cing_revision}" />
<!-- <echo message="cing_rev_result: ${cing_rev_result}" /> -->
<if>
<equals arg1="${cing_rev_result}" arg2="0" />
<then>
<echo message="Adjusting cing revision number to ${cing_revision}."/>
<replaceregexp file="${src.dir}/cing/client/Settings.java"
match="String REVISION = (.*)" replace='String REVISION = "${cing_revision}";' byline="true" />
</then>
<else>
<echo message="Maintaining original cing revision number."/>
</else>
</if>
</target>
</project>