Statistics
| Revision:

svn-gvsig-desktop / tags / v1_10_0_Build_1260 / applications / appgvSIG / build.xml @ 44118

History | View | Annotate | Download (17.6 KB)

1
<project name="appgvSIG" default="dist" basedir=".">
2
    <description>
3
        gvSIG Main build
4
    </description>
5

    
6
        <import file="../binaries/ant/utilities.xml"/>
7

    
8
        <!--
9
                ============================================
10
                Properties for build of the appgvSIG project
11
                ============================================
12
        -->
13
        <property name="version" value="1.2 ${eclipse.startTime}"/>
14
        <property name="src" location="src"/>
15
        <property name="build" location="bin"/>
16
        <property name="src-test" location="src-test"/>
17
        <property name="build-test" location="bin-test"/>
18
        <property name="dist"  location="dist"/>
19
        <property name="lib"   location="lib"/>
20
        <property name="plugin" value="com.iver.cit.gvsig"/>
21
        <property name="fmapdir" value="../libFMap"/>
22
        <property name="andami" location="../_fwAndami"/>
23
        <property name="extensionDir" location="${andami}/gvSIG/extensiones"/>
24
        <property name="andamiLibs" value="${andami}/lib"/>
25
        <property name="fmapLibs"   location="${fmapdir}/lib"/>
26
        <property name="andamiJar"  value="${andami}/andami.jar"/>
27

    
28
        <!--
29
                ============================================
30
                Properties for global build
31
                ============================================
32
        -->
33

    
34
        <property name="gvSIG_projects" value="
35
                libExceptions,
36
                libInternationalization,
37
                libIverUtiles,
38
                libUIComponent,
39
                _fwAndami,
40
                libCorePlugin,
41
                extDockingSkin,
42
                libProjection,
43
                libRaster,
44
                libDXF,
45
                libDriverManager,
46
                libRemoteServices,
47
                libGDBMS,
48
                libFMap,
49
                libGPE,
50
                libGPE-XML,
51
                libGPE-GML,
52
                libGPE-KML,
53
                appgvSIG,
54
                libJCRS,
55
                extJCRS,
56
                libTopology,
57
                libDwg,
58
                extDwg,
59
                libCacheService,
60
                extSymbology,
61
                extRasterTools-SE,
62
                extAddEventTheme,
63
                extJDBC,
64
                extCAD,
65
                extGPE-gvSIG,
66
                appCatalogAndGazetteerClient,
67
                extCatalogAndGazetteer,
68
                extDataLocator,
69
                extGeoProcessing,
70
                extGeoprocessingExtensions,
71
                extGeoreferencing,
72
                extTopology,
73
                extOracleSpatial,
74
                extSDE,
75
                extScripting,
76
                extAnnotations,
77
                extExpressionField,
78
                extWCS,
79
                extWFS2,
80
                extWMS,
81
                extCenterViewToPoint,
82
                libArcIMS,
83
                extArcims,
84
                extRemoteSensing,
85
                extGraph,
86
                extHelp,
87
                extIconThemeBase,
88
                lib3DMap,
89
                ext3Dgui,
90
                extSextanteGvsigBindings,
91
                extTableSummarize,
92
                extSelectionTools,
93
                extProjectBackup,
94
                extQuickInfo,
95
                extDerivedGeometries,
96
                extHyperlink,
97
                extI18n,
98
                extQuickPrint,
99
                extLayerLoadingOrder,
100
                extTableImport,
101
                extTableExport,
102
                binaries
103
        "/>
104

    
105
        <property name="mandatoryProjets" value="
106
                _fwAndami,
107
                libCorePlugin,
108
                libFMap,
109
                appgvSIG,
110
                extJCRS
111
        "/>
112

    
113
        <property name="global.installBaseDir" location="${andami}"/>
114

    
115
        <property name="JUnitProjectResults" value="JUnitProjectResults"/>
