-
Notifications
You must be signed in to change notification settings - Fork 60
/
build.xml
215 lines (185 loc) · 8.86 KB
/
build.xml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<?xml version="1.0" encoding="UTF-8"?>
<project name="geoexplorer" default="dist" basedir=".">
<description>
GeoExplorer Build File
</description>
<property name="build" location="build"/>
<property name="ringo" location="externals/ringojs-fork"/>
<property name="app.proxy.geoserver" value=""/>
<property name="app.port" value="9080"/>
<property name="cargo.host" value="localhost"/>
<property name="cargo.port" value="8080"/>
<property name="cargo.container" value="tomcat6x"/>
<property name="cargo.username" value="manager"/>
<property name="cargo.password" value=""/>
<property name="cargo.context" value="${ant.project.name}"/>
<condition property="git" value="git.cmd" else="git">
<os family="windows"/>
</condition>
<target name="init">
<echo message="pulling in submodules"/>
<exec executable="${git}" failonerror="true">
<arg line="submodule init"/>
</exec>
<exec executable="${git}" failonerror="true">
<arg line="submodule sync"/>
</exec>
<exec executable="${git}" failonerror="true">
<arg line="submodule update"/>
</exec>
<echo message="building ringo jars"/>
<ant dir="${ringo}" target="jar"/>
<copy todir="${ringo}/lib" flatten="true" includeEmptyDirs="false">
<fileset dir="lib"/>
</copy>
</target>
<target name="buildjs">
<mkdir dir="${build}/${ant.project.name}/WEB-INF/app/static/script"/>
<java jar="${ringo}/run.jar" fork="true" failonerror="true">
<sysproperty key="ringo.home" path="${ringo}"/>
<arg path="externals/buildkit/lib/buildkit/build.js"/>
<arg line="-o ${build}/${ant.project.name}/WEB-INF/app/static/script buildjs.cfg"/>
</java>
</target>
<target name="dist" depends="init, postcompile"/>
<!-- this target is useful when init has already been run -->
<target name="postcompile" depends="test, buildjs, redist"/>
<target name="redist">
<mkdir dir="${build}/${ant.project.name}"/>
<copy todir="${build}/${ant.project.name}">
<fileset dir="src/main/webapp/">
</fileset>
</copy>
<copy todir="${build}/${ant.project.name}/WEB-INF/lib" flatten="true" includeEmptyDirs="false">
<fileset dir="${ringo}/lib"/>
</copy>
<copy todir="${build}/${ant.project.name}/WEB-INF/app">
<fileset dir="app">
<exclude name="**/externals/**"/>
<exclude name="**/script/**"/>
</fileset>
</copy>
<!-- copy stick -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/stick">
<fileset dir="externals/stick">
<include name="**/lib/**"/>
<include name="package.json"/>
</fileset>
</copy>
<!-- copy Ext resources -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/static/externals/ext">
<fileset dir="app/static/externals/ext">
<exclude name="**/*debug*.js"/>
<exclude name="**/ext-all-notheme.css"/>
<exclude name="**/xtheme-blue.css"/>
</fileset>
</copy>
<!-- copy OpenLayers resources -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/static/externals/openlayers/theme">
<fileset dir="app/static/externals/openlayers/theme"/>
</copy>
<!-- copy GeoExt resources -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/static/externals/GeoExt/resources">
<fileset dir="app/static/externals/GeoExt/resources">
<exclude name="**/geoext-all-debug.css"/>
<exclude name="**/gxtheme-slate.css"/>
<exclude name="**/slate/**"/>
</fileset>
</copy>
<!-- copy gxp resources -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/static/externals/gxp/src/theme">
<fileset dir="app/static/externals/gxp/src/theme"/>
</copy>
<!-- copy PrintPreview resources -->
<copy todir="${build}/${ant.project.name}/WEB-INF/app/static/externals/PrintPreview/resources">
<fileset dir="app/static/externals/PrintPreview/resources"/>
</copy>
</target>
<target name="war" depends="dist">
<war destfile="${build}/${ant.project.name}.war">
<fileset dir="${build}/${ant.project.name}"/>
</war>
</target>
<target name="initcargo">
<echo message="pulling in Cargo for remote deployment"/>
<mkdir dir="${build}/lib"/>
<get skipexisting="true" src="http://repo1.maven.org/maven2/org/codehaus/cargo/cargo-core-uberjar/1.2.1/cargo-core-uberjar-1.2.1.jar" dest="${build}/lib/cargo-core-uberjar.jar"/>
<get skipexisting="true" src="http://repo1.maven.org/maven2/org/codehaus/cargo/cargo-ant/1.2.1/cargo-ant-1.2.1.jar" dest="${build}/lib/cargo-ant.jar"/>
<get skipexisting="true" src="http://repo1.maven.org/maven2/commons-discovery/commons-discovery/0.4/commons-discovery-0.4.jar" dest="${build}/lib/commons-discovery.jar"/>
<get skipexisting="true" src="http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" dest="${build}/lib/commons-logging.jar"/>
</target>
<target name="deploy" depends="initcargo, war">
<taskdef resource="cargo.tasks">
<classpath>
<pathelement location="${build}/lib/cargo-core-uberjar.jar"/>
<pathelement location="${build}/lib/cargo-ant.jar"/>
<pathelement location="${build}/lib/commons-discovery.jar"/>
<pathelement location="${build}/lib/commons-logging.jar"/>
</classpath>
</taskdef>
<cargo containerId="${cargo.container}" action="redeploy" type="remote">
<configuration type="runtime">
<property name="cargo.hostname" value="${cargo.host}"/>
<property name="cargo.servlet.port" value="${cargo.port}"/>
<property name="cargo.remote.username" value="${cargo.username}"/>
<property name="cargo.remote.password" value="${cargo.password}"/>
<deployable type="war" file="${build}/${ant.project.name}.war">
<property name="context" value="${cargo.context}"/>
</deployable>
</configuration>
</cargo>
</target>
<target name="undeploy" depends="initcargo">
<taskdef resource="cargo.tasks">
<classpath>
<pathelement location="${build}/lib/cargo-core-uberjar.jar"/>
<pathelement location="${build}/lib/cargo-ant.jar"/>
<pathelement location="${build}/lib/commons-discovery.jar"/>
<pathelement location="${build}/lib/commons-logging.jar"/>
</classpath>
</taskdef>
<cargo containerId="${cargo.container}" action="undeploy" type="remote">
<configuration type="runtime">
<property name="cargo.hostname" value="${cargo.host}"/>
<property name="cargo.servlet.port" value="${cargo.port}"/>
<property name="cargo.remote.username" value="${cargo.username}"/>
<property name="cargo.remote.password" value="${cargo.password}"/>
<deployable type="war" file="${build}/${ant.project.name}.war">
<property name="context" value="${cargo.context}"/>
</deployable>
</configuration>
</cargo>
</target>
<target name="debug">
<java jar="${ringo}/run.jar" fork="true">
<sysproperty key="app.debug" value="1"/>
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="ringo.home" path="${ringo}"/>
<sysproperty key="ringo.modulepath" path="externals"/>
<arg path="app/main.js"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="debugall">
<java jar="${ringo}/run.jar" fork="true">
<sysproperty key="app.debug" value="1"/>
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="ringo.home" path="${ringo}"/>
<sysproperty key="ringo.modulepath" path="externals"/>
<arg value="-d"/>
<arg path="app/main.js"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="test" unless="skipTests">
<java jar="${ringo}/run.jar" fork="true" failonerror="yes">
<sysproperty key="ringo.home" path="${ringo}"/>
<sysproperty key="ringo.modulepath" path="externals"/>
<arg path="tests/all.js"/>
</java>
</target>
<target name="clean" description="remove previous build">
<delete dir="${build}"/>
<ant dir="${ringo}" target="clean"/>
</target>
</project>