Blame view

build.xml 10.8 KB
6c53bca13   Fernando Ribeiro   Create public val...
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
  <?xml version="1.0" encoding="utf-8" ?>
  <project name="metarepository" default="deploy" basedir=".">
  	<property file="build.properties"/>
  	<property name="final.name" value="${name}-${version}"/>
  
  	<path id="build.classpath">
  		<fileset dir="${lib.dir}">
  			<include name="**/*.jar"/>
  		</fileset>
  	</path>
  
  	<target name="init">
  		<tstamp/>
  	</target>
  
  	<target name="compile" depends="clean, init">
  		<mkdir dir="${build.dir}/classes" />
  		<javac debug="true" srcdir="${src.dir}" includes="**/*.java" destdir="${build.dir}/classes">
  			<!--<compilerarg value="-Xlint:deprecation"/>-->
  			<!--<compilerarg value="-Xlint:unchecker"/>-->
  			<classpath refid="build.classpath" />
  		</javac>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/rights.list" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/doctypes.list" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/languages.list" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/stopWords.list" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/CqlToSQL.properties" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/CqlToSolr.properties" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/validator.xml" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/configuration" file="${config.dir}/validator.xsd" overwrite="true"/>
  		<copy todir="${build.dir}/classes/pt/keep/metarepository/core/localization" overwrite="true">
  			<fileset dir="${config.dir}/" includes="**/Messages*.properties" />
  		</copy>
  		<!--<copy todir="${web.dir}/images/repositories" overwrite="true">
  			<fileset dir="${logos.dir}/" includes="**/*.jpg" />
  		</copy>-->
  		<copy todir="${build.dir}/classes/templates" overwrite="true">
  			<fileset dir="${config.dir}/templates/" includes="**/*" />
  		</copy>
  		<copy todir="${build.dir}/classes" file="${config.dir}/metarepository.config" overwrite="true" />
  		<copy todir="${build.dir}/classes" file="${config.dir}/oaicat.properties" overwrite="true" />
  		<copy todir="${build.dir}/classes" file="${config.dir}/log4j.xml" overwrite="true" />
  	</target>
  
  	<target name="jar" depends="compile">
  		<mkdir dir="${build.dir}"/>
  		<jar destfile="${build.dir}/${final.name}.jar" basedir="${build.dir}/classes/">
  			<manifest>
  				<attribute name="Created-By" value="KEEP SOLUTIONS Lda."/>
  			</manifest>
  		</jar>
  	</target>
  
  	<target name="build" depends="compile">
  		<mkdir dir="${bin.dir}"/>
  		<jar destfile="${bin.dir}/${harvest_file_name}.jar" basedir="${build.dir}/classes/">
  			<fileset dir="${lib.dir}/">
  				<include name="*.jar"/>
  			</fileset>
  			<manifest>
  				<attribute name="Main-Class" value="pt.keep.metarepository.core.app.HarvestApp"/>
  			</manifest>
  		</jar>
  	</target>
  
  	<target name="harvest">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath"/>
  				<path location="${bin.dir}/${harvest_file_name}.jar"/>
  			</classpath>
  			<arg value="-o" />
  			<arg value="HARVEST"/>
  			<arg value="--${selector}" />
  			<arg value="${selector_value}"/>
  		</java>
  	</target>
  
  	<target name="force_harvest">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath"/>
  				<path location="${bin.dir}/${harvest_file_name}.jar"/>
  			</classpath>
  			<arg value="-o" />
  			<arg value="HARVEST"/>
  			<arg value="-f" />
  			<arg value="--${selector}" />
  			<arg value="${selector_value}"/>
  		</java>
  	</target>
  
  	<target name="send">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath"/>
  				<path location="${bin.dir}/${harvest_file_name}.jar"/>
  			</classpath>
  			<arg value="-o" />
  			<arg value="SENDMAIL"/>
  		</java>
  	</target>
  
  	<target name="subjects">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath"/>
  				<path location="${bin.dir}/${harvest_file_name}.jar"/>
  			</classpath>
  			<arg value="-o" />
  			<arg value="PARSESUBJECTS"/>
  		</java>
  	</target>
  
  	<target name="statistics">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath" />
  				<path location="${bin.dir}/${harvest_file_name}.jar" />
  			</classpath>
  			<arg value="-o" />
  			<arg value="STATISTICS"/>
  		</java>
  	</target>
  	<target name="graphs">
  		<java fork="true" classname="pt.keep.metarepository.core.app.HarvestApp" maxmemory="2048m" failonerror="true">
  			<jvmarg value="-Xss4096k" />
  			<sysproperty key="log4j.configuration" value="file:${config.dir}/log4j.xml"/>
  			<classpath>
  				<path refid="build.classpath" />
  				<path location="${bin.dir}/${harvest_file_name}.jar" />
  			</classpath>
  			<arg value="-o" />
  			<arg value="GRAPHS"/>
  		</java>
  	</target>
  
  	<!-- create war file -->
  	<target name="war" depends="compile">
  		<mkdir dir="${build.dir}"/>
  		<war destfile="${build.dir}/${deploy.name}.war" webxml="${config.dir}/web.xml">
  			<fileset dir="${web.dir}" excludes="WEB-INF/web.xml"/>
  			<classes dir="${build.dir}/classes"/>
  			<lib file="${lib.dir}/mysql-connector-java-5.1.7-bin.jar"/>
  			<lib file="${lib.dir}/commons-lang-2.4.jar"/>
  			<lib file="${lib.dir}/commons-fileupload.jar"/>
  			<lib file="${lib.dir}/commons-io.jar"/>
  			<lib file="${lib.dir}/commons-logging.jar"/>
  			<lib file="${lib.dir}/commons-httpclient-3.1.jar" />
  			<lib file="${lib.dir}/cql-java.jar"/>
  			<lib file="${lib.dir}/axis.jar"/>
  			<lib file="${lib.dir}/jaxb-impl-2.1.9.jar"/>
  			<lib file="${lib.dir}/httpcore-4.0.jar"/>
  			<lib file="${lib.dir}/httpclient-4.0-beta2.jar"/>
  			<lib file="${lib.dir}/axiom-api-1.2.5.jar"/>
  			<lib file="${lib.dir}/axiom-impl-1.2.5.jar"/>
  			<lib file="${lib.dir}/log4j-1.2.16.jar"/>
  			<lib file="${lib.dir}/log4j-extras-1.1.jar"/>
  			<lib file="${lib.dir}/velocity-1.6.2.jar" />
  			<lib file="${lib.dir}/commons-collections-3.2.1.jar" />
  			<lib file="${lib.dir}/mailapi.jar" />
  			<lib file="${lib.dir}/smtp.jar" />
  			<lib file="${lib.dir}/oaicat.jar" />
  			<lib file="${lib.dir}/degois-3.0.jar" />
  			<lib file="${lib.dir}/jaxrpc.jar" />
  			<lib file="${lib.dir}/commons-discovery.jar" />
  			<lib file="${lib.dir}/wsdl4j.jar" />
  			<lib file="${lib.dir}/solr-core-3.4.0.jar" />
  			<lib file="${lib.dir}/solr-solrj-3.4.0.jar" />
  			<lib file="${lib.dir}/commons-codec-1.3.jar" />
  			<lib file="${lib.dir}/jcl-over-slf4j-1.5.5.jar" />
  			<lib file="${lib.dir}/lucene-analyzers-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-core-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-misc-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-memory-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-queries-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-spellchecker-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-spatial-3.4.0.jar" />
  			<lib file="${lib.dir}/lucene-highlighter-3.4.0.jar" />
  			<lib file="${lib.dir}/slf4j-api-1.5.5.jar" />
  			<lib file="${lib.dir}/slf4j-log4j12-1.5.5.jar" />
  			<!-- jersey stuff -->
  			<lib file="${lib.dir}/javax.ws.rs-api-2.0.jar" />
  			<lib file="${lib.dir}/jersey-container-servlet.jar" />
  			<lib file="${lib.dir}/jersey-container-servlet-core.jar" />
  			<lib file="${lib.dir}/jersey-common.jar" />
  			<lib file="${lib.dir}/jersey-client.jar" />
  			<lib file="${lib.dir}/jersey-server.jar" />
  			<lib file="${lib.dir}/asm-all-repackaged-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/guava-14.0.1.jar" />
  			<lib file="${lib.dir}/cglib-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/validation-api-1.1.0.Final.jar" />
  			<lib file="${lib.dir}/persistence-api-1.0.jar" />
  			<lib file="${lib.dir}/osgi-resource-locator-1.0.1.jar" />
  			<lib file="${lib.dir}/org.osgi.core-4.2.0.jar" />
  			<lib file="${lib.dir}/jaxb-api-2.2.7.jar" />
  			<lib file="${lib.dir}/javax.inject-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/javax.annotation-api-1.2.jar" />
  			<lib file="${lib.dir}/hk2-utils-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/hk2-locator-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/hk2-api-2.2.0-b21.jar" />
  			<lib file="${lib.dir}/jersey-mvc-jsp-2.4.1.jar" />
  			<lib file="${lib.dir}/jersey-mvc-2.4.1.jar" />
  
  			<!-- json stuff -->
  			<lib file="${lib.dir}/json-simple-1.1.1.jar" />
  		</war>
  	</target>
  
  	<target name="deploy" depends="war, build">
  		<delete file="${deploy.dir}/${deploy.name}.war"/>
  		<copy todir="${deploy.dir}" file="${build.dir}/${deploy.name}.war"/>
  		<echo message="Deverá reiniciar o tomcat" />
  		<echo message="Deverá também correr 'ant graphs' assim que o .war for expandido" />
  
  	</target>
  
  	<target name="src.dist" depends="clean" description="--> Generates the source oaiarc distribution as .tar.gz">
  		<mkdir dir="${dist.dir}"/>
  		<mkdir dir="${build.dir}"/>
  		<delete file="${build.dir}/${final.name}-src.tar"/>
  		<delete file="${dist.dir}/${final.name}-src.tar.gz"/>
  		<tar tarfile="${build.dir}/${final.name}-src.tar">
  			<tarfileset prefix="${final.name}-src" dir="." includes="src/,config/,bin/,lib/,build.properties,build.xml,README.txt,CHANGES.txt,AUTHORS.txt"/>
  		</tar>
  		<gzip zipfile="${dist.dir}/${final.name}-src.tar.gz" src="${build.dir}/${final.name}-src.tar" />
  	</target>
  
  
  	<target name="dist" depends="war" description="--> Generates the oaiarc distribution as .tar.gz">
  		<mkdir dir="${dist.dir}"/>
  		<delete file="${build.dir}/${final.name}.tar"/>
  		<delete file="${dist.dir}/${final.name}.tar.gz"/>
  		<tar tarfile="${build.dir}/${final.name}.tar">
  			<tarfileset prefix="${final.name}" dir="."
  		  	includes="src/,config/,bin/,lib/,build.properties,build.xml,README.txt,CHANGES.txt,AUTHORS.txt"/>
  			<tarfileset prefix="${final.name}" dir="${build.dir}"
  		  		includes="${final.name}.jar,${deploy.name}.war"/>
  		</tar>
  		<gzip zipfile="${dist.dir}/${final.name}.tar.gz" src="${build.dir}/${final.name}.tar" />
  	</target>
  
  	<target name="clean">
  		<delete dir="${build.dir}"/>
  		<delete dir="${dist.dir}"/>
  	</target>
  </project>