116
        <property name="JUnitProjectResultsFile" value="JUnitProjectResults.txt"/>
117
        <property name="JUnitGlobalResults" location="JUnitGlobalResults"/>
118
        <property name="JUnitGlobalResultsFile" location="JUnitGlobalResults.txt"/>
119
        <property name="JUnitSummaryFile" location="JUnitGlobalResults.txt"/>
120
        <property name="FlagTestError" location="JUnitFlagError"/>
121

    
122
        <!--
123
                ============================================
124
                Targets for build of the appgvSIG project
125
                ============================================
126
        -->
127

    
128
        <target name="init">
129
                <!-- Create the time stamp -->
130
                <tstamp/>
131
                <echo>
132
                        Compiling ${ant.project.name}...</echo>
133

    
134
                <property file="build.number"/>
135
                <!-- Creamos un fichero con el timeStamp para que lo lea el FPanelAbout -->
136
                <!-- <buildnumber/> -->
137
        </target>
138

    
139
        <target name="dist"
140
                                depends="init,create-jar,copy-libs,copy-data-files,move-to-andami"
141
                                description="Generate the distribution of the gvSIG plugin. To build just the appgvSIG project from Eclipse " >
142
                <!-- Create the distribution directory -->
143
        </target>
144

    
145
        <target name="compile" description="compile the source">
146
                <!-- Create the time stamp -->
147
                <tstamp/>
148
                <!-- Create the build directory structure used by compile -->
149
                <mkdir dir="${build}"/>
150
                <!-- Compile the Java code from ${src} to ${build} -->
151
                <loadEclipseClasspath project="${basedir}"/>
152
                <gvSIG-javac
153
                        classpath="${eclipseClasspath}"/>
154

    
155
        </target>
156

    
157
        <target name="create-jar" description="Creates the jar file">
158
                <mkdir dir="${dist}/lib"/>
159
                <jar jarfile="${dist}/lib/${plugin}.jar" basedir="${build}"/>
160
        </target>
161

    
162
        <target name="copy-libs">
163
                <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
164
                <copy todir="${dist}/lib">
165
                        <fileset dir="./lib" includes="*.jar,*.zip"/>
166
                </copy>
167
                <ant dir="../libFMap" target="batch-build" inheritAll="false">
168
                        <property name="debug" value="${debug}"/>
169
                        <property name="debuglevel" value="${debuglevel}"/>
170
                        <property name="encoding" value="ISO_8859_1"/>
171
                </ant>
172
                <copy todir="${dist}/lib">
173
                        <fileset dir="${fmapdir}/dist/lib/" includes="*.jar,*.zip"/>
174
                </copy>
175

    
176
        </target>
177

    
178
        <target name="batch-build"
179
                        description="Global build for the whole gvSIG + extensions. Compiles all the sources and builds the application so that it's ready to execute"
180
                        depends="init,compile,create-jar,copy-libs,copy-data-files,move-to-andami">
181
        </target>
182

    
183
        <target name="copy-data-files">
184
        <copy todir="${dist}">
185
                <fileset dir="config" includes="*" />
186
        </copy>
187
                <copy file="build.number" todir="${dist}"/>
188
                <copy todir="${dist}/images">
189
                        <fileset dir="images/" includes="*"/>
190
                </copy>
191
                <copy todir="${dist}/northimages">
192
                        <fileset dir="northimages/" includes="*"/>
193
                </copy>
194
    </target>
195

    
196
        <target name="move-to-andami" description="Moves the build directory to andami">
197
                <move todir="${extensionDir}/${plugin}/">
198
                        <fileset dir="${dist}" includes="**/**"/>
199
                </move>
200
        </target>
201

    
202
        <target name="clean"
203
                        description="clean up" >
204
                <!-- Delete the ${build} and ${dist} directory trees -->
205
                <delete dir="${build}"/>
206
                <!--<delete dir="${dist}"/> -->
207
        </target>
