File: build.xml

package info (click to toggle)
sweethome3d 5.3+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,804 kB
  • ctags: 11,274
  • sloc: java: 99,993; xml: 1,312; makefile: 46; sh: 37; php: 26
file content (1348 lines) | stat: -rw-r--r-- 67,547 bytes parent folder | download
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
<?xml version="1.0"?>
<!-- build.xml

     Sweet Home 3D, Copyright (c) 2007-2016 Emmanuel PUYBARET / eTeks <info@eteks.com>. 
     
     Ant build file. Available targets :
     - build       : Builds SweetHome3D.jar file in build directory
     - application : Builds SweetHome3D.jar file without applet classes in build directory
     - furniture   : Builds Furniture.jar file in build directory
     - textures    : Builds Textures.jar file in build directory
     - help        : Builds Help.jar file in build directory

     - java3dLibraries        : Builds JNLP Java 3D libraries in deploy/lib subdirectories
     - javaWebStart           : Builds Java Web Start signed files in deploy/lib directory
     - applet                 : Builds applet signed files in deploy/lib directory
     - viewer                 : Builds viewer signed files in deploy/lib directory
     - jarExecutable          : Builds SweetHome3D-version.jar file in install directory
     - windowsInstaller       : Builds SweetHome3D-version-windows.exe file in install directory     
     - windowsSignedInstaller : Builds signed SweetHome3D-version-windows.exe file in install directory     
     - macosxInstaller        : Builds SweetHome3D-version-macosx.dmg file in install directory
     - macosxSignedInstaller  : Builds signed SweetHome3D-version-macosx.dmg file in install directory
     - linux32Installer       : Builds SweetHome3D-version-linux-x86.tgz file in install directory
     - linux64Installer       : Builds SweetHome3D-version-linux-x64.tgz file in install directory
     - portableArchive        : Builds SweetHome3D-version-portable files in install/portable directory
     - viewerInstaller        : Builds SweetHome3DViewer-version.zip file in install directory
     - sourceArchive          : Builds SweetHome3D-version-src.zip file in install directory
     - javadoc                : Builds SweetHome3D-version-javadoc.zip file install directory 
     
     - jdepend : Launchs a JDepend graphical UI to help update dependencies in PackageDependenciesTest 
