source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/build.lib.xml@ 507

Last change on this file since 507 was 507, checked in by George Lilly, 15 years ago

NHIN gateway and adaptor for use on linux with VistA EHR and RPMS

File size: 16.7 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="nhinc.lib" default="none" basedir=".">
3
4 <import file="Properties.Build.xml"/>
5
6 <property name="Dollar" value="$"/>
7
8 <path id="ant.contrib.task.classpath">
9 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/ant-contrib-1.0b3.jar"/>
10 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/ivy-1.3.1.jar"/>
11 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/bcel-5.1.jar"/>
12 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/commons-httpclient-3.0.1.jar"/>
13 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/commons-logging-1.0.4.jar"/>
14 </path>
15
16 <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask">
17 <classpath refid="ant.contrib.task.classpath"/>
18 </taskdef>
19
20 <taskdef name="if" classname="net.sf.antcontrib.logic.IfTask">
21 <classpath refid="ant.contrib.task.classpath"/>
22 </taskdef>
23
24 <taskdef name="var" classname="net.sf.antcontrib.property.Variable">
25 <classpath refid="ant.contrib.task.classpath"/>
26 </taskdef>
27
28 <taskdef name="outofdate" classname="net.sf.antcontrib.logic.OutOfDate">
29 <classpath refid="ant.contrib.task.classpath"/>
30 </taskdef>
31
32 <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
33 <classpath>
34 <pathelement location="${PackagesDirectory}/Ant/Ant/lib/xmltask-v1.15.1.jar"/>
35 </classpath>
36 </taskdef>
37
38 <!--
39 ***** Properties used as params to this target *****
40
41 <property name="target-to-call" value=""/>
42
43 -->
44 <target name="call-target-in-isolation-if-out-of-date">
45 <echoxml file="${TempBuildFilePath}">
46 <project default="temp">
47 <import file="${ProductDirectory}\build.lib.xml" />
48 <target name="temp">
49 <property name="project-to-build" location="." />
50 <property name="target-to-call" value="${target-to-call}" />
51 <property name="base" value="${project-to-build}/lib" />
52 <property file="${project-to-build}/lib/nblibraries.properties" />
53 <property file="${project-to-build}/nbproject/project.properties" />
54 <antcall target="build-project-if-out-of-date" />
55 </target>
56 </project>
57 </echoxml>
58 <ant dir="." target="temp" inheritall="false" antfile="${TempBuildFilePath}" />
59 </target>
60
61 <target name="clean-gen" if="is-gen-outofdate">
62 <echo message="Cleaning generated code..."/>
63 <delete dir="${build.generated.dir}"/>
64 </target>
65
66 <target name="clean-gen-if-out-of-date">
67 <condition property="dist.file" value="${sedeployment.jar}" else="${dist.jar}">
68 <isset property="sedeployment.jar" />
69 </condition>
70
71 <property name="current-project" location="."/>
72
73 <echo message="Looking to see if ${current-project} generated code should be rebuilt."/>
74 <echo message="Checking:"/>
75 <echo message="${current-project}/${source.root}/**/*.wsdl"/>
76 <echo message="${current-project}/${source.root}/**/*.xsd"/>
77 <echo message="against:"/>
78 <echo message="${current-project}/${dist.file}"/>
79
80 <outofdate verbose="true" property="is-gen-outofdate">
81 <sourcefiles>
82 <fileset dir="${current-project}" casesensitive="no">
83 <patternset>
84 <include name="${source.root}/**/*.wsdl"/>
85 <include name="${source.root}/**/*.xsd"/>
86 </patternset>
87 </fileset>
88 </sourcefiles>
89 <targetfiles path="${current-project}/${dist.file}"/>
90 </outofdate>
91
92 <echo message="It is ${is-gen-outofdate} that the generated code for the following is outofdate '${current-project}'."/>
93
94 <antcall target="clean-gen"/>
95 </target>
96
97 <!--
98 ***** Properties used as params to this target *****
99
100 <property name="project-to-build" value=""/>
101 <property name="target-to-call" value=""/>
102
103 -->
104 <target name="build-project-if-out-of-date" >
105 <condition property="dist.file" value="${sedeployment.jar}" else="${dist.jar}">
106 <isset property="sedeployment.jar" />
107 </condition>
108
109 <echo message="Looking to see if ${project-to-build} should be built."/>
110 <echo message="Checking:"/>
111 <echo message="${project-to-build}/${source.root}/**/*"/>
112 <echo message="against:"/>
113 <echo message="${project-to-build}/${dist.file}"/>
114 <echo message="${javac.classpath}"/>
115
116 <if>
117 <isset property="javac.classpath" />
118 <then>
119
120 <var name="javac.classpath.exists" value="true"/>
121 <for delimiter=":;" list="${javac.classpath}" param="jar.file">
122 <sequential>
123 <if>
124 <length string="@{jar.file}" trim="true" length="1" />
125 <then>
126 </then>
127 <else>
128
129 <available property="@{jar.file}.exists" file="@{jar.file}"/>
130
131 <if>
132 <isset property="@{jar.file}.exists" />
133 <then>
134 <echo message="It is true that this file exists: @{jar.file}."/>
135 </then>
136 <else>
137 <echo message="It is false that this file exists: @{jar.file}."/>
138 <var name="javac.classpath.exists" value="false"/>
139 </else>
140 </if>
141 </else>
142 </if>
143 </sequential>
144 </for>
145
146 <echo message="All the files in javac.classpath exist: ${javac.classpath.exists}."/>
147 </then>
148 <else>
149 <property name="javac.classpath" value=""/>
150 <var name="javac.classpath.exists" value="true"/>
151 <echo message="javac.classpath was not set, setting it to ''."/>
152 </else>
153 </if>
154
155 <if>
156 <equals arg1="${javac.classpath.exists}" arg2="true" />
157 <then>
158 <outofdate verbose="true" force="${outofdate.force}" property="need.build">
159 <sourcefiles>
160 <pathelement path="${javac.classpath}"/>
161 <fileset dir="${project-to-build}" casesensitive="no">
162 <patternset>
163 <include name="${source.root}/**/*"/>
164 </patternset>
165 </fileset>
166 </sourcefiles>
167 <targetfiles path="${project-to-build}/${dist.file}"/>
168 </outofdate>
169 </then>
170 <else>
171 <property name="need.build" value="true"/>
172 </else>
173 </if>
174
175 <if>
176 <equals arg1="${need.build}" arg2="true" />
177 <then>
178 <echo message="Building ${project-to-build}"/>
179 <echo message="Calling target ${target-to-call}"/>
180 <ant
181 dir="${project-to-build}"
182 target="${target-to-call}"
183 inheritall="false"
184 antfile="${project-to-build}/build.xml"
185 />
186 </then>
187 <else>
188 <echo message="No need to build the following project, it is already uptodate: ${project-to-build}"/>
189 </else>
190 </if>
191 </target>
192
193 <!--
194 ***** Properties used as params to this target *****
195
196 <property name="project-to-build" value=""/>
197 <property name="host.output.dir" value=""/>
198
199 -->
200 <target name="process-deps-jar-project">
201 <echoxml file="${ProductDirectory}/temp.xml">
202 <project default="temp">
203 <import file="${ProductDirectory}/build.lib.xml" />
204 <target name="temp">
205 <property name="project-to-build" value="${project-to-build}"/>
206 <property name="target-to-call" value="dist_se"/>
207 <property name="base" value="${project-to-build}/lib"/>
208 <property file="${project-to-build}/lib/nblibraries.properties"/>
209 <property file="${project-to-build}/nbproject/project.properties"/>
210 <antcall
211 target="build-project-if-out-of-date"
212 />
213 </target>
214 </project>
215 </echoxml>
216
217 <ant
218 dir="${project-to-build}"
219 target="temp"
220 inheritall="false"
221 antfile="${ProductDirectory}/temp.xml"
222 />
223
224 <basename property="project.su.name" file="${project-to-build}"/>
225
226 <condition property="dist.file" value="${sedeployment.jar}" else="${dist.jar}">
227 <isset property="sedeployment.jar" />
228 </condition>
229
230 <property name="project.su.dir" value="${host.output.dir}/../jbiServiceUnits/${project.su.name}"/>
231 <mkdir dir="${project.su.dir}"/>
232
233 <outofdate verbose="true">
234 <sourcefiles path="${dist.file}"/>
235 <targetfiles>
236 <fileset dir="${project.su.dir}">
237 <include name="**/*"/>
238 </fileset>
239 </targetfiles>
240 <sequential>
241 <unzip src="${dist.file}" dest="${project.su.dir}">
242 <patternset>
243 <include name="**/*.wsdl"/>
244 <include name="**/*.WSDL"/>
245 <include name="**/*.xsd"/>
246 <include name="**/*.XSD"/>
247 <include name="META-INF/jbi.xml"/>
248 <include name="META-INF/catalog.xml"/>
249 </patternset>
250 </unzip>
251 <touch>
252 <fileset dir="${project.su.dir}"/>
253 </touch>
254 <move file="${project.su.dir}/META-INF/jbi.xml" todir="${project.su.dir}"/>
255 <move todir="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}">
256 <fileset dir="${project.su.dir}/META-INF"/>
257 </move>
258 </sequential>
259 </outofdate>
260 </target>
261
262 <target name="process-list-of-deps-clean-projects">
263 <property name="host.project.dir" location="."/>
264 <xmltask source="${host.project.dir}/nbproject/build-impl.xml">
265 <call path="/project/target[@name='deps-clean']/ant">
266 <param name="ProjectBuildFilePath" path="@antfile"/>
267 <actions>
268
269 <echoxml file="${ProductDirectory}/temp.xml">
270 <project default="temp">
271 <target name="temp">
272 <dirname property="Project.Dir" file="@{ProjectBuildFilePath}"/>
273 <ant
274 target="clean"
275 inheritall="false"
276 antfile="@{ProjectBuildFilePath}"
277 dir="${Project.Dir}"
278 />
279 </target>
280 </project>
281 </echoxml>
282
283 <ant
284 dir="${host.project.dir}"
285 target="temp"
286 inheritall="false"
287 antfile="${ProductDirectory}/temp.xml"
288 />
289 </actions>
290 </call>
291 </xmltask>
292 </target>
293
294 <target name="process-list-of-deps-jar-projects">
295 <property name="host.project.dir" location="."/>
296 <property name="host.output.dir" location="${src.dir}"/>
297
298 <xmltask source="${host.project.dir}/nbproject/build-impl.xml">
299 <call path="/project/target[@name='deps-jar']/basename">
300 <param name="ProjectRef" path="@file"/>
301 <actions>
302
303 <echoxml file="${ProductDirectory}/temp.xml">
304 <project default="temp">
305 <import file="${ProductDirectory}/build.lib.xml" />
306 <target name="temp">
307 <property name="project-to-build" location="${host.project.dir}/@{ProjectRef}"/>
308 <property name="host.project.dir" value="${host.project.dir}"/>
309 <property name="host.output.dir" value="${host.output.dir}"/>
310 <property file="${project-to-build}/nbproject/project.properties"/>
311 <antcall
312 target="process-deps-jar-project"
313 />
314 </target>
315 </project>
316 </echoxml>
317
318 <ant
319 dir="@{ProjectRef}"
320 target="temp"
321 inheritall="false"
322 antfile="${ProductDirectory}/temp.xml"
323 />
324 </actions>
325 </call>
326 </xmltask>
327 </target>
328
329 <target name="process-list-of-deps-javaee-jar-projects">
330 <property name="host.project.dir" location="."/>
331 <property name="host.output.dir" location="${src.dir}"/>
332
333 <xmltask source="${host.project.dir}/nbproject/build-impl.xml">
334 <call path="/project/target[@name='deps-javaee-jar']/basename">
335 <param name="ProjectRef" path="@file"/>
336 <actions>
337
338 <echoxml file="${ProductDirectory}/temp.xml">
339 <project default="temp">
340 <import file="${ProductDirectory}/build.lib.xml" />
341 <target name="temp">
342 <property name="project-to-build" location="${host.project.dir}/@{ProjectRef}"/>
343 <property name="host.project.dir" value="${host.project.dir}"/>
344 <property name="host.output.dir" value="${host.output.dir}"/>
345 <property file="${project-to-build}/nbproject/project.properties"/>
346 <antcall
347 target="process-deps-javaee-jar-project"
348 />
349 </target>
350 </project>
351 </echoxml>
352
353 <ant
354 dir="@{ProjectRef}"
355 target="temp"
356 inheritall="false"
357 antfile="${ProductDirectory}/temp.xml"
358 />
359 </actions>
360 </call>
361 </xmltask>
362 </target>
363
364 <!--
365 ***** Properties used as params to this target *****
366
367 <property name="project-to-build" value=""/>
368 <property name="host.output.dir" value=""/>
369
370 -->
371 <target name="process-deps-javaee-jar-project">
372 <echoxml file="${ProductDirectory}/temp.xml">
373 <project default="temp">
374 <import file="${ProductDirectory}/build.lib.xml" />
375 <target name="temp">
376 <property name="project-to-build" value="${project-to-build}"/>
377 <property name="target-to-call" value="dist"/>
378 <property name="base" value="${project-to-build}/lib"/>
379 <property file="${project-to-build}/lib/nblibraries.properties"/>
380 <property file="${project-to-build}/nbproject/project.properties"/>
381 <antcall
382 target="build-project-if-out-of-date"
383 />
384 </target>
385 </project>
386 </echoxml>
387
388 <ant
389 dir="${project-to-build}"
390 target="temp"
391 inheritall="false"
392 antfile="${ProductDirectory}/temp.xml"
393 />
394
395 <basename property="project.su.name" file="${project-to-build}"/>
396 <property name="project.su.dir" value="${host.output.dir}/../jbiServiceUnits/${project.su.name}"/>
397
398 <condition property="dist.file" value="${sedeployment.jar}" else="${dist.jar}">
399 <isset property="sedeployment.jar" />
400 </condition>
401
402 <mkdir dir="${project.su.dir}"/>
403 <mkdir dir="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}"/>
404
405 <outofdate verbose="true">
406 <sourcefiles path="${dist.file}"/>
407 <targetfiles>
408 <fileset dir="${project.su.dir}">
409 <include name="**/*"/>
410 </fileset>
411 <fileset dir="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}">
412 <include name="catalog.xml"/>
413 </fileset>
414 </targetfiles>
415 <sequential>
416 <unzip src="${dist.file}" dest="${project.su.dir}">
417 <patternset>
418 <include name="**/*.wsdl"/>
419 <include name="**/*.WSDL"/>
420 <include name="**/*.xsd"/>
421 <include name="**/*.XSD"/>
422 <include name="META-INF/jbi.xml"/>
423 </patternset>
424 </unzip>
425
426 <touch>
427 <fileset dir="${project.su.dir}"/>
428 </touch>
429
430 <unzip src="${dist.file}" dest="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}">
431 <patternset>
432 <include name="META-INF/catalog.xml"/>
433 </patternset>
434 </unzip>
435
436 <available
437 property="meta-inf.exists"
438 file="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}/catalog.xml"
439 />
440
441 <if>
442 <equals arg1="${meta-inf.exists}" arg2="true" />
443 <then>
444 <touch file="${host.output.dir}/../jbiServiceUnits/META-INF/${project.su.name}/catalog.xml"/>
445 </then>
446 </if>
447
448 <echoxml file="${ProductDirectory}/temp.xml">
449 <project default="jbi-javaee-dist-part">
450 <target name="jbi-javaee-dist-part">
451 <property file="${host.project.dir}/nbproject/project.properties"/>
452 <property name="project.su.dir" value="${src.dir}/../jbiServiceUnits/${project.su.name}"/>
453 <jbi-javaee-dist
454 projectName="${project.su.name}"
455 subprojJar="${Dollar}{reference.${project.su.name}.dist}"
456 subprojDir="${Dollar}{project.${project.su.name}}"
457 suExtractDir="${Dollar}{project.su.dir}"
458 subprojResource="${Dollar}{resource.${project.su.name}}"
459 />
460 </target>
461 </project>
462 </echoxml>
463
464 <ant
465 dir="${host.project.dir}"
466 target="jbi-javaee-dist-part"
467 inheritall="false"
468 antfile="${ProductDirectory}/temp.xml"
469 />
470 </sequential>
471 </outofdate>
472 </target>
473
474</project>
Note: See TracBrowser for help on using the repository browser.