208

    
209
        <target name="run-tests" depends="batch-build,compile-tests">
210
                <antcall target="generic-run-tests">
211
                        <param name="TestSuite.Name" value="com.iver.cit.gvsig.AllTests"/>
212
                </antcall>
213
        </target>
214

    
215
        <!--
216
                ============================================
217
                Targets for global build
218
                ============================================
219
        -->
220

    
221
        <!-- Public Targets -->
222
        <!-- Comment to use it with debug on
223
        <target name="make-binary-distribution"
224
            description="
225
                                Prepare for do a binary distribution of the application.
226
                                This increments the build number and then makes a global build"
227
            depends="clean-all,buildNumber,build-all-DebugOff">
228
    </target>
229
    -->
230
        <target name="make-binary-distribution"
231
            description="
232
                                Prepare for do a binary distribution of the application.
233
                                This increments the build number and then makes a global build"
234
            depends="clean-all,buildNumber,build-all">
235
    </target>
236

    
237
        <target name="make-binary-distribution-JS1.5_JT1.4"
238
            description="
239
                        Prepare for do a binary distribution of the application.
240
                        This increments the build number and then makes a global build.
241
                        Source Java 1.5 and Target Java 1.4"
242
            depends="clean-all,buildNumber,build-all-JS1.5_JT1.4-DebugOff">
243
    </target>
244

    
245
        <target name="make-binary-distribution-test"
246
            description="
247
                        Prepare for a binary distribution of the application
248
                        without increments the global build number"
249
            depends="clean-all,build-all-DebugOff">
250
    </target>
251

    
252
        <target name="make-binary-distribution-JS1.5_JT1.4-test"
253
            description="
254
                        Prepare for a binary distribution of the application
255
                        without increments the global build number.
256
                        Source Java 1.5 and Target Java 1.4"
257
            depends="clean-all,build-all-JS1.5_JT1.4-DebugOff">
258
    </target>
259

    
260
    <target name="clean_andami_gvSIGdir"
261
            description="clean up the gvSIG andami deploy">
262
        <delete dir="${andami}/gvSIG" failonerror="false"/>
263
    </target>
264

    
265
        <target name="build-all"
266
                description="
267
                        Global build for the whole gvSIG.
268
                        Compiles all the sources and builds the application so that it's ready to execute
269
        ">
270
                <antcall target="build-all-projects">
271
                        <param name="debug" value="on"/>
272
                        <param name="debuglevel" value="lines, vars, source"/>
273
                </antcall>
274
        </target>
275

    
276
        <target name="build-all-DebugOff"
277
                description="
278
                        Global build for the whole gvSIG.
279
                        Compiles all the sources and builds the application so that it's ready to execute.
280
                        Do not generate debug info in complilation.
281
        ">
282
                <antcall target="build-all-projects">
283
                        <param name="debug" value="off"/>
284
                        <param name="debuglevel" value=""/>
285
                </antcall>
286
        </target>
287

    
288
        <target name="build-all-JS1.5_JT1.4"
289
                description="
290
                        Global build for the whole gvSIG.
291
                        Compiles all the sources and builds the application so that it's ready to execute.
292
                        Source Java 1.5 and Target Java 1.4
293
        ">
294
                <antcall target="build-all-projects">
295
                        <param name="JavaSourceVersion" value="1.5"/>
296
                        <param name="JavaTargetVersion" value="jsr14"/>
297
                </antcall>
298
        </target>
299

    
300
        <target name="build-all-JS1.5_JT1.4-DebugOff"
301
                description="
302
                        Global build for the whole gvSIG.
303
                        Compiles all the sources and builds the application so that it's ready to execute.
304
                        Source Java 1.5 and Target Java 1.4.
305
                        Do not generate debug info in complilation.
306
        ">
307
                <antcall target="build-all-projects">
308
                        <param name="JavaSourceVersion" value="1.5"/>
309
                        <param name="JavaTargetVersion" value="jsr14"/>