-->
<project basedir="." default="jarExecutable" name="SweetHome3D">
  <!-- The current version of Sweet Home 3D -->
  <property name="version" value="5.3"/>

  <target name="build" 
          description="Builds build/SweetHome3D.jar with all its classes">
    <!-- Compile Sweet Home 3D -->
    <mkdir dir="build/classes"/>
    <!-- Compile Sweet Home 3D applets first with javac 1.1 to be able to detect current Java version
         during applet launch (otherwise Java 1.1 to 1.4 plug-ins refuse to load Applet class) -->
    <javac srcdir="src" destdir="build/classes"
           includes="com/eteks/sweethome3d/applet/SweetHome3D*.java"
           encoding="ISO-8859-1" target="1.1" source="1.2"
           debug="false" debuglevel="lines,vars,source"/>      
    <!-- Compile other classes -->
    <javac srcdir="src" destdir="build/classes"
           encoding="ISO-8859-1" target="1.5" source="1.5"
           debug="false" debuglevel="lines,vars,source">
      <!-- Use lib as an extension directory to override default Java 3D libraries -->
      <extdirs>
        <pathelement location="/usr/share/java"/>
        <pathelement location="/usr/share/icedtea-web"/>
      </extdirs>
      <classpath>
        <pathelement location="libtest/AppleJavaExtensions.jar"/>
        <pathelement location="libtest/jnlp.jar"/>
      </classpath>
	<exclude name="com/eteks/sweethome3d/MacOSXConfiguration.java"/>
	<exclude name="com/eteks/sweethome3d/swing/VideoPanel.java"/>
	<exclude name="com/eteks/sweethome3d/viewcontroller/VideoController.java"/>
    </javac>
    
    <!-- Copy resources excepted furniture, textures and help files -->
    <copy todir="build/classes">
      <fileset dir="src">
        <include name="**"/>
        <exclude name="**/*.java"/>
        <exclude name="**/package.html"/> 
        <exclude name="com/eteks/sweethome3d/io/*Catalog*.properties"/>
        <exclude name="com/eteks/sweethome3d/io/resources/**"/>
        <exclude name="**/help/**"/> 
      </fileset>
      <fileset dir="src">
        <include name="com/eteks/sweethome3d/io/resources/patterns/**"/>
      </fileset>
    </copy>
    
    <!-- Create SweetHome3D.jar -->
    <zip destfile="build/SweetHome3D.jar" 
         basedir="build/classes"/>
    <delete dir="build/classes"/>
  </target>

  <target name="application" depends="build"
          description="Builds build/SweetHome3D.jar application with all its classes">
    <zip destfile="build/SweetHome3DStandalone.jar">
      <zipfileset src="build/SweetHome3D.jar" 
                  excludes="com/eteks/sweethome3d/applet/**"/>
    </zip>
    <move file="build/SweetHome3DStandalone.jar" tofile="build/SweetHome3D.jar"/>
  </target>

  <target name="furniture"
          description="Builds build/Furniture.jar that contains the furniture files">
    <mkdir dir="build"/>
    <zip destfile="build/Furniture.jar" basedir="src">
      <include name="com/eteks/sweethome3d/io/*FurnitureCatalog*.properties"/>
      <include name="com/eteks/sweethome3d/io/resources/**"/>
      <exclude name="com/eteks/sweethome3d/io/*ContributedFurnitureCatalog*.properties"/>
      <exclude name="com/eteks/sweethome3d/io/resources/textures/**"/>
      <exclude name="com/eteks/sweethome3d/io/resources/patterns/**"/>
    </zip>
  </target>

  <target name="textures"
          description="Builds build/Textures.jar that contains the textures files">
    <mkdir dir="build"/>
    <zip destfile="build/Textures.jar" basedir="src">
      <include name="com/eteks/sweethome3d/io/*TexturesCatalog*.properties"/>
      <include name="com/eteks/sweethome3d/io/resources/textures/**"/>
    </zip>
  </target>

  <target name="help"
          description="Builds build/Help.jar that contains the help files">
    <mkdir dir="build"/>
    <zip destfile="build/Help.jar" basedir="src">
      <include name="**/help/**"/>
    </zip>
  </target>

  <target name="jogl-java3d"
          description="Builds jogl-java3d.jar that contains only packages required for Java 3D">
    <mkdir dir="build"/>
    <zip destfile="build/java3d-1.6/jogl-java3d.jar">
      <zipfileset src="lib/java3d-1.6/jogl-all.jar"  
        excludes="com/jogamp/graph/**, com/jogamp/newt/**, com/jogamp/opengl/swt/**, com/jogamp/opengl/util/**,
                  javax/media/opengl/Debug*, javax/media/opengl/Trace*,
                  jogamp/graph/**, jogamp/newt/**, jogl/util/data/av/**"/>
      <zipfileset src="lib/java3d-1.6/jogl-all.jar"  
        includes="com/jogamp/opengl/util/GLBuffers.class"/>
    </zip>
  </target>

  <target name="manifest"
          description="Builds build/META-INF/MANIFEST.MF with security attributes">
    <mkdir dir="build/META-INF"/>
    <manifest file="build/META-INF/MANIFEST.MF">
      <attribute name="Permissions"               value="all-permissions"/>
      <attribute name="Codebase"                  value="*"/>
      <attribute name="Caller-Allowable-Codebase" value="*"/>
    </manifest>
  </target>

  <target name="java3dLibraries" depends="jogl-java3d,manifest"
          description="Builds JNLP Java 3D libraries in deploy/lib subdirectories">
    <!-- Create java3d.jar containing Windows 32 bit Java 3D DLLs and jars -->
    <mkdir dir="deploy/lib/windows/i386"/>
    <jar destfile="deploy/lib/windows/i386/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="java3d-1.6/windows/i586/*.dll"/>
      </fileset>
    </jar>

    <!-- Create java3d.jar containing Windows 64 bit Java 3D DLLs and jars -->
    <mkdir dir="deploy/lib/windows/x64"/>
    <jar destfile="deploy/lib/windows/x64/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="java3d-1.6/windows/amd64/*.dll"/>
      </fileset>
    </jar>

    <!-- Create java3d.jar containing Linux 32 bit Java 3D DLLs and jars -->
    <mkdir dir="deploy/lib/linux/i386"/>
    <jar destfile="deploy/lib/linux/i386/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="java3d-1.6/linux/i586/*.so"/>
      </fileset>
    </jar>
 
    <!-- Create java3d.jar containing Linux 64 bit Java 3D DLLs and jars -->
    <mkdir dir="deploy/lib/linux/x64"/>
    <jar destfile="deploy/lib/linux/x64/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="java3d-1.6/linux/amd64/*.so"/>
      </fileset>
    </jar>
 
    <!-- Create java3d.jar containing Mac OS X Java 3D DLLs and jars -->
    <mkdir dir="deploy/lib/macosx"/>
    <jar destfile="deploy/lib/macosx/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="j3dcore.jar"/>
        <include name="j3dutils.jar"/>
        <include name="vecmath.jar"/>
        <include name="macosx/*.jar"/>
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="macosx/*.jnilib"/>
        <include name="java3d-1.6/macosx/*.jnilib"/>
      </fileset>
    </jar>
  </target>

  <target name="java3dAllSystemsLibrary" depends="jogl-java3d"
          description="Builds applet Java 3D library suitable for all systems in deploy/lib subdirectory">
    <mkdir dir="deploy/lib"/>
    <!-- Create java3d.jar containing Java 3D DLLs and jars for Windows, Linux and Mac OS X 
         (this library is used for Java versions older than Java SE 6 update 10) -->
    <jar destfile="deploy/lib/java3d.jar" manifest="build/META-INF/MANIFEST.MF">
      <fileset dir="lib">
        <include name="j3dcore.jar"/>
        <include name="j3dutils.jar"/>
        <include name="vecmath.jar"/>
        <include name="macosx/*.jar"/>
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="java3d-1.6/windows/**/*.dll"/>
        <include name="java3d-1.6/linux/**/*.so"/>
        <include name="macosx/*.jnilib"/>
        <include name="java3d-1.6/macosx/*.jnilib"/>
      </fileset>
    </jar>
  </target>

  <target name="viewerLibraries"
          description="Copies to deploy/lib the base libraries used by Sweet Home 3D Viewer">
    <mkdir dir="deploy/lib"/>
    <!-- Copy jar files adding to their manifest security attributes 
         (these attributes are necessary to be able to call applet methods from JavaScript) -->
    <jar destfile="deploy/lib/batik-svgpathparser-1.7.jar">
      <manifest>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <attribute name="Caller-Allowable-Codebase" value="*"/>
      </manifest>
      <zipfileset src="lib/batik-svgpathparser-1.7.jar"/>
    </jar>
    <!-- No Print to PDF, Export to SVG, Export to PNG and Create video in viewer -->
  </target>

  <target name="otherLibraries" depends="viewerLibraries"
          description="Copies to deploy/lib the libraries used by Sweet Home 3D">
    <mkdir dir="deploy/lib"/>
    <!-- Copy jar files adding to their manifest attributes necessary 
         to be able to call applet methods from JavaScript -->
    <jar destfile="deploy/lib/freehep-vectorgraphics-svg-2.1.1b.jar" filesetmanifest="merge">
      <manifest>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <attribute name="Caller-Allowable-Codebase" value="*"/>
      </manifest>
      <zipfileset src="lib/freehep-vectorgraphics-svg-2.1.1b.jar"/>
    </jar>
    <jar destfile="deploy/lib/sunflow-0.07.3i.jar" filesetmanifest="merge">
      <manifest>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <attribute name="Caller-Allowable-Codebase" value="*"/>
      </manifest>
      <zipfileset src="lib/sunflow-0.07.3i.jar"/>
    </jar>
    <jar destfile="deploy/lib/iText-2.1.7.jar" filesetmanifest="merge">
      <manifest>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <attribute name="Caller-Allowable-Codebase" value="*"/>
      </manifest>
      <zipfileset src="lib/iText-2.1.7.jar"/>
    </jar>
    <jar destfile="deploy/lib/jmf.jar">
      <manifest>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <attribute name="Caller-Allowable-Codebase" value="*"/>
      </manifest>
      <zipfileset src="lib/jmf.jar"/>
    </jar>
  </target>

  <target name="javaWebStart" depends="application,furniture,textures,help,java3dLibraries,otherLibraries,manifest"
          description="Builds deploy/lib/SweetHome3D.jar and signs jars required by Sweet Home 3D with Java Web Start">
    <!-- Build SweetHome3DJavaWebStart.jar file containing signed JNLP file -->
    <mkdir dir="build/JNLP-INF"/>
    <copy file="deploy/SweetHome3D.jnlp" tofile="build/JNLP-INF/APPLICATION.JNLP"/>
    <mkdir dir="deploy/lib"/>
    <jar destfile="deploy/lib/SweetHome3DJavaWebStart.jar" manifest="build/META-INF/MANIFEST.MF" filesetmanifest="merge">
      <manifest>
        <attribute name="Application-Name" value="Sweet Home 3D"/>
      </manifest>
      <fileset dir="build" includes="JNLP-INF/APPLICATION.JNLP"/>
    </jar>
    <!-- Build SweetHome3D.jar file from the content of built jars -->
    <jar destfile="deploy/lib/SweetHome3D.jar" manifest="build/META-INF/MANIFEST.MF" filesetmanifest="merge">
      <manifest>
        <attribute name="Application-Name" value="Sweet Home 3D"/>
      </manifest>
      <zipfileset src="build/SweetHome3D.jar"/>
      <zipfileset src="build/Furniture.jar"/>
      <zipfileset src="build/Textures.jar"/>
      <zipfileset src="build/Help.jar"/>
    </jar>

    <!-- Clean build directory -->
    <delete dir="build"/> 
    
    <input message="Enter Passphrase for keystore:" addproperty="password"/> 
    <!-- Sign jar files in deploy/lib dir -->
    <signjar keystore="keys.p12" alias="sweethome3d" storepass="${password}" storetype="pkcs12">
      <fileset dir="deploy/lib">
        <include name="**/*.jar"/>
      </fileset>
    </signjar>

    <echo message="deploy dir ready for ftp"/>
  </target>

  <target name="applet" depends="build,java3dLibraries,java3dAllSystemsLibrary,otherLibraries"
          description="Builds deploy/lib/SweetHome3DApplet.jar and signs jars required by Sweet Home 3D applet">
    <!-- Create SweetHome3DApplet.jar containing Sweet Home 3D classes and resources -->
    <mkdir dir="deploy/lib"/>
    <copy file="deploy/SweetHome3DApplet.jnlp" tofile="build/JNLP-INF/APPLICATION.JNLP"/>
    <input message="Enter domain name where applet will be hosted:" addproperty="domain"/> 
    <jar destfile="deploy/lib/SweetHome3DApplet.jar">
      <manifest>
        <attribute name="Application-Name"          value="Sweet Home 3D Online"/>
        <attribute name="Permissions"               value="all-permissions"/>
        <attribute name="Codebase"                  value="*"/>
        <!-- From Java 7u55, specifying domain is mandatory to call applet methods from JavaScript 
             without security warning -->
        <attribute name="Caller-Allowable-Codebase" value="${domain}"/>
      </manifest>
      <fileset dir="build" includes="JNLP-INF/APPLICATION.JNLP"/>
      <zipfileset src="build/SweetHome3D.jar" 
                  excludes="com/eteks/sweethome3d/*.*, com/eteks/sweethome3d/resources/**, com/eteks/sweethome3d/applet/*Viewer*.*"/>
    </jar>
 
    <!-- Clean build directory -->
    <delete dir="build"/>

    <input message="Enter Passphrase for keystore:" addproperty="password"/> 
    <!-- Sign jar files in deploy/lib dir -->
    <signjar keystore="keys.p12" alias="SweetHome3D" storepass="${password}" storetype="pkcs12">
      <fileset dir="deploy/lib">
        <include name="**/*.jar"/>
      </fileset>
    </signjar>

    <echo message="deploy dir ready for ftp"/>
  </target>

  <target name="viewer" depends="java3dLibraries,java3dAllSystemsLibrary,viewerLibraries,manifest"
          description="Builds deploy/lib/SweetHome3DViewer.jar and signs jars required by Sweet Home 3D viewer">
    <!-- Compile Sweet Home 3D Viewer-->
    <mkdir dir="build/classes"/>
    <!-- Compile Sweet Home 3D Viewer applet first with javac 1.1 to be able to detect current Java version
         during applet launch (otherwise Java 1.1 to 1.4 plug-ins refuse to load Applet class) -->
    <javac srcdir="src" destdir="build/classes"
           includes="com/eteks/sweethome3d/applet/SweetHome3DViewer.java"
           encoding="ISO-8859-1" target="1.1" source="1.2"
           debug="false" debuglevel="lines,vars,source"/>      
    <!-- Compile only classes depending on ViewerHelper to reduce Jar size -->
    <javac srcdir="src" destdir="build/classes"
           encoding="ISO-8859-1" target="1.5" 
           debug="false" debuglevel="lines,vars,source">
      <include name="com/eteks/sweethome3d/applet/ViewerHelper.java"/>
      <include name="com/eteks/sweethome3d/io/DefaultPatternTexture.java"/>
      <!-- Use lib as an extension directory to override default Java 3D libraries -->
      <extdirs>
        <pathelement location="lib"/>
      </extdirs>
      <classpath>
        <pathelement location="libtest/AppleJavaExtensions.jar"/>
        <pathelement location="libtest/jnlp.jar"/>
      </classpath>
    </javac>
    
    <!-- Copy only resources used by viewer -->
    <copy todir="build/classes">
      <fileset dir="src">
        <include name="com/eteks/sweethome3d/applet/*.properties"/>
        <include name="com/eteks/sweethome3d/model/*.properties"/>
        <include name="com/eteks/sweethome3d/tools/*.properties"/>
        <include name="com/eteks/sweethome3d/io/resources/patterns/*.png"/>
        <include name="com/eteks/sweethome3d/swing/resources/icons/tango/go-*.png"/>
        <include name="com/eteks/sweethome3d/swing/HomeComponent3D.properties"/>
      </fileset>
    </copy>
    
    <!-- Create SweetHome3DViewer.jar containing only classes and resources required by Sweet Home 3D Viewer -->
    <mkdir dir="deploy/lib"/>
    <copy file="deploy/SweetHome3DViewer.jnlp" tofile="build/JNLP-INF/APPLICATION.JNLP"/>
    <jar destfile="deploy/lib/SweetHome3DViewer.jar" 
         basedir="build/classes" manifest="build/META-INF/MANIFEST.MF" filesetmanifest="merge">
      <manifest>
        <attribute name="Application-Name" value="Sweet Home 3D Viewer"/>
      </manifest>
      <fileset dir="build" includes="JNLP-INF/APPLICATION.JNLP"/>
      <include name="com/eteks/sweethome3d/applet/*"/>
      <include name="com/eteks/sweethome3d/io/**"/>
      <include name="com/eteks/sweethome3d/j3d/*"/>
      <include name="com/eteks/sweethome3d/model/*"/>
      <include name="com/eteks/sweethome3d/swing/**"/>
      <include name="com/eteks/sweethome3d/tools/*"/>
      <include name="com/eteks/sweethome3d/viewcontroller/*View*"/>      
      <include name="com/eteks/sweethome3d/viewcontroller/Controller.*"/>      
      <include name="com/eteks/sweethome3d/viewcontroller/ContentManager*"/>      
      <include name="com/eteks/sweethome3d/viewcontroller/HomeController3D*"/>      
      <include name="com/eteks/sweethome3d/viewcontroller/Object3DFactory*"/>      
      <include name="com/eteks/sweethome3d/viewcontroller/ThreadedTaskController*"/>      
    </jar>
 
    <!-- Clean build directory -->
    <delete dir="build"/>

    <input message="Enter Passphrase for keystore:" addproperty="password"/> 
    <!-- Sign jar files in deploy/lib dir -->
    <signjar keystore="keys.p12" alias="SweetHome3D" storepass="${password}" storetype="pkcs12">
      <fileset dir="deploy/lib">
        <include name="**/*.jar"/>
      </fileset>
    </signjar>

    <echo message="deploy dir ready for ftp"/>
  </target>

  <target name="jarExecutable" depends="application,furniture,textures,help"
          description="Builds install/SweetHome3D-version.jar executable Jar">
    <!-- Create SweetHome3D-version.jar containing Sweet Home 3D classes and resources,
         and other DLLs and jars -->
    <jar destfile="install/SweetHome3D-${version}.jar">
      <manifest>
        <attribute name="Main-Class" value="com.eteks.sweethome3d.SweetHome3DBootstrap"/>
        <attribute name="Class-Path" value="/usr/share/java/j3dcore.jar /usr/share/java/j3dutils.jar /usr/share/java/vecmath.jar /usr/share/java/sunflow.jar /usr/share/java/itext.jar /usr/share/java/janino.jar /usr/share/java/freehep-util.jar /usr/share/java/freehep-io.jar /usr/share/java/freehep-xml.jar /usr/share/java/freehep-graphics2d.jar /usr/share/java/freehep-graphicsio.jar /usr/share/java/freehep-graphicsio-svg.jar /usr/share/icedtea-web/netx.jar /usr/lib/jvm/java-6-sun/jre/lib/javaws.jar"/>
      </manifest>
      <zipfileset src="build/SweetHome3D.jar"/>
      <zipfileset src="build/Furniture.jar"/>
      <zipfileset src="build/Textures.jar"/>
      <zipfileset src="build/Help.jar"/>
      <fileset dir="lib">
        <include name="*.jar"/>
        <include name="macosx/*.jar"/>
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
      <fileset dir="lib">
        <include name="windows/**/*.dll"/>
        <include name="java3d-1.6/windows/**/*.dll"/>
        <include name="linux/**/*.so"/>
        <include name="java3d-1.6/linux/**/*.so"/>
        <include name="macosx/*.jnilib"/>
        <include name="java3d-1.6/macosx/*.jnilib"/>
      </fileset>
      <fileset dir="libtest">
        <include name="jnlp.jar"/>
      </fileset>
      <fileset dir=".">
        <include name="LICENSE.TXT"/>
        <include name="COPYING.TXT"/>
        <include name="THIRDPARTY-LICENSE-JAVA3D.TXT"/>
        <include name="THIRDPARTY-LICENSE-BATIK.TXT"/>
        <include name="THIRDPARTY-LICENSE-ITEXT.TXT"/>
        <include name="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT"/>
        <include name="THIRDPARTY-LICENSE-SUNFLOW.TXT"/>
        <include name="THIRDPARTY-LICENSE-JMF.HTML"/>
        <include name="THIRDPARTY-LICENSE-TANGO.TXT"/>
        <include name="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"/>
      </fileset>
    </jar>
 
    <!-- Clean build directory -->
    <delete dir="build"/>

    <echo message="install/SweetHome3D-${version}.jar ready for ftp"/>
  </target>

  <!-- Builds Sweet Home 3D Windows launcher in install/windows/build directory.
       CAUTION : May be run only under Windows 64 bit and requires Windows 32 bit JRE, 
                 64 bit JRE and launch4j installed in their default location -->
  <target name="windowsLauncher" depends="application,furniture,textures,help,jogl-java3d"
          description="Builds Sweet Home 3D Windows launcher">
    <!-- Copy SweetHome3D JARs and Windows Java 3D DLLs and JARs for Java 3D 
         to install/windows/build/lib -->
    <mkdir dir="install/windows/build/lib/java3d-1.6/x86"/>
    <move file="build/SweetHome3D.jar" todir="install/windows/build/lib" />
    <move file="build/Furniture.jar"   todir="install/windows/build/lib" />
    <move file="build/Textures.jar"    todir="install/windows/build/lib" />
    <move file="build/Help.jar"        todir="install/windows/build/lib" />
    <copy todir="install/windows/build/lib" >
      <fileset dir="lib">
        <include name="*.jar"/>
        <include name="java3d-1.6/*.jar"/>
        <exclude name="j3dcore.jar"/>
        <exclude name="j3dutils.jar"/>
        <exclude name="vecmath.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
    </copy>
    <copy todir="install/windows/build/lib/java3d-1.6/x86" >
      <fileset dir="lib/java3d-1.6/windows/i586">
        <include name="*.dll"/>
      </fileset>
    </copy>
    <mkdir dir="install/windows/build/lib/java3d-1.6/x64"/>
    <copy todir="install/windows/build/lib/java3d-1.6/x64" >
      <fileset dir="lib/java3d-1.6/windows/amd64">
        <include name="*.dll"/>
      </fileset>
    </copy>
    <!-- Copy COPYING.TXT and licenses texts to install/windows/build/ -->
    <copy file="COPYING.TXT" todir="install/windows/build"/>
    <copy file="LICENSE.TXT" todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-JAVA.TXT"      todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-JAVA3D.TXT"    todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-BATIK.TXT"     todir="install/windows/build"/>
    <copy file="THIRDPARTY-LICENSE-ITEXT.TXT"     todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT"  todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-SUNFLOW.TXT"   todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-JMF.HTML"      todir="install/windows/build"/>
    <copy file="THIRDPARTY-LICENSE-LAUNCH4J.TXT"  todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-INNOSETUP.TXT" todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-TANGO.TXT"     todir="install/windows/build" />
    <copy file="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT" todir="install/windows/build" />
  
    <!-- Copy 32 bit JRE to install/windows/build/jre/x86... excluding files mentioned 
         in JRE README.TXT file (JRE bin/javaw.exe command excepted) -->
    <copy todir="install/windows/build/jre8/x86">
      <fileset dir="C:\Program Files (x86)\Java\jre1.8.0_51">
        <include name="*"/>
        <include name="bin/**"/>
        <include name="lib/**"/>

        <exclude name="lib/ext/sunjce_provider.jar"/>
        <exclude name="lib/ext/sunec.jar"/>
        <exclude name="lib/ext/sunpkcs11.jar"/>
        <exclude name="bin/rmid.exe"/>
        <exclude name="bin/rmiregistry.exe"/>
        <exclude name="bin/tnameserv.exe"/>
        <exclude name="bin/keytool.exe"/>
        <exclude name="bin/kinit.exe"/>
        <exclude name="bin/klist.exe"/>
        <exclude name="bin/ktab.exe"/>
        <exclude name="bin/policytool.exe"/>
        <exclude name="bin/orbd.exe"/>
        <exclude name="bin/servertool.exe"/>
        <exclude name="lib/jfr/**"/>
        <exclude name="lib/jfr.jar"/>

        <exclude name="bin/java.exe"/>
        <exclude name="bin/javaws.exe"/>
        <exclude name="bin/javacpl.exe"/>
        <exclude name="bin/jucheck.exe"/>
        <exclude name="bin/dtplugin/**"/>
        <exclude name="bin/jabswitch.exe"/>
        <exclude name="bin/java_crw_demo.dll"/>
        <exclude name="bin/JavaAccessBridge-32.dll"/>
        <exclude name="bin/JAWTAccessBridge-32.dll"/>
        <exclude name="bin/WindowsAccessBridge-32.dll"/>
        <exclude name="bin/wsdetect.dll"/>
        <exclude name="bin/plugin2/**"/>        
        <exclude name="bin/deploy.dll"/>
        <exclude name="bin/jfr.dll"/>
        <exclude name="bin/javacpl.dll"/>
        <exclude name="lib/deploy.jar"/>
        <exclude name="lib/plugin.jar"/>
        <exclude name="lib/deploy/**"/>
      	<exclude name="lib/cmm/PYCC.pf"/>
        <!-- No need of JavaFX support -->
        <exclude name="THIRDPARTYLICENSEREADME-JAVAFX.txt"/>
        <exclude name="lib/javafx.properties"/>
      	<exclude name="lib/jfxswt.jar"/>
      	<exclude name="bin/decora_sse.dll"/>
      	<exclude name="bin/fxplugins.dll"/>
      	<exclude name="bin/glass.dll"/>
      	<exclude name="bin/glib-lite.dll"/>
      	<exclude name="bin/gstreamer-lite.dll"/>
      	<exclude name="bin/javafx_font.dll"/>
      	<exclude name="bin/javafx_font_t2k.dll"/>
      	<exclude name="bin/javafx_iio.dll"/>
      	<exclude name="bin/jfxmedia.dll"/>
      	<exclude name="bin/jfxwebkit.dll"/>
      	<exclude name="bin/prism_common.dll"/>
      	<exclude name="bin/prism_d3d.dll"/>
      	<exclude name="bin/prism_es2.dll"/>
      	<exclude name="bin/prism_sw.dll"/>
      	<exclude name="lib/ext/jfxrt.jar"/>
        <exclude name="lib/ext/nashorn.jar"/>
      </fileset>
    </copy>

    <!-- Copy 64 bit JRE to install/windows/build/jre/x64... excluding files mentioned 
         in JRE README.TXT file (JRE bin/javaw.exe command excepted) -->
    <copy todir="install/windows/build/jre8/x64">
      <fileset dir="C:\Program Files\Java\jre1.8.0_51">
        <include name="*"/>
        <include name="bin/**"/>
        <include name="lib/**"/>

        <exclude name="lib/ext/sunjce_provider.jar"/>
        <exclude name="lib/ext/sunec.jar"/>
        <exclude name="lib/ext/sunpkcs11.jar"/>
        <exclude name="bin/rmid.exe"/>
        <exclude name="bin/rmiregistry.exe"/>
        <exclude name="bin/tnameserv.exe"/>
        <exclude name="bin/keytool.exe"/>
        <exclude name="bin/kinit.exe"/>
        <exclude name="bin/klist.exe"/>
        <exclude name="bin/ktab.exe"/>
        <exclude name="bin/policytool.exe"/>
        <exclude name="bin/orbd.exe"/>
        <exclude name="bin/servertool.exe"/>
        <exclude name="lib/jfr/**"/>
        <exclude name="lib/jfr.jar"/>

        <exclude name="bin/java.exe"/>
        <exclude name="bin/javaws.exe"/>
        <exclude name="bin/javacpl.exe"/>
        <exclude name="bin/jucheck.exe"/>
        <exclude name="bin/dtplugin/**"/>
        <exclude name="bin/jabswitch.exe"/>
        <exclude name="bin/java_crw_demo.dll"/>
        <exclude name="bin/JavaAccessBridge-64.dll"/>
        <exclude name="bin/JAWTAccessBridge-64.dll"/>
        <exclude name="bin/WindowsAccessBridge-64.dll"/>
        <exclude name="bin/wsdetect.dll"/>
        <exclude name="bin/plugin2/**"/>
        <exclude name="bin/deploy.dll"/>
        <exclude name="bin/jfr.dll"/>
        <exclude name="bin/javacpl.dll"/>
        <exclude name="lib/deploy.jar"/>
        <exclude name="lib/plugin.jar"/>
        <exclude name="lib/deploy/**"/>
      	<exclude name="lib/cmm/PYCC.pf"/>
        <!-- No need of JavaFX support -->
        <exclude name="THIRDPARTYLICENSEREADME-JAVAFX.txt"/>
        <exclude name="lib/javafx.properties"/>
      	<exclude name="lib/jfxswt.jar"/>
      	<exclude name="bin/decora_sse.dll"/>
      	<exclude name="bin/fxplugins.dll"/>
      	<exclude name="bin/glass.dll"/>
      	<exclude name="bin/glib-lite.dll"/>
      	<exclude name="bin/gstreamer-lite.dll"/>
      	<exclude name="bin/javafx_font.dll"/>
      	<exclude name="bin/javafx_font_t2k.dll"/>
      	<exclude name="bin/javafx_iio.dll"/>
      	<exclude name="bin/jfxmedia.dll"/>
      	<exclude name="bin/jfxwebkit.dll"/>
      	<exclude name="bin/prism_common.dll"/>
      	<exclude name="bin/prism_d3d.dll"/>
      	<exclude name="bin/prism_es2.dll"/>
      	<exclude name="bin/prism_sw.dll"/>
      	<exclude name="lib/ext/jfxrt.jar"/>
        <exclude name="lib/ext/nashorn.jar"/>
      </fileset>
    </copy>

    <!-- Create SweetHome3D-x86.exe and SweetHome3D-x64.exe with launch4j -->
    <exec executable="C:\Program Files (x86)\Launch4j\launch4jc.exe" failonerror="yes">
      <arg value="${basedir}\install\windows\installerLaunch4j-x86.xml"/>
    </exec>
    <exec executable="C:\Program Files (x86)\Launch4j\launch4jc.exe" failonerror="yes">
      <arg value="${basedir}\install\windows\installerLaunch4j-x64.xml"/>
    </exec>

    <!-- Pack largest jars -->
    <exec executable="C:\Program Files\Java\jre1.8.0_51\bin\pack200.exe" failonerror="yes">
      <arg value="${basedir}\install\windows\build\lib\SweetHome3D.pack.gz"/>
      <arg value="${basedir}\install\windows\build\lib\SweetHome3D.jar"/>
    </exec>
    <delete file="${basedir}\install\windows\build\lib\SweetHome3D.jar"/>

    <exec executable="C:\Program Files\Java\jre1.8.0_51\bin\pack200.exe" failonerror="yes">
      <arg value="-J-Xmx512m"/>
      <arg value="${basedir}\install\windows\build\jre8\x86\lib\rt.pack.gz"/>
      <arg value="${basedir}\install\windows\build\jre8\x86\lib\rt.jar"/>
    </exec>
    <delete file="${basedir}\install\windows\build\jre8\x86\lib\rt.jar"/>

    <exec executable="C:\Program Files\Java\jre1.8.0_51\bin\pack200.exe" failonerror="yes">
      <arg value="-J-Xmx512m"/>
      <arg value="${basedir}\install\windows\build\jre8\x64\lib\rt.pack.gz"/>
      <arg value="${basedir}\install\windows\build\jre8\x64\lib\rt.jar"/>
    </exec>
    <delete file="${basedir}\install\windows\build\jre8\x64\lib\rt.jar"/>
  </target>

  <!-- Builds install/SweetHome3D-version-windows.exe installer able to install SweetHome3D.exe 
       with a Windows JRE and Sweet Home 3D libraries.
       CAUTION : May be run only under Windows 64 bit and requires Windows 32 bit JRE, 64 bit JRE, 
                 launch4j and Inno Setup installed in their default location -->
  <target name="windowsInstaller" depends="windowsLauncher"
          description="Builds install/SweetHome3D-version-windows.exe installer">
    <!-- Create SweetHome3D-version-windows.exe with Inno Setup -->
    <exec executable="C:\Program Files (x86)\Inno Setup 5\ISCC.exe" failonerror="yes">
      <arg value="${basedir}\install\windows\installerInnoSetup.iss"/>
    </exec>  

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/windows/build"/>

    <echo message="install/SweetHome3D-${version}-windows.exe ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-windows.exe signed installer able to install SweetHome3D.exe 
       with a Windows JRE and Sweet Home 3D libraries.
       CAUTION : May be run only under Windows 64 bit and requires Windows 32 bit JRE, 64 bit JRE, 
                 launch4j, Inno Setup and SignTool included in Windows platform SDK 
                 installed in their default location -->
  <target name="windowsSignedInstaller" depends="windowsLauncher"
          description="Builds install/SweetHome3D-version-windows.exe installer">
    <input message="Enter signature password:" addproperty="password"/> 
    <!-- Sign Sweet Home 3D launchers -->
    <exec executable="C:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe" failonerror="yes">
      <arg value="sign"/>
      <arg value="/f"/>
      <arg value="${basedir}\keys.p12"/>
      <arg value="/p"/>
      <arg value="${password}"/>
      <arg value="${basedir}\install\windows\build\SweetHome3D-x86.exe"/>
      <arg value="${basedir}\install\windows\build\SweetHome3D-x64.exe"/>
    </exec>
    <!-- Create signed SweetHome3D-version-windows.exe with Inno Setup -->
    <exec executable="C:\Program Files (x86)\Inno Setup 5\ISCC.exe" failonerror="yes">
      <arg value="/sSignToolPgm=$$qC:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe$$q sign /f $$q${basedir}\keys.p12$$q /p ${password} $p"/>
      <arg value="${basedir}\install\windows\signedInstallerInnoSetup.iss"/>
    </exec>  

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/windows/build"/>

    <echo message="signed install/SweetHome3D-${version}-windows.exe ready for ftp"/>
  </target>

  <!-- Builds Sweet Home 3D Mac OS X application bundle in install/macosx/SweetHome3D-version directory. -->
  <target name="macosxBundle" depends="application,furniture,textures,help"
          description="Builds Sweet Home 3D Mac OS X application bundle">
    <!-- Copy Sweet Home 3D files to install/macosx/SweetHome3D-version/Sweet Home 3D.app -->
    <mkdir dir="install/macosx/SweetHome3D-${version}"/>
    <copy todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app">
      <fileset dir="install/macosx/Sweet Home 3D"/>
    </copy>

    <!-- Change executable permission of SweetHome3D lost during copy task -->
    <chmod perm="+x" file="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/MacOS/SweetHome3D"/>

    <!-- Copy SweetHome3D JARs and its direct libs 
         to install/macosx/SweetHome3D-version/Sweet Home 3D.app/Contents/Resources/Java -->
    <mkdir dir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java/ext"/>
    <move file="build/SweetHome3D.jar" todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java" />
    <move file="build/Furniture.jar"   todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java" />
    <move file="build/Textures.jar"    todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java" />
    <move file="build/Help.jar"        todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java" />
    <copy todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java" >
      <fileset dir="lib">
        <include name="*.jar"/>
        <exclude name="jmf.jar"/>
        <exclude name="j3dcore.jar"/>
        <exclude name="j3dutils.jar"/>
        <exclude name="vecmath.jar"/>
        <!-- Print to PDF menu item isn't available under Mac OS X as it's already in standard print dialog -->
        <exclude name="iText-2.1.7.jar"/>
      </fileset>
    </copy>
    <!-- Copy jnlp.jar, JMF and Mac OS X Java 3D 1.5 DLLs and JARs for Java 3D 
         to install/macosx/SweetHome3D-version/Sweet Home 3D.app/Contents/Resources/Java/ext -->
    <copy file="libtest/jnlp.jar" todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java/ext"/>
    <copy todir="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app/Contents/Resources/Java/ext" >
      <fileset dir="lib">
        <include name="jmf.jar"/>
        <include name="j3dcore.jar"/>
        <include name="j3dutils.jar"/>
        <include name="vecmath.jar"/>
      </fileset>
      <fileset dir="lib/macosx">
        <include name="*.jar"/>
        <include name="*.jnilib"/>
      </fileset>
    </copy>
    <!-- Copy COPYING.TXT and licenses texts to install/macosx/SweetHome3D-version/ -->
    <copy file="COPYING.TXT" todir="install/macosx/SweetHome3D-${version}"/>
    <copy file="LICENSE.TXT" todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JAVA3D.TXT"     todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-BATIK.TXT"      todir="install/macosx/SweetHome3D-${version}"/>
    <copy file="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT"  todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-SUNFLOW.TXT"   todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JMF.HTML"       todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-TANGO.TXT"      todir="install/macosx/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"   todir="install/macosx/SweetHome3D-${version}" />
  </target>

  <!-- Builds install/SweetHome3D-version-macosx.dmg archive that contains SweetHome3D.app 
       and Sweet Home 3D libraries. 
       CAUTION : May be run only under Mac OS X and requires Disk Utility -->
  <target name="macosxInstaller" depends="macosxBundle"
          description="Builds install/SweetHome3D-version-macosx.dmg archive">
    <!-- Create install/SweetHome3D-version-macosx.dmg with Disk Utility -->
    <delete file="install/SweetHome3D-${version}-macosx.dmg"/>
    <exec executable="hdiutil" failonerror="yes">
      <arg value="create"/>
      <arg value="-srcfolder"/>
      <arg value="install/macosx/SweetHome3D-${version}"/>
      <arg value="install/SweetHome3D-${version}-macosx.dmg"/>
    </exec>

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/macosx/SweetHome3D-${version}"/>

    <echo message="install/SweetHome3D-${version}-macosx.dmg ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-macosx.dmg signed archive that contains SweetHome3D.app 
       and Sweet Home 3D libraries. 
       CAUTION : May be run only under Mac OS X and requires hdutil, codesign 
                 and a certificate imported in Keychain Access -->
  <target name="macosxSignedInstaller" depends="macosxBundle"
          description="Builds install/SweetHome3D-version-macosx.dmg archive">
    <input message="Enter certificate name:" addproperty="certificateName"/> 
    <!-- Sign Sweet Home 3D application bundle -->
    <exec executable="codesign" failonerror="yes">
      <arg value="-s"/>
      <arg value="${certificateName}"/>
      <arg value="install/macosx/SweetHome3D-${version}/Sweet Home 3D.app"/>
    </exec>

    <!-- Create install/SweetHome3D-version-macosx.dmg with Disk Utility -->
    <delete file="install/SweetHome3D-${version}-macosx.dmg"/>
    <exec executable="hdiutil" failonerror="yes">
      <arg value="create"/>
      <arg value="-srcfolder"/>
      <arg value="install/macosx/SweetHome3D-${version}"/>
      <arg value="install/SweetHome3D-${version}-macosx.dmg"/>
    </exec>

    <!-- Sign Sweet Home 3D DMG image -->
    <exec executable="codesign" failonerror="yes">
      <arg value="-s"/>
      <arg value="${certificateName}"/>
      <arg value="install/SweetHome3D-${version}-macosx.dmg"/>
    </exec>

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/macosx/SweetHome3D-${version}"/>

    <echo message="signed install/SweetHome3D-${version}-macosx.dmg ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-linux-x86.tgz archive that contains SweetHome3D command
       with a Linux JRE and Sweet Home 3D libraries.
       CAUTION : Requires a Linux 32 bit JRE installed in jre1.8.0_112 -->
  <target name="linux32Installer" depends="application,furniture,textures,help,jogl-java3d"
          description="Builds install/SweetHome3D-version-linux-x86.tgz archive">
    <!-- Copy SweetHome3D.jar and Linux Java 3D DLLs and JARs for Java 3D 
         to install/linux/x86/SweetHome3D-version/lib -->
    <mkdir dir="install/linux/x86/SweetHome3D-${version}/lib"/>
    <!-- Copy SweetHome3D commands -->
    <copy todir="install/linux/x86/SweetHome3D-${version}" 
          file="install/linux/SweetHome3D"/>
    <copy todir="install/linux/x86/SweetHome3D-${version}" 
          file="install/linux/SweetHome3D-Java3D-1_5_2"/>  	

    <!-- Copy SweetHome3D JARs and its direct libs 
         to install/linux/x86/SweetHome3D-version/lib -->
    <move file="build/SweetHome3D.jar" todir="install/linux/x86/SweetHome3D-${version}/lib" />
    <move file="build/Furniture.jar"   todir="install/linux/x86/SweetHome3D-${version}/lib" />
    <move file="build/Textures.jar"    todir="install/linux/x86/SweetHome3D-${version}/lib" />
    <move file="build/Help.jar"        todir="install/linux/x86/SweetHome3D-${version}/lib" />
    <copy todir="install/linux/x86/SweetHome3D-${version}/lib" >
      <fileset dir="lib">
        <include name="*.jar"/>
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
   	</copy>
    <copy todir="install/linux/x86/SweetHome3D-${version}/lib" >
      <fileset dir="lib/linux/i386">
        <include name="*.so"/>
      </fileset>
    </copy>
    <copy todir="install/linux/x86/SweetHome3D-${version}/lib/java3d-1.6" >
      <fileset dir="lib/java3d-1.6/linux/i586">
        <include name="*.so"/>
      </fileset>
    </copy>
    <copy file="COPYING.TXT" todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="LICENSE.TXT" todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JAVA.TXT"      todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JAVA3D.TXT"    todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-BATIK.TXT"     todir="install/linux/x86/SweetHome3D-${version}"/>
    <copy file="THIRDPARTY-LICENSE-ITEXT.TXT"     todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT" todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-SUNFLOW.TXT"   todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JMF.HTML"      todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-TANGO.TXT"     todir="install/linux/x86/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"  todir="install/linux/x86/SweetHome3D-${version}" />
  	<copy file="src/com/eteks/sweethome3d/swing/resources/aboutIcon.png" 
  		  tofile="install/linux/x86/SweetHome3D-${version}/SweetHome3DIcon.png"/>

    <!-- Copy JRE to install/linux/x86/SweetHome3D-version/jre... excluding files mentioned 
         in JRE README.TXT file (JRE bin/java command excepted) -->
    <copy todir="install/linux/x86/SweetHome3D-${version}/jre8">
      <fileset dir="jre1.8.0_112">
        <include name="**"/>
        <exclude name="lib/ext/sunjce_provider.jar"/>
        <exclude name="lib/ext/sunec.jar"/>
        <exclude name="lib/ext/sunpkcs11.jar"/>
        <exclude name="bin/rmid"/>
        <exclude name="bin/rmiregistry"/>
        <exclude name="bin/tnameserv"/>
        <exclude name="bin/keytool"/>
        <exclude name="bin/policytool"/>
        <exclude name="bin/orbd"/>
        <exclude name="bin/servertool"/>
        <exclude name="lib/cmm/PYCC.pf"/>
        <exclude name="lib/jfr"/>
        <exclude name="lib/jfr.jar"/>
        <!-- No need of JavaFX support -->
        <exclude name="THIRDPARTYLICENSEREADME-JAVAFX.txt"/>
        <exclude name="lib/javafx.properties"/>
        <exclude name="lib/i386/libdecora_sse.so"/>
        <exclude name="lib/i386/libfxplugins.so"/>
        <exclude name="lib/i386/libglass.so"/>
        <exclude name="lib/i386/libgstreamer-lite.so"/>
        <exclude name="lib/i386/libjavafx_font_freetype.so"/>
        <exclude name="lib/i386/libjavafx_font_pango.so"/>
        <exclude name="lib/i386/libjavafx_font_t2k.so"/>
        <exclude name="lib/i386/libjavafx_font.so"/>
        <exclude name="lib/i386/libjavafx_iio.so"/>
        <exclude name="lib/i386/libjfxmedia.so"/>
        <exclude name="lib/i386/libjfxwebkit.so"/>
        <exclude name="lib/i386/libprism_common.so"/>   
        <exclude name="lib/i386/libprism_es2.so"/>
        <exclude name="lib/i386/libprism_sw.so"/>
        <exclude name="lib/ext/jfxrt.jar"/>
        <exclude name="lib/ext/nashorn.jar"/>
      </fileset>
    </copy>

    <!-- Create SweetHome3D-version-linux-x86.tgz archive -->
    <tar destfile="install/SweetHome3D-${version}-linux-x86.tgz"
         compression="gzip">
      <tarfileset dir="install/linux/x86"
                  includes="SweetHome3D-${version}/**">
        <exclude name="SweetHome3D-${version}/SweetHome3D"/>
        <exclude name="SweetHome3D-${version}/SweetHome3D-Java3D-1_5_2"/>
        <exclude name="SweetHome3D-${version}/jre8/bin/java"/>
      </tarfileset>
      <!-- Change executable permission of SweetHome3D and java commands -->
      <tarfileset dir="install/linux/x86" mode="755">
        <include name="SweetHome3D-${version}/SweetHome3D"/>
        <include name="SweetHome3D-${version}/SweetHome3D-Java3D-1_5_2"/>
        <include name="SweetHome3D-${version}/jre8/bin/java"/>
      </tarfileset>
    </tar>

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/linux/x86"/>

    <echo message="install/SweetHome3D-${version}-linux-x86.tgz ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-linux-x64.tgz archive that contains SweetHome3D command
       with a Linux JRE and Sweet Home 3D libraries.
       CAUTION : Requires a Linux 64 bit JRE installed in jre1.8.0_112 -->
  <target name="linux64Installer" depends="application,furniture,textures,help,jogl-java3d"
          description="Builds install/SweetHome3D-version-linux-x64.tgz archive">
    <!-- Copy SweetHome3D.jar and Linux Java 3D DLLs and JARs for Java 3D 
         to install/linux/x64/SweetHome3D-version/lib -->
    <mkdir dir="install/linux/x64/SweetHome3D-${version}/lib"/>
    <!-- Copy SweetHome3D commands -->
    <copy todir="install/linux/x64/SweetHome3D-${version}" 
          file="install/linux/SweetHome3D"/>
    <copy todir="install/linux/x64/SweetHome3D-${version}" 
          file="install/linux/SweetHome3D-Java3D-1_5_2"/>  	

    <!-- Copy SweetHome3D JARs and its direct libs 
         to install/linux/x64/SweetHome3D-version/lib -->
    <move file="build/SweetHome3D.jar" todir="install/linux/x64/SweetHome3D-${version}/lib" />
    <move file="build/Furniture.jar"   todir="install/linux/x64/SweetHome3D-${version}/lib" />
    <move file="build/Textures.jar"    todir="install/linux/x64/SweetHome3D-${version}/lib" />
    <move file="build/Help.jar"        todir="install/linux/x64/SweetHome3D-${version}/lib" />
    <copy todir="install/linux/x64/SweetHome3D-${version}/lib" >
      <fileset dir="lib">
        <include name="*.jar"/>
        <include name="java3d-1.6/*.jar"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
   	</copy>
    <copy todir="install/linux/x64/SweetHome3D-${version}/lib" >
      <fileset dir="lib/linux/x64">
        <include name="*.so"/>
      </fileset>
    </copy>
    <copy todir="install/linux/x64/SweetHome3D-${version}/lib/java3d-1.6" >
      <fileset dir="lib/java3d-1.6/linux/amd64">
        <include name="*.so"/>
      </fileset>
    </copy>
    <copy file="COPYING.TXT" todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="LICENSE.TXT" todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JAVA.TXT"      todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JAVA3D.TXT"    todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-BATIK.TXT"     todir="install/linux/x64/SweetHome3D-${version}"/>
    <copy file="THIRDPARTY-LICENSE-ITEXT.TXT"     todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT" todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-SUNFLOW.TXT"   todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-JMF.HTML"      todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-TANGO.TXT"     todir="install/linux/x64/SweetHome3D-${version}" />
    <copy file="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"  todir="install/linux/x64/SweetHome3D-${version}" />
  	<copy file="src/com/eteks/sweethome3d/swing/resources/aboutIcon.png" 
  		  tofile="install/linux/x64/SweetHome3D-${version}/SweetHome3DIcon.png"/>

    <!-- Copy JRE to install/linux/x64/SweetHome3D-version/jre... excluding files mentioned 
         in JRE README.TXT file (JRE bin/java command excepted) -->
    <copy todir="install/linux/x64/SweetHome3D-${version}/jre8">
      <fileset dir="jre1.8.0_112/">
        <include name="**"/>
        <exclude name="lib/ext/sunjce_provider.jar"/>
        <exclude name="lib/ext/sunec.jar"/>
        <exclude name="lib/ext/sunpkcs11.jar"/>
        <exclude name="bin/rmid"/>
        <exclude name="bin/rmiregistry"/>
        <exclude name="bin/tnameserv"/>
        <exclude name="bin/keytool"/>
        <exclude name="bin/policytool"/>
        <exclude name="bin/orbd"/>
        <exclude name="bin/servertool"/>
        <exclude name="lib/cmm/PYCC.pf"/>
        <exclude name="lib/jfr"/>
        <exclude name="lib/jfr.jar"/>
        <!-- No need of JavaFX support -->
        <exclude name="THIRDPARTYLICENSEREADME-JAVAFX.txt"/>
        <exclude name="lib/javafx.properties"/>
        <exclude name="lib/amd64/libdecora_sse.so"/>
        <exclude name="lib/amd64/libprism_common.so"/>   
        <exclude name="lib/amd64/libprism_es2.so"/>
        <exclude name="lib/amd64/libprism_sw.so"/>
        <exclude name="lib/amd64/libfxplugins.so"/>
        <exclude name="lib/amd64/libglass.so"/>
        <exclude name="lib/amd64/libgstreamer-lite.so"/>
        <exclude name="lib/amd64/libjavafx_font_freetype.so"/>
        <exclude name="lib/amd64/libjavafx_font_pango.so"/>
        <exclude name="lib/amd64/libjavafx_font_t2k.so"/>
        <exclude name="lib/amd64/libjavafx_font.so"/>
        <exclude name="lib/amd64/libjavafx_iio.so"/>
        <exclude name="lib/amd64/libjfxmedia.so"/>
        <exclude name="lib/amd64/libjfxwebkit.so"/>
        <exclude name="lib/ext/jfxrt.jar"/>
        <exclude name="lib/ext/nashorn.jar"/>
      </fileset>
    </copy>

    <!-- Create SweetHome3D-version-linux-x64.tgz archive -->
    <tar destfile="install/SweetHome3D-${version}-linux-x64.tgz"
         compression="gzip">
      <tarfileset dir="install/linux/x64"
                  includes="SweetHome3D-${version}/**">
        <exclude name="SweetHome3D-${version}/SweetHome3D"/>
        <exclude name="SweetHome3D-${version}/SweetHome3D-Java3D-1_5_2"/>
        <exclude name="SweetHome3D-${version}/jre8/bin/java"/>
      </tarfileset>
      <!-- Change executable permission of SweetHome3D and java commands -->
      <tarfileset dir="install/linux/x64" mode="755">
        <include name="SweetHome3D-${version}/SweetHome3D"/>
      	<include name="SweetHome3D-${version}/SweetHome3D-Java3D-1_5_2"/>
        <include name="SweetHome3D-${version}/jre8/bin/java"/>
      </tarfileset>
    </tar>

    <!-- Clean build directories -->
    <delete dir="build"/>
    <delete dir="install/linux/x64"/>

    <echo message="install/SweetHome3D-${version}-linux-x64.tgz ready for ftp"/>
  </target>

  <!-- Builds Sweet Home 3D Windows signed portable launchers in install/portable/SweetHome3D-version-portable directory.
       CAUTION : May be run only under Windows and requires launch4j and SignTool
                 included in Windows platform SDK installed in their default location -->
  <target name="windowsSignedPortableLaunchers" 
          description="Builds Sweet Home 3D Windows portable launchers">
    <!-- Create portable executable files with launch4j -->
    <exec executable="C:\Program Files (x86)\Launch4j\launch4jc.exe" failonerror="yes">
      <arg value="${basedir}\install\portable\SweetHome3D-windows-x86.xml"/>
    </exec>
    <exec executable="C:\Program Files (x86)\Launch4j\launch4jc.exe" failonerror="yes">
      <arg value="${basedir}\install\portable\SweetHome3D-windows-x64.xml"/>
    </exec>

    <input message="Enter signature password:" 
           addproperty="password"/> 
    <!-- Sign launchers -->
    <exec executable="C:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe" failonerror="yes">
      <arg value="sign"/>
      <arg value="/f"/>
      <arg value="${basedir}\keys.p12"/>
      <arg value="/p"/>
      <arg value="${password}"/>
      <arg value="${basedir}\install\portable\SweetHome3D-windows-x86.exe"/>
      <arg value="${basedir}\install\portable\SweetHome3D-windows-x64.exe"/>
    </exec>

    <mkdir dir="install/portable/SweetHome3D-${version}-portable"/>
    <move file="install/portable/SweetHome3D-windows-x86.exe" todir="install/portable/SweetHome3D-${version}-portable" />
    <move file="install/portable/SweetHome3D-windows-x64.exe" todir="install/portable/SweetHome3D-${version}-portable" />
  </target>

  <!-- Builds install/portable/SweetHome3D-version-portable files required for SweetHome3D portable version -->
  <target name="portableArchive" depends="application,furniture,textures,help,jogl-java3d"
          description="Builds install/portable/SweetHome3D-version-portable files">
    <!-- Copy SweetHome3D JARs and its libs 
         to install/portable/SweetHome3D-${version}/lib -->
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/lib/ext"/>
    <move file="build/SweetHome3D.jar" todir="install/portable/SweetHome3D-${version}-portable/lib" />
    <move file="build/Furniture.jar"   todir="install/portable/SweetHome3D-${version}-portable/lib" />
    <move file="build/Textures.jar"    todir="install/portable/SweetHome3D-${version}-portable/lib" />
    <move file="build/Help.jar"        todir="install/portable/SweetHome3D-${version}-portable/lib" />
    <copy todir="install/portable/SweetHome3D-${version}-portable/lib" >
      <fileset dir="lib">
        <include name="*.jar"/>
        <exclude name="jmf.jar"/>
        <exclude name="j3dcore.jar"/>
        <exclude name="j3dutils.jar"/>
        <exclude name="vecmath.jar"/>
      </fileset>
    </copy>
    <!-- Copy jnlp.jar, JMF and DLLs and JARs for Java 3D 
         to install/portable/SweetHome3D-${version}-portable/lib/ext -->
    <copy file="libtest/jnlp.jar" todir="install/portable/SweetHome3D-${version}-portable/lib/ext"/>
    <copy todir="install/portable/SweetHome3D-${version}-portable/lib/ext">
      <fileset dir="lib">
        <include name="jmf.jar"/>
        <include name="j3dcore.jar"/>
        <include name="j3dutils.jar"/>
        <include name="vecmath.jar"/>
        <include name="macosx/*"/>
        <include name="java3d-1.6/*.jar"/>
        <include name="java3d-1.6/windows/**"/>
        <include name="java3d-1.6/linux/**"/>
      	<exclude name="java3d-1.6/jogl-all.jar"/>
      </fileset>
      <fileset dir="build">
        <include name="java3d-1.6/jogl-java3d.jar"/>
      </fileset>
    </copy>
    <!-- Copy README.TXT and licenses texts to install/macosx/SweetHome3D-version/ -->
    <copy file="install/portable/README.TXT" todir="install/portable/SweetHome3D-${version}-portable"/>
    <copy file="COPYING.TXT" todir="install/portable/SweetHome3D-${version}-portable"/>
    <copy file="LICENSE.TXT" todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-JAVA.TXT"       todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-JAVA3D.TXT"     todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-BATIK.TXT"      todir="install/portable/SweetHome3D-${version}-portable"/>
    <copy file="THIRDPARTY-LICENSE-ITEXT.TXT"      todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-VECTORGRAPHICS.TXT"  todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-SUNFLOW.TXT"   todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-JMF.HTML"      todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-LAUNCH4J.TXT"  todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-TANGO.TXT"     todir="install/portable/SweetHome3D-${version}-portable" />
    <copy file="THIRDPARTY-LICENSE-CONTRIBUTIONS.TXT"   todir="install/portable/SweetHome3D-${version}-portable" />

    <!-- Copy Mac OS X application bundle using a different Info.plist file -->
    <copy todir="install/portable/SweetHome3D-${version}-portable/SweetHome3D-macosx.app">
      <fileset dir="install/macosx/Sweet Home 3D"/>
    </copy>
    <copy file="install/portable/Info.plist" todir="install/portable/SweetHome3D-${version}-portable/SweetHome3D-macosx.app/Contents" overwrite="true"/>
    <!-- Change executable permission of SweetHome3D lost during copy task -->
    <chmod perm="+x" file="install/portable/SweetHome3D-${version}-portable/SweetHome3D-macosx.app/Contents/MacOS/SweetHome3D"/>

    <!-- Copy Linux command files -->
    <copy file="install/portable/SweetHome3D-linux-x86" todir="install/portable/SweetHome3D-${version}-portable"/>
    <copy file="install/portable/SweetHome3D-linux-x64" todir="install/portable/SweetHome3D-${version}-portable"/>
    <!-- Change executable permission of command files lost during copy task -->
    <chmod perm="+x" file="install/portable/SweetHome3D-${version}-portable/SweetHome3D-linux-*"/>
 
    <!-- Prepare bundle jre directories -->
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/jre/windows/i586"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/jre/windows/x64"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/jre/linux/i586"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/jre/linux/x64"/>

    <!-- Prepare data directories for SH3F, SH3T, SH3L and SH3P files -->
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/data/furniture"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/data/textures"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/data/languages"/>
    <mkdir dir="install/portable/SweetHome3D-${version}-portable/data/plugins"/>

    <echo message="copy Windows portable launchers, jres, SH3F, SH3T, SH3L and SH3P files 
                   to install/portable/SweetHome3D-${version}-portable and prepare compressed archive"/>
  </target>

  <!-- Builds install/SweetHome3DViewer-version.zip archive that contains 
       the files required for SweetHome3DViewer applet -->
  <target name="viewerInstaller" depends="viewer"
          description="Builds install/SweetHome3DViewer-version.zip archive">
    <zip destfile="install/SweetHome3DViewer-${version}.zip">
      <zipfileset dir="deploy" 
                  includes="lib/**, SweetHome3DViewer.html"/>
      <zipfileset dir="install/viewer" 
                  includes="README.TXT"/>
      <zipfileset dir=".">
        <include name="COPYING.TXT"/>
        <include name="LICENSE.TXT"/>
        <include name="THIRDPARTY-LICENSE-JAVA3D.TXT"/>
        <include name="THIRDPARTY-LICENSE-BATIK.TXT"/>
      </zipfileset>
    </zip>

    <echo message="install/SweetHome3DViewer-${version}.zip ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-src.zip archive that contains 
       SweetHome3D source files in directory named SweetHome3D-version-src -->
  <target name="sourceArchive"
          description="Builds install/SweetHome3D-version-src.zip archive">
    <mkdir dir="install/source/SweetHome3D-${version}-src"/>
    <copy todir="install/source/SweetHome3D-${version}-src">
      <fileset dir=".">
        <include name="build.xml"/>
        <include name="*.TXT"/>
        <include name="THIRDPARTY-LICENSE-*.HTML"/>
        <include name="*-diff.zip"/>
        <include name="src/**"/>
        <include name="test/**"/>
        <include name="lib/**"/>
        <include name="libtest/**"/>
        <!-- Do not include generated files that may belong to 
             deploy and install directories -->
        <include name="deploy/SweetHome3D*.*"/>
        <include name="deploy/*.php"/>
        <include name="install/linux/*"/>
        <include name="install/macosx/**"/>
        <include name="install/portable/*"/>
        <include name="install/viewer/*"/>
        <include name="install/windows/*"/>
        <!-- Eclipse project files -->
        <include name=".settings/**"/>
        <include name=".classpath"/>
        <include name=".project"/>
      </fileset>
    </copy>

    <zip destfile="install/SweetHome3D-${version}-src.zip" basedir="install/source"
         includes="SweetHome3D-${version}-src/**" />

    <!-- Clean build directory -->
    <delete dir="install/source"/>

    <echo message="install/SweetHome3D-${version}-src.zip ready for ftp"/>
  </target>

  <!-- Builds install/SweetHome3D-version-javadoc.zip archive that contains 
       the generated Javadoc of Java files found in SweetHome3D-version-src -->
  <target name="javadoc"
          description="Builds install/SweetHome3D-version-javadoc.zip archive">
    <mkdir dir="install/javadoc/SweetHome3D-${version}-javadoc"/>
    <javadoc sourcepath="src" destdir="install/javadoc/SweetHome3D-${version}-javadoc" 
             encoding="ISO-8859-1" version="true" author="true" use="true"
             windowtitle="Sweet Home 3D ${version} API">
      <doctitle><![CDATA[<img src='http://www.sweethome3d.com/SweetHome3DIcon.gif' width='48' height='48' alt='Sweet Home 3D' align='absmiddle'> Sweet Home 3D ${version} API]]></doctitle>
      <header><![CDATA[<a href='http://www.sweethome3d.com' target='_parent'><font size='+1'>Sweet Home 3D ${version}</font></a>]]></header>
      <footer><![CDATA[<a href='http://www.sweethome3d.com' target='_parent'><font size='+1'>Sweet Home 3D ${version}</font></a>]]></footer>
      <bottom><![CDATA[<table align='center'><tr>
                       <td><a href='http://www.eteks.com' target='_parent'><img align='absmiddle' src='http://www.sweethome3d.com/images/eteks.gif' border='0'><a></td>
                       <td>&copy; Copyrights 2006-2016 Emmanuel PUYBARET / <a href='http://www.eteks.com' target='_parent'>eTeks</a>
                           <br>Distributed under <a href='http://www.gnu.org/licenses/gpl-2.0.html' target='_parent'>GNU General Public License</a></td></tr></table>]]></bottom>
      <link href="http://docs.oracle.com/javase/1.5.1/docs/api/"/>
      <link href="http://download.java.net/media/java3d/javadoc/1.5.3/"/>
      <group title="Base classes" packages="*"/>
      <group title="Application and Applet" packages="com.eteks.sweethome3d:com.eteks.sweethome3d.applet"/>
      <classpath>
        <fileset dir="lib"/>
        <pathelement location="libtest/AppleJavaExtensions.jar"/>
        <pathelement location="libtest/jnlp.jar"/>
      </classpath>
    </javadoc>

    <zip destfile="install/SweetHome3D-${version}-javadoc.zip" basedir="install/javadoc"
         includes="SweetHome3D-${version}-javadoc/**" />

    <!-- Clean build directory -->
    <delete dir="install/javadoc"/>

    <echo message="install/SweetHome3D-${version}-javadoc.zip ready for ftp"/>
  </target>

  <!-- Launchs a JDepend graphical UI to help update dependencies in PackageDependenciesTest test -->
  <target name="jdepend" depends="build"
          description="Launchs a JDepend graphical UI">
    <!-- Create jdepend.properties file in build directory that specifies ignored Java packages -->
    <concat destfile="build/jdepend.properties">ignore.java=java.*</concat>

    <!-- Run JDepend UI -->
    <java classname="jdepend.swingui.JDepend" fork="true">
      <classpath>
        <pathelement location="libtest/jdepend-2.9.jar"/>
        <pathelement location="build"/>
      </classpath>
      <arg value="build"/>
    </java>

    <!-- Clean build directory -->
    <delete dir="build"/>
  </target>
</project>