310
                        <param name="debug" value="off"/>
311
                        <param name="debuglevel" value=""/>
312
                </antcall>
313
        </target>
314

    
315

    
316
        <target name="build-all-projects"
317
                        description="Builds the application, excluding extensions">
318
                <property file="build.number"/>
319
                <foreach list="${gvSIG_projects}" trim="true" delimiter="," target="batch-build-project" param="bb-project.name"/>
320
        </target>
321

    
322
        <target name="clean-all"
323
                                depends="clean_andami_gvSIGdir,clean-all-projects"
324
                                description="clean up application and projets" />
325

    
326
        <target name="clean-all-projects"
327
                description="cleans the base components of gvSIG: appgvSIG + libs">
328
                <!-- Delete the ${build} and ${dist} directory trees -->
329
                <foreach list="${gvSIG_projects}"  trim="true" delimiter="," target="clean-project" param="c-project.name"/>
330
        </target>
331

    
332
        <target name="install-all"
333
                                        depends="install-all-projects"
334
                                        description="Generate jars and copy files to Andami for the whole application (gvSIG+libs+extensions). Compilation is supposed to be automatically done by Eclipse" />
335

    
336
        <target name="install-all-projects"
337
                                description="Generate jars and copy files to Andami for the application (gvSIG+libs). Compilation is supposed to be automatically done by Eclipse" >
338
                <foreach list="${gvSIG_projects}" trim="true"  delimiter="," target="install-project" param="i-project.name"/>
339
        </target>
340

    
341
        <target name="update-all-classpath-files"
342
                                description="Updates the timestamp of all projects.
343
                                        This force eclipse to update jar missing errors.">
344
                <foreach list="${gvSIG_projects}" trim="true"  delimiter="," target="update-proyect-classpath-file" param="u-cp-project.name"/>
345
        </target>
346

    
347

    
348

    
349
        <!-- utility targets -->
350

    
351

    
352
        <target name="buildNumber"
353
                                description="Generates the build.number for the application">
354
                <propertyfile
355
                                file="build.number"
356
                                comment="Build Number for ANT. Do not edit!">
357
                        <entry  key="build.number" default="0" type="int" operation="+" pattern="0000"/>
358
                </propertyfile>
359
        </target>
360

    
361
        <target name="install-project">
362
                <property name="i-project.dir" location="../${i-project.name}"/>
363
                <if>
364
                        <available file="${i-project.dir}" type="dir"/>
365
                        <then>
366
                                <echo>
367
                                        Install ${i-project.name}
368
                                </echo>
369
                                <ant dir="${i-project.dir}" inheritAll="false">
370
                                        <property name="buildNumberFile" location="build.number"/>
371
                                </ant>
372
                        </then>
373
                        <else>
374
                                <if>
375
                                        <contains string="${mandatoryProjets}" substring="${i-project.name}"/>
376
                                        <then>
377
                                                <fail message="The required project is missing for Install: ${i-project.name}"/>
378
                                        </then>
379
                                        <else>
380
                                                <echo>
381
                                                        Skip ${i-project.name} project from Intall
382
                                                </echo>
383
                                        </else>
384
                                </if>
385
                        </else>
386
                </if>
387
        </target>
388

    
389

    
390
        <target name="clean-project">
391
                <property name="c-project.dir" location="../${c-project.name}"/>
392
                <if>
393
                        <available file="${c-project.dir}" type="dir"/>
394
                        <then>
395
                                <echo>
396
                                        Clean ${c-project.name}
397
                                </echo>
398
                                <ant dir="${c-project.dir}" target="clean" inheritAll="false"/>
399
                        </then>
400
                        <else>
401
                                <if>
402
                                        <contains string="${mandatoryProjets}" substring="${c-project.name}"/>
403
                                        <then>
404
                                                <fail message="The required project is missing for Clean: ${c-project.name}"/>
405
                                        </then>
406
                                        <else>
407
                                                <echo>
408
                                                        Skip ${c-project.name} project from Clean
409
                                                </echo>
410
                                        </else>
411
                                </if>
412
                        </else>
413
                </if>
414
        </target>
415

    
416
        <target name="batch-build-project">
417
                <property name="bb-project.dir" location="../${bb-project.name}"/>
418
                <if>
419
                        <available file="${bb-project.dir}" type="dir"/>
420
                        <then>
421
                                <echo>
422
                                        Batch-build ${bb-project.name}
423
                                </echo>
424
                                <ant dir="${bb-project.dir}" target="batch-build" inheritAll="false">
425
                                        <property name="debug" value="${debug}"/>
426
                                        <property name="debuglevel" value="${debuglevel}"/>
427
                                        <property name="encoding" value="${encoding}"/>
428
                                        <property name="JavaSourceVersion" value="${JavaSourceVersion}"/>
429
                                        <property name="JavaTargetVersion" value="${JavaTargetVersion}"/>
430
                                        <property name="buildNumberFile" location="build.number"/>
431
                                </ant>
432
                        </then>
433
                        <else>
434
                                <if>
435
                                        <contains string="${mandatoryProjets}" substring="${bb-project.name}"/>
436
                                        <then>
437
                                                <fail message="The required project is missing for Batch build: ${bb-extension.name}"/>
438
                                        </then>
439
                                        <else>
440
                                                <echo>
441
                                                        Skip ${bb-project.name} project from Batch build
442
                                                </echo>
443
                                        </else>
444
                                </if>
445
                        </else>
446
                </if>
447
        </target>
448

    
449
        <target name="update-proyect-classpath-file">
450
                <property name="u-cp-project.dir" location="../${u-cp-project.name}"/>
451
                <if>
452
                        <available file="${u-cp-project.dir}" type="dir"/>
453
                        <then>
454
                                <if>
455
                                        <available file="${u-cp-project.dir}/.classpath" type="file"/>
456
                                        <then>
457
                                                <touch file="${u-cp-project.dir}/.classpath"/>
458
                                                <echo>
459
                                                        Update classpath file of ${u-cp-project.name}
460
                                                </echo>
461
                                        </then>
462
                                </if>
463
                        </then>
464
                        <else>
465
                                <if>
466
                                        <contains string="${mandatoryProjets}" substring="${u-cp-project.name}"/>
467
                                        <then>
468
                                                <if>
469
                                                        <available file="${u-cp-project.dir}/.classpath" type="file"/>
470
                                                        <then>
471
                                                                <fail message="The required project is missing for Update classpath file: ${u-cp-project.name}"/>
472
                                                        </then>
473
                                                </if>
474
                                        </then>
475
                                        <else>
476
                                                <echo>
477
                                                        Skip ${u-cp-project.name} project from Update classpath file
478
                                                </echo>
479
                                        </else>
480
                                </if>
481
                        </else>
482
                </if>
483
        </target>
484

    
485
        <target name="run-one-test">
486
                <property name="target.project.dir" location="../${target.project.name}"/>
487
                <if>
488
                        <available file="${target.project.dir}" type="dir"/>
489
                        <then>
490
                                <echo>
491
                                        Running tests: ${target.project.dir}
492
                                </echo>
493
                                <trycatch property="AnErrorHappened">
494
                                        <try>
495
                                                <ant dir="${target.project.dir}"
496
                                                        target="run-tests"
497
                                                        inheritAll="false">
498
                                                        <property name="JUnitProjectResults" value="${JUnitProjectResults}"/>
499
                                                        <property name="JUnitProjectResultsFile" value="${JUnitProjectResultsFile}"/>
500
                                                        <property name="JUnitGlobalResults" value="${JUnitGlobalResults}"/>
501
                                                        <property name="JUnitGlobalResultsFile" value="${JUnitGlobalResultsFile}"/>
502
                                                        <property name="JUnitSummaryFile" value="${JUnitSummaryFile}"/>
503
                                                        <property name="buildNumberFile" location="${buildNumberFile}"/>
504
                                                </ant>
505
                                        </try>
506
                                        <catch>
507
                                                <echo        level="error"
508
                                                                append="true"
509
                                                                file="${FlagTestError}">${target.project.name}: ${AnErrorHappened}</echo>
510
                                                <echo level="error">${target.project.name}: ${AnErrorHappened}</echo>
511
                                                <echo append="true" file="${JUnitGlobalResultsFile}">JUnitTests for ${target.project.name}: FAILED.${line.separator}</echo>
512
                                                <echo append="true" file="${target.project.dir}/${JUnitProjectResultsFile}">${AnErrorHappened}</echo>
513
                                        </catch>
514
                                </trycatch>
515
                        </then>
516
                        <else>
517
                                <echo>
518
                                        Skip ${target.project.dir} project from RunTests
519
                                </echo>
520
                                <echo append="true" file="${JUnitGlobalResultsFile}">JUnitTests for ${target.project.name}: SKIPPED.${line.separator}</echo>
521
                        </else>
522
                </if>
523
        </target>
524

    
525
        <target name="run-all-tests">
526
                <delete file="${FlagTestError}" />
527
                <move         file="${JUnitGlobalResultsFile}"
528
                                tofile="${JUnitGlobalResults}.old"
529
                                failonerror="false" />
530
                <property name="buildNumberFile" location="build.number"/>
531
                <foreach        list="${gvSIG_projects}"
532
                                        delimiter=","
533
                                          trim="true"
534
                                        target="run-one-test"
535
                                        param="target.project.name">
536
                                        <param name="buildNumberFile" location="${buildNumberFile}"/>
537
                </foreach>
538

    
539
                <foreach         list="${gvSIG_projects}"
540
                                          trim="true"
541
                                        delimiter=","
542
                                        target="concat-test-output"
543
                                        param="target.project.name" />
544

    
545
                <if>
546
                        <available file="${FlagTestError}" type="file"/>
547
                        <then>
548
                                <echo file="${JUnitGlobalResultsFile}.tmp"> === Global JUnit Results: FAILURE.${line.separator}${line.separator}</echo>
549
                                <concat  destfile="${JUnitGlobalResultsFile}.tmp2"
550
                                                binary="true">
551
                                        <fileset file="${JUnitGlobalResultsFile}.tmp"/>
552
                                        <fileset file="${JUnitGlobalResultsFile}"/>
553
                                </concat>
554
                                <move file="${JUnitGlobalResultsFile}.tmp2" tofile="${JUnitGlobalResultsFile}"/>
555
                                <delete file="${JUnitGlobalResultsFile}.tmp"/>
556
                                <echo level="error">JUnitTests: FAILURE.
557
                                        See ${JUnitGlobalResultsFile} file for details.
558
                                </echo>
559
                        </then>
560
                        <else>
561
                                <echo file="${JUnitGlobalResultsFile}.tmp"> === Global JUnit Results: SUCCESS.${line.separator}${line.separator}</echo>
562
                                <concat  destfile="${JUnitGlobalResultsFile}.tmp2"
563
                                                binary="true">
564
                                        <fileset file="${JUnitGlobalResultsFile}.tmp"/>
565
                                        <fileset file="${JUnitGlobalResultsFile}"/>
566
                                </concat>
567
                                <move file="${JUnitGlobalResultsFile}.tmp2" tofile="${JUnitGlobalResultsFile}"/>
568
                                <delete file="${22JUnitGlobalResultsFile}.tmp"/>
569
                                <echo>JUnitTests: SUCCESS.
570
                                                See ${JUnitGlobalResultsFile} file for details.
571
                                </echo>
572
                        </else>
573
                </if>
574
                <delete file="${FlagTestError}" />
575
        </target>
576

    
577
</project>
578