build.xml 74.4 KB
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 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<project name="OFBiz Main Build" default="build" basedir="."
         xmlns:ivy="antlib:org.apache.ivy.ant"
         xmlns:sonar="antlib:org.sonar.ant:sonar">

    <import file="macros.xml"/>
    <property name="site.dir" value="../site"/>
    <property name="memory.initial.param" value="-Xms128M"/>
    <property name="memory.max.param" value="-Xmx512M"/>
    <property name="memory.maxpermsize.param" value="-XX:MaxPermSize=512M"/>

    <import file="framework/build.xml" optional="false"/>
    <available file="applications/build.xml" property="applications.present"/>
    <import file="applications/build.xml" optional="true"/>
    <available file="specialpurpose/build.xml" property="specialpurpose.present"/>
    <import file="specialpurpose/build.xml" optional="true"/>

    <!-- ================================================================== -->
    <!-- Initialization of all property settings                            -->
    <!-- ================================================================== -->

    <target name="ofbiz-init" depends="dir-init">
        <property environment="env"/>
    </target>

    <target name="dir-init">
        <mkdir dir="runtime"/>
        <mkdir dir="runtime/output"/>
        <mkdir dir="runtime/logs"/>
        <mkdir dir="runtime/logs/test-results"/>
        <mkdir dir="runtime/data"/>
        <mkdir dir="runtime/data/derby"/>

        <condition property="isMac">
            <os family="mac"/>
        </condition>
        <antcall target="copy-derby-props" inheritall="true"/>
    </target>

    <target name="copy-derby-props" if="isMac">
        <copy file="runtime/data/derby.properties" todir="runtime/data/derby"/>
    </target>

    <target name="ivy-init">
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 uri="antlib:org.apache.ivy.ant">
            <classpath>
                <pathelement location="framework/base/lib/ivy-2.2.0.jar" />
            </classpath>
        </taskdef>
    </target>
    <target name="sonar-init">
        <taskdef uri="antlib:org.sonar.ant:sonar" resource="org/sonar/ant/antlib.xml">
            <classpath>
                <pathelement location="framework/base/lib/sonar-ant-task-1.3.jar" />
            </classpath>
        </taskdef>
    </target>

    <!-- ================================================================== -->
    <!-- Removes all created files and directories                          -->
    <!-- ================================================================== -->

    <target name="refresh"
            description="Clean all and rebuild">
        <antcall target="clean-all"/>
        <antcall target="build"/>
    </target>

    <target name="clean-all"
            description="Clean all DB, Catalina and caches data, logs, and runtime subdirectories and all specific files like .rej, .orig">
        <antcall target="clean-data"/>
        <antcall target="clean-logs"/>
        <antcall target="clean-output"/>
        <antcall target="clean-xtra"/>
        <antcall target="clean-catalina"/>
        <antcall target="clean-cache"/>
        <antcall target="clean-tempfiles"/>
        <antcall target="clean-search-indexes"/>
        <!-- FIXME: clean-downloads introduces some issues: with cobertura (on Windows can't be deleted, not sure why), 
                    but especially with postgresql drivers -->
        <!-- antcall target="clean-downloads"/ -->
        <antcall target="clean"/>
    </target>

    <target name="clean-downloads"
            description="Clean all downloaded files">
        <delete>
            <fileset dir="framework/base/lib" includes="cobertura-*.jar"/>
            <fileset dir="framework/base/lib" includes="sonar-*.jar"/>
            <fileset dir="framework/entity/lib/jdbc" includes="postgresql-*.jar"/>
        </delete>
    </target>
    <target name="clean-data"
            description="Clean all DB data (Derby) under runtime/data">
        <delete verbose="on" includeemptydirs="true">
            <fileset dir="runtime/data" includes="**/*">
                <exclude name="README"/>
                <exclude name="derby.properties"/>
            </fileset>
        </delete>
        <delete file="runtime/data.zip"/>
        <delete file="runtime/test-list-build.xml"/>
    </target>

    <target name="clean-logs"
            description="Clean all logs in runtime/logs">
        <delete verbose="on" includeemptydirs="true">
            <fileset dir="runtime/logs" includes="**/*">
                <exclude name="README"/>
            </fileset>
        </delete>
    </target>

    <target name="clean-output"
            description="Clean runtime/output directory">
        <delete verbose="on" includeemptydirs="true">
            <fileset dir="runtime/output" includes="**/*"/>
        </delete>
    </target>

    <target name="clean-xtra"
            description="Clean all other files like .rej, .orig, etc.">
        <delete verbose="on">
            <fileset dir="." includes="**/.nbattrs,**/*~,**/.#*,**/.DS_Store,**/*.rej,**/*.orig"/>
        </delete>
    </target>

    <target name="clean-catalina"
            description="Clean Catalina data in runtime/catalina/work">
        <delete dir="runtime/catalina/work"/>
    </target>

    <target name="clean-cache"
            description="Clean the UtilCache file if errors found with old objects in the cache (Java runtime error something like 'local class incompatible')">
        <property file="framework/base/config/cache.properties"/>
        <echo message="NOTICE: deleting ${cache.file.store}.db"/>
        <delete file="${cache.file.store}.db" verbose="true"/>
    </target>

    <target name="clean-tempfiles"
            description="Remove files located in runtime/tempfiles (captcha, etc...)">
        <delete includeemptydirs="true">
            <fileset dir="./runtime/tempfiles" includes="**/*"/>
        </delete>
    </target>

    <target name="clean-search-indexes"
            description="Remove search indexes (e.g. Lucene indexes) created under runtime/indexes">
        <delete includeemptydirs="true">
            <fileset dir="./runtime/indexes" includes="**/*" erroronmissingdir="false" />
        </delete>
    </target>

    <target name="tests" depends="ofbiz-init">
        <iterate target="tests" filelist="test-builds"/>
    </target>

    <target name="clean">
        <hotdeployant target="clean"/>
        <antcall target="clean-specialpurpose"/>
        <antcall target="clean-applications"/>
        <antcall target="clean-framework"/>
        <delete file="ofbiz.jar"/>
        <echo message="[clean] ========== Done Cleaning =========="/>
    </target>

    <target name="clean-framework">
        <iterate target="clean" filelist="framework-builds"/>
    </target>
    <target name="clean-applications" if="${applications.present}">
        <iterate target="clean" filelist="application-builds"/>
    </target>
    <target name="clean-specialpurpose" if="${specialpurpose.present}">
        <iterate target="clean" filelist="specialpurpose-builds"/>
    </target>

    <target name="svninfo"
        description="Update the Release-revision info in the footer. Note that you need a valid Internet connection and Subversion connected to the OFBiz repository for that ">
        <echo message="Creating svninfo..."/>
        <exec executable="svn" dir="." output="runtime/svninfo_tmp.xml">
            <arg value="info"/>
            <arg value="--xml"/>
        </exec>
        <xmlproperty file="runtime/svninfo_tmp.xml"/>
        <echo message="Rev:${info.entry.commit(revision)}"/>
        <basename property="releasePath" file="${info.entry.url}"/>
        <tstamp>
            <format property="dateTime" pattern="yyyy-MM-dd HH:mm:ss"/>
        </tstamp>
        <echo message=" - Release-revision : ${releasePath}-r${info.entry.commit(revision)},  ${uiLabelMap.CommonBuiltOn} ${dateTime}" file="runtime/svninfo.ftl"/>
        <delete file="runtime/svninfo_tmp.xml"/>
        <echo message="Done!"/>
    </target>

    <target name="clean-svninfo">
        <echo message="Resetting svninfo..."/>
        <echo message=" " file="runtime/svninfo.ftl"/>
        <echo message="Done!"/>
    </target>

    <!-- ================================================================== -->
    <!-- Build Components                                                   -->
    <!-- ================================================================== -->

    <target name="build" depends="ofbiz-init">
        <echo message="[build] ========== Start Building (Compile) =========="/>

        <antcall target="build-framework"/>
        <antcall target="build-applications"/>
        <antcall target="build-specialpurpose"/>
        <externalsubant>
            <fileset dir="${basedir}/themes">
                <include name="*/build.xml" />
            </fileset>
        </externalsubant>

        <hotdeployant/>
        <antcall target="clean-svninfo"/>

        <echo message="[build] ========== Done Building (Compile) =========="/>
    </target>

    <target name="build-framework">
        <iterate target="jar" filelist="framework-builds"/>
    </target>

    <target name="build-applications" if="${applications.present}">
        <iterate target="jar" filelist="application-builds"/>
    </target>

    <target name="build-specialpurpose" if="${specialpurpose.present}">
        <iterate target="jar" filelist="specialpurpose-builds"/>
    </target>

    <macrodef name="hotdeployant">
        <attribute name="target" default=""/>
        <sequential>
            <!-- a check is done, if no build.xml file is present in hot-deploy dir,
                then the build.xml files - if present - in hot-deploy sub-dirs will be used.
                So the previous, simpler, behaviour is kept as long as you don't need
                to build hot-deploy components in a specific order. -->
            <if>
                <available file="hot-deploy/build.xml" property="useHotDeployBuild"/>
                <then>
                    <externalsubant target="@{target}">
                        <filelist dir="." files="hot-deploy/build.xml"/>
                    </externalsubant>
                </then>
                <else>
                    <externalsubant target="@{target}">
                        <fileset dir="${basedir}/hot-deploy" casesensitive="no">
                            <exclude name="disabled/**"/>
                            <include name="*/build.xml"/>
                        </fileset>
                    </externalsubant>
                </else>
            </if>
        </sequential>
    </macrodef>

    <!-- ================================================================== -->
    <!-- Build JavaDocs                                                     -->
    <!-- ================================================================== -->

    <target name="docs" depends="ofbiz-init">
        <echo message="[docs] ========== Start Building (JavaDoc) =========="/>
        <antcall target="docs-framework"/>
        <antcall target="docs-applications"/>
        <antcall target="docs-specialpurpose"/>
        <hotdeployant target="docs"/>

        <echo message="[docs] ========== Done Building (JavaDocs) =========="/>
    </target>

    <target name="docs-framework">
        <iterate target="docs" filelist="framework-builds"/>
    </target>

    <target name="docs-applications" if="${applications.present}">
        <iterate target="docs" filelist="application-builds"/>
    </target>

    <target name="docs-specialpurpose" if="${specialpurpose.present}">
        <iterate target="docs" filelist="specialpurpose-builds"/>
    </target>

    <target name="docs-all" depends="build,ofbiz-init"
            description="For committers : Build all javadoc into one tree for easier viewing by the community">

        <echo message="[docs-all] ========== Start Building (JavaDoc) =========="/>

        <mkdir dir="${site.dir}/javadocs"/>

        <path id="local.class.path">
            <fileset dir="${ofbiz.home.dir}/framework/base/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/base/lib/commons" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/base/lib/j2eespecs" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/base/lib/scripting" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/catalina/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/entity/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/geronimo/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/service/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/testtools/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/webapp/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/framework/webapp/build/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/birt/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/ebaystore/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/googlecheckout/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/ldap/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/pos/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/specialpurpose/jetty/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/applications/content/lib" includes="*.jar"/>
            <fileset dir="${ofbiz.home.dir}/applications/product/lib" includes="*.jar"/>
        </path>

        <property name="desc" value="API"/>
        <property name="build.dir" value="${site.dir}"/>

        <default-javadoc/>

        <echo message="[docs-all] ========== Done Building (JavaDocs) =========="/>
    </target>

    <!-- ================================================================== -->
    <!-- Contrib Targets                                                    -->
    <!-- ================================================================== -->

    <target name="copy-contrib">
        <copy todir="${basedir}" overwrite="true" verbose="true">
            <fileset dir="${basedir}/contrib" excludes="contrib/**,**/*.class"/>
        </copy>
    </target>

    <target name="build-contrib" depends="copy-contrib,refresh"/>

    <!-- ================================================================== -->
    <!-- WebSite Targets                                                    -->
    <!-- ================================================================== -->

    <target name="build-website"
            description="For committers : Update dtds from OFBiz instance to site">
        <antcall target="copy-dtds"/>
        <!-- now deprecated since Buildbot creates and updates those automatically
        <antcall target="docs"/>
        <antcall target="copy-apis"/-->
    </target>

    <target name="copy-apis">
        <mkdir dir="${site.dir}/api"/>
        <mkdir dir="${site.dir}/api/framework"/>
        <mkdir dir="${site.dir}/api/applications"/>
        <mkdir dir="${site.dir}/api/specialpurpose"/>
        <copy todir="${site.dir}/api/framework">
            <fileset dir="${basedir}/framework" includes="*/build/javadocs/**"/>
        </copy>
        <copy todir="${site.dir}/api/applications">
            <fileset dir="${basedir}/applications" includes="*/build/javadocs/**"/>
        </copy>
        <copy todir="${site.dir}/api/specialpurpose">
            <fileset dir="${basedir}/specialpurpose" includes="*/build/javadocs/**"/>
        </copy>
    </target>

    <target name="copy-dtds"
            description="For committers : Copy all dtds from OFBiz instance to website">
        <mkdir dir="${site.dir}/dtds"/>
        <copy todir="${site.dir}/dtds" flatten="true" overwrite="true">
            <fileset dir="${basedir}" includes="**/*.dtd"/>
            <fileset dir="${basedir}" defaultexcludes="yes"> <!-- all but oagis and external in general -->
                <include name="**/*.xsd"/>
                <exclude name="**/002*.xsd"/>
                <exclude name="**/068*.xsd"/>
                <exclude name="**/161*.xsd"/>
                <exclude name="**/196*.xsd"/>
                <exclude name="**/197*.xsd"/>
            </fileset>
        </copy>
    </target>

    <!-- ================================================================== -->
    <!-- Script Targets                                                     -->
    <!-- ================================================================== -->

    <target name="scriptfix">
        <fixcrlf srcdir="${basedir}" eol="lf" eof="remove" includes="**/*.sh"/>
        <fixcrlf srcdir="${basedir}" eol="crlf" includes="**/*.bat"/>
    </target>

    <!-- ================================================================== -->
    <!-- Start and Stop OFBiz                                                        -->
    <!-- ================================================================== -->

    <target name="start"
            description="Start OFBiz (use -Dportoffset=portNumber to shift all ports with the portNumber value)">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="start"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-secure"
            description="Same than start but pre-loading the contrast-rO0 lib (from OFBiz roo dir) to secure OFBiz from the deserialization issue">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="-javaagent:${ofbiz.home.dir}/contrast-rO0.jar"/>
            <arg value="start"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-batch"
            description="Start OFBiz as a separate process. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true" spawn="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="start-batch"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-batch-secure"
        description="Same than start-batch but pre-loading the contrast-rO0 lib (from OFBiz roo dir) to secure OFBiz from the deserialization issue">
        <java jar="ofbiz.jar" fork="true" spawn="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="-javaagent:${ofbiz.home.dir}/contrast-rO0.jar"/>
            <arg value="start-batch"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-debug"
            description="Start OFBiz in debugging mode. It uses the 8091 port by default. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <jvmarg value="-Xnoagent"/>
            <jvmarg value="-Djava.compiler=NONE"/>
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/>
            <arg value="start-debug"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-pos"
            description="Start OFBiz POS (Point of sale). Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="pos"/>
            <arg value="-portoffset=${portoffset}"/><!-- Not sure this makes sense and is useful at all -->
        </java>
    </target>
    <target name="start-both"
            description="Start OFBiz in both Web and POS (Point of sale) modes. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="both"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="start-both-secure"
        description="Same than start-pos but pre-loading the contrast-rO0 lib (from OFBiz roo dir) to secure OFBiz from the deserialization issue">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="-javaagent:${ofbiz.home.dir}/contrast-rO0.jar"/>
            <jvmarg value="${memory.max.param}"/>
            <arg value="both"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="stop"
            description="Stop OFBiz. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true">
            <arg value="-shutdown"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>
    <target name="status"
            description="Display status of OFBiz. Use -Dportoffset=portNumber to shift all ports with the portNumber value.">
        <java jar="ofbiz.jar" fork="true">
            <arg value="-status"/>
            <arg value="-portoffset=${portoffset}"/>
        </java>
    </target>

    <!-- ================================================================== -->
    <!-- Setup OFBiz Data                                                   -->
    <!-- ================================================================== -->

    <target name="load-demo" depends="build"
            description="Load all data; meant for generic OFBiz development, testing, demonstration, etc purposes">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
        </java>
    </target>
    <target name="load-demo-multitenant" depends="build"
            description="Load all data needed for the multi-tenancy demonstration. Caution: this creates three databases, with each one loaded with all demo data.">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
        </java>
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#DEMO1"/>
        </java>
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#DEMO2"/>
        </java>
    </target>
    <target name="load-seed" depends="build"
            description="Load ONLY the seed data (not seed-initial, demo, ext* or anything else); meant for use after an update of the code to reload the seed data as it is generally maintained along with the code and needs to be in sync for operation">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=seed"/>
        </java>
    </target>
    <target name="load-extseed" depends="build"
            description="Load seed, seed-initial and ext data; meant for manual/generic testing, development, or going into production with a derived system based on stock OFBiz where the ext data basically replaces the demo data">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=seed,seed-initial,ext"/>
        </java>
    </target>
    <target name="load-exttest" depends="build"
            description="Load seed, seed-initial, ext and ext-test data; meant for automated testing with a derived system based on stock OFBiz">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=seed,seed-initial,ext,ext-test"/>
        </java>
    </target>
    <target name="load-readers" depends="build"
            description='Load data using the command line argument data-readers that takes a comma separated list of readers (seed, seed-initial, demo, ext, ext-test, ext-demo). On Windows XP (at least) you need top wrap the parameters in double-quotes. For instance: ant load-readers "-Ddata-readers=seed,seed-initial,ext"'>
        <java jar="ofbiz.jar" fork="true" >
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=${data-readers}"/>
        </java>
    </target>
    <target name="load-file" depends="build"
            description="Load data using the command line argument 'data-file' to load data from a given file using the 'default' delegator or a delegator specified in the command line argument 'delegator'">
        <property name="delegator" value="default" />
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=${delegator}"/>
            <arg value="file=${data-file}"/>
        </java>
    </target>
    <!-- =================================
          target: load-tenant
         ================================= -->
    <target name="load-tenant" depends="build,load-tenant-all,load-tenant-reader,load-tenant-component-all,load-tenant-component-reader"
            description="Load data using tenantId, syntax eg: ant load-tenant -DtenantId=DEMO1 (needs multitenant=Y in general.properties)">
    </target>
    <target name="check-tenant-id">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=tenant"/>
        </java>
        <condition property="hasTenant">
            <and>
                <length string="${tenantId}" trim="true" when="greater" length="0"/>
                <not><contains string="${tenantId}" substring="tenantId"/></not>
                <or>
                    <length string="${component}" trim="true" when="equal" length="0"/>
                    <contains string="${component}" substring="component"/>
                </or>
            </and>
        </condition>
        <condition property="hasTenantComponent">
            <and>
                <length string="${tenantId}" trim="true" when="greater" length="0"/>
                <not><contains string="${tenantId}" substring="tenantId"/></not>
                <length string="${component}" trim="true" when="greater" length="0"/>
                <not><contains string="${component}" substring="component"/></not>
            </and>
        </condition>
    </target>
    <target name="check-tenant-reader" depends="check-tenant-id" if="hasTenant">
        <condition property="hasReader">
            <and>
                <length string="${data-readers}" trim="true" when="greater" length="0"/>
                <not><contains string="${data-readers}" substring="data-readers"/></not>
            </and>
        </condition>
        <condition property="noReader">
            <or>
                <length string="${data-readers}" trim="true" when="equal" length="0"/>
                <contains string="${data-readers}" substring="data-readers"/>
            </or>
        </condition>
    </target>
    <target name="load-tenant-all" depends="check-tenant-reader" if="noReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#${tenantId}"/>
        </java>
    </target>
    <target name="load-tenant-reader" depends="check-tenant-reader" if="hasReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#${tenantId}"/>
            <arg value="readers=${data-readers}"/>
        </java>
    </target>
    <!-- load-tenant-component -->
    <target name="load-tenant-component" if="hasTenantComponent" depends="check-tenant-id">
        <condition property="hasComponentReader">
            <and>
                <length string="${data-readers}" trim="true" when="greater" length="0"/>
                <not><contains string="${data-readers}" substring="data-readers"/></not>
            </and>
        </condition>
        <condition property="noComponentReader">
            <or>
                <length string="${data-readers}" trim="true" when="equal" length="0"/>
                <contains string="${data-readers}" substring="data-readers"/>
            </or>
        </condition>
    </target>
    <target name="load-tenant-component-all" depends="load-tenant-component" if="noComponentReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#${tenantId}"/>
            <arg value="component=${component}"/>
        </java>
    </target>
    <target name="load-tenant-component-reader" depends="load-tenant-component" if="hasComponentReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=default#${tenantId}"/>
            <arg value="readers=${data-readers}"/>
            <arg value="component=${component}"/>
        </java>
    </target>
    <!-- =================================
          target: load-all-tenants
         ================================= -->
    <target name="load-all-tenants" depends="build,load-tenants-all,load-tenants-reader"
            description="Load data for all tenants, syntax eg: ant load-all-tenants (needs multitenant=Y in general.properties)">
    </target>
    <target name="check-tenants-reader">
        <property name="delegator" value="all-tenants"/>
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=tenant"/>
        </java>
        <condition property="hasReader">
            <and>
                <length string="${data-readers}" trim="true" when="greater" length="0"/>
                <not><contains string="${data-readers}" substring="data-readers"/></not>
            </and>
        </condition>
        <condition property="noReader">
            <or>
                <length string="${data-readers}" trim="true" when="equal" length="0"/>
                <contains string="${data-readers}" substring="data-readers"/>
            </or>
        </condition>
    </target>
    <target name="load-tenants-all" depends="check-tenants-reader" if="noReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="delegator=${delegator}"/>
        </java>
    </target>
    <target name="load-tenants-reader" depends="check-tenants-reader" if="hasReader">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=${data-readers}"/>
            <arg value="delegator=${delegator}"/>
        </java>
    </target>
    <!-- =================================
          target: create-tenant
         ================================= -->
    <target name="create-tenant"
            depends="create-tenant-on-Derby,create-tenant-on-MySQL,create-tenant-on-Oracle,create-tenant-on-PostgreSQL"
            description="Create a new tenant in your environment, create the delegator, load initial data with admin-user and password (needs multitenant=Y in general.properties)">
        <tstamp/>
    </target>

    <!-- description="This creates entity Tenant and TenantDataSource in default, installs data in the delegator and creates the admin-user and password for the tenant"
        sub-target of create-tenant, can't used alone => no description, to not clutter "ant -p" -->
    <target name="get-tenant-data">
        <input addproperty="tenantId" message="Enter Id for the tenant: "/>
        <input addproperty="tenantName" message="Enter name for tenant: "/>
        <input addproperty="data-readers" message="Enter data to install.
        Choices are e.g. seed,seed-initial,ext,demo.
        Multipe datasets must be separated with a comma: "/>
        <input addproperty="db-Platform" message="Select your default database platform, D = Derby,M = MySQL, O = Oracle, P = PostgreSQL"
               validargs="D,M,O,P"/>
        <echo message="Please make sure that the driver of the platform is installed and that the databases have been created (in function of the entityengine.xml datasource-names)"/>
        <input addproperty="db-IP" message="Enter IP address of the database server (you may add a port number)"/>
        <input addproperty="db-User" message="Enter userID of database user: "/>
        <input addproperty="db-Password" message="Enter password of database user: "/>
        <condition property="isDerby">
            <equals arg1="${db-Platform}" arg2="D"/>
        </condition>
        <condition property="isMySQL">
            <equals arg1="${db-Platform}" arg2="M"/>
        </condition>
        <condition property="isOracle">
            <equals arg1="${db-Platform}" arg2="O"/>
        </condition>
        <condition property="isPostgreSQL">
            <equals arg1="${db-Platform}" arg2="P"/>
        </condition>
        <antcall target="tenant-data-entry"/>
    </target>
    <!-- description="Creates tenant data and instance"
        sub-target of create-tenant, can't used alone => no description, to not clutter "ant -p" -->
    <target name="create-tenant-on-Derby" depends="get-tenant-data" if="isDerby">
        <echo message="Installing on Derby"/>
        <!-- Below code will handle the case of optional domain name. It will remove the TenantDomainName entry from tmpTenantData.xml file
            if domain name is empty, so that record would not get created. -->
        <copy file="${basedir}/framework/resources/templates/AdminNewTenantData-Derby.xml" tofile="runtime/tmp/tmpTenantData.xml"/>
        <if>
          <equals arg1="${domainName}" arg2="" />
          <then>
            <replace file="runtime/tmp/tmpTenantData.xml">
               <replacetoken><![CDATA[<TenantDomainName tenantId="@tenantId@" domainName="@domainName@" />]]></replacetoken>
               <replacevalue><![CDATA[]]></replacevalue>
            </replace>
          </then>
        </if>
        <copy file="runtime/tmp/tmpTenantData.xml" tofile="runtime/tmp/tmpFilteredTenantData.xml">
            <filterset>
                <filter token="tenantId" value="${tenantId}"/>
                <filter token="tenantName" value="${tenantName}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpFilteredTenantData.xml"/>
        </antcall>
        <delete file="runtime/tmp/tmpTenantData.xml"/>
        <delete file="runtime/tmp/tmpFilteredTenantData.xml"/>
        <antcall target="load-tenant-data-readers"/>
        <antcall target="load-tenant-admin-user-login">
            <param name="userLoginId" value="${tenantId}-admin"/>
            <param name="delegatorId" value="default#${tenantId}"/>
        </antcall>
    </target>
    <!-- description="Creates tenant data and instance. Don't forget db driver(s) and already created DBs in function of the entityengine.xml datasource-names"
        sub-target of create-tenant, can't used alone => no description, to not clutter "ant -p" -->
    <target name="create-tenant-on-MySQL" depends="get-tenant-data" if="isMySQL">
        <echo message="Installing on MySQL"/>
        <!-- Below code will handle the case of optional domain name. It will remove the TenantDomainName entry from tmpTenantData.xml file
            if domain name is empty, so that record would not get created. -->
        <copy file="${basedir}/framework/resources/templates/AdminNewTenantData-MySQL.xml" tofile="runtime/tmp/tmpTenantData.xml"/>
        <if>
          <equals arg1="${domainName}" arg2="" />
          <then>
            <replace file="runtime/tmp/tmpTenantData.xml">
               <replacetoken><![CDATA[<TenantDomainName tenantId="@tenantId@" domainName="@domainName@" />]]></replacetoken>
               <replacevalue><![CDATA[]]></replacevalue>
            </replace>
          </then>
        </if>
        <copy file="runtime/tmp/tmpTenantData.xml" tofile="runtime/tmp/tmpFilteredTenantData.xml">
            <filterset>
                <filter token="tenantId" value="${tenantId}"/>
                <filter token="tenantName" value="${tenantName}"/>
                <filter token="db-IP" value="${db-IP}"/>
                <filter token="db-User" value="${db-User}"/>
                <filter token="db-Password" value="${db-Password}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpFilteredTenantData.xml"/>
        </antcall>
        <delete file="runtime/tmp/tmpTenantData.xml"/>
        <delete file="runtime/tmp/tmpFilteredTenantData.xml"/>
        <antcall target="load-tenant-data-readers"/>
        <antcall target="load-tenant-admin-user-login">
            <param name="userLoginId" value="${tenantId}-admin"/>
            <param name="delegatorId" value="default#${tenantId}"/>
        </antcall>
    </target>
    <!-- description="Creates tenant data and instance. Don't forget db driver(s) and already created DBs in function of the entityengine.xml datasource-names"
        sub-target of create-tenant, can't used alone => no description, to not clutter "ant -p" -->
    <target name="create-tenant-on-Oracle" depends="get-tenant-data" if="isOracle">
        <echo message="Installing on Oracle"/>
        <!-- Below code will handle the case of optional domain name. It will remove the TenantDomainName entry from tmpTenantData.xml file
            if domain name is empty, so that record would not get created. -->
        <copy file="${basedir}/framework/resources/templates/AdminNewTenantData-Oracle.xml" tofile="runtime/tmp/tmpTenantData.xml"/>
        <if>
          <equals arg1="${domainName}" arg2="" />
          <then>
            <replace file="runtime/tmp/tmpTenantData.xml">
               <replacetoken><![CDATA[<TenantDomainName tenantId="@tenantId@" domainName="@domainName@" />]]></replacetoken>
               <replacevalue><![CDATA[]]></replacevalue>
            </replace>
          </then>
        </if>
        <copy file="runtime/tmp/tmpTenantData.xml" tofile="runtime/tmp/tmpFilteredTenantData.xml">
            <filterset>
                <filter token="tenantId" value="${tenantId}"/>
                <filter token="tenantName" value="${tenantName}"/>
                <filter token="db-IP" value="${db-IP}"/>
                <filter token="db-User" value="${db-User}"/>
                <filter token="db-Password" value="${db-Password}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpFilteredTenantData.xml"/>
        </antcall>
        <delete file="runtime/tmp/tmpTenantData.xml"/>
        <delete file="runtime/tmp/tmpFilteredTenantData.xml"/>
        <antcall target="load-tenant-data-readers"/>
        <antcall target="load-tenant-admin-user-login">
            <param name="userLoginId" value="${tenantId}-admin"/>
            <param name="delegatorId" value="default#${tenantId}"/>
        </antcall>
    </target>
    <!-- description="Creates tenant data and instance. Don't forget db driver(s) and already created DBs in function of the entityengine.xml datasource-names"
        sub-target of create-tenant, can't used alone => no description, to not clutter "ant -p" -->
    <target name="create-tenant-on-PostgreSQL" depends="get-tenant-data" if="isPostgreSQL">
        <echo message="Installing on PostgreSQL"/>
        <!-- Below code will handle the case of optional domain name. It will remove the TenantDomainName entry from tmpTenantData.xml file
            if domain name is empty, so that record would not get created. -->
        <copy file="${basedir}/framework/resources/templates/AdminNewTenantData-PostgreSQL.xml" tofile="runtime/tmp/tmpTenantData.xml"/>
        <if>
          <equals arg1="${domainName}" arg2="" />
          <then>
            <replace file="runtime/tmp/tmpTenantData.xml">
               <replacetoken><![CDATA[<TenantDomainName tenantId="@tenantId@" domainName="@domainName@" />]]></replacetoken>
               <replacevalue><![CDATA[]]></replacevalue>
            </replace>
          </then>
        </if>
        <copy file="runtime/tmp/tmpTenantData.xml" tofile="runtime/tmp/tmpFilteredTenantData.xml">
            <filterset>
                <filter token="tenantId" value="${tenantId}"/>
                <filter token="tenantName" value="${tenantName}"/>
                <filter token="db-IP" value="${db-IP}"/>
                <filter token="db-User" value="${db-User}"/>
                <filter token="db-Password" value="${db-Password}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpFilteredTenantData.xml"/>
        </antcall>
        <delete file="runtime/tmp/tmpTenantData.xml"/>
        <delete file="runtime/tmp/tmpFilteredTenantData.xml"/>
        <antcall target="load-tenant-data-readers"/>
        <antcall target="load-tenant-admin-user-login">
            <param name="userLoginId" value="${tenantId}-admin"/>
            <param name="delegatorId" value="default#${tenantId}"/>
        </antcall>
    </target>
    <!-- description="displays tenant data"  sub-target of get-tenant-data, can't used alone => no description, to not clutter "ant -p" -->
    <target name="tenant-data-entry">
        <echo>------------------------------------</echo>
        <echo message="tenantId = ${tenantId}"/>
        <echo>tenantName = ${tenantName}</echo>
        <echo>db-Platform = ${db-Platform}</echo>
        <echo>db-IP = ${db-IP}</echo>
        <echo>db-User = ${db-User}</echo>
        <echo>db-Password = ${db-Password}</echo>
        <echo>------------------------------------</echo>
        <echo>database for tenant data will be 'ofbiz_${tenantId}'</echo>
        <echo>database for tenant olap data will be 'ofbizolap_${tenantId}</echo>
        <echo message="Please make sure that the driver of the platform is installed and that the databases have been created (Check names just above)"/>
        <echo>------------------------------------</echo>
        <input addproperty="continueYN" message="Continue Y or N" validargs="N,n,Y,y"/>

    </target>
    <target name="load-tenant-admin-user-login"
            description="Create the admin login for the tenant with admin privileges, and a temporay password equal to 'ofbiz'. Password must be changed on first login">
        <echo>------------------------------------</echo>
        <echo message="Installing the admin for the tenant"/>
        <echo message="Delegator = ${delegatorId}"/>
        <echo message="Tenant admin = '${userLoginId}'"/>
        <echo message="Password for tenant admin is 'ofbiz' must change on first login"/>
        <echo>------------------------------------</echo>
        <input addproperty="continueYN" message="Continue Y or N" validargs="N,n,Y,y"/>
        <copy file="${basedir}/framework/resources/templates/AdminUserLoginData.xml" tofile="runtime/tmp/tmpUserLogin.xml">
            <filterset>
                <filter token="userLoginId" value="${userLoginId}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpUserLogin.xml"/>
            <param name="delegator" value="${delegatorId}"/>
        </antcall>
        <delete file="runtime/tmp/tmpUserLogin.xml"/>
    </target>
    <target name="load-tenant-data-readers"
            description="Load data of given data-readers in the tenant database. Example: ./ant load-tenant-data-readers -Ddata-readers=seed,seed-initial -DtenantId=demo">
        <echo>------------------------------------</echo>
        <echo message="Loading selected data-readers in tenant database"/>
        <echo message="Delegator = default#${tenantId}"/>
        <echo message="Data-readers = ${data-readers}"/>
        <echo>------------------------------------</echo>
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="install"/>
            <arg value="readers=${data-readers}"/>
            <arg value="delegator=default#${tenantId}"/>
        </java>
    </target>
    <target name="load-admin-user-login"
            description="Create a user login with admin privileges and a temporary password equal to 'ofbiz'; after a successful login the user will be prompted for a new password. Example command for the userLogin 'admin': ./ant load-admin-user-login -DuserLoginId=admin">
        <fail message="userLoginId parameter is required. To add the parameter to the command for user admin: -DuserLoginId=admin">
            <condition>
                <not><isset property="userLoginId"/></not>
            </condition>
        </fail>
        <copy file="${basedir}/framework/resources/templates/AdminUserLoginData.xml" tofile="runtime/tmp/tmpUserLogin.xml">
            <filterset>
                <filter token="userLoginId" value="${userLoginId}"/>
            </filterset>
        </copy>
        <antcall target="load-file">
            <param name="data-file" value="runtime/tmp/tmpUserLogin.xml"/>
        </antcall>
        <delete file="runtime/tmp/tmpUserLogin.xml"/>
    </target>
    <target name="create-admin-user-login"
            description="Prompt for a user name, then create a user login with admin privileges and a temporary password equal to 'ofbiz'. After a successful login the user will be prompted for a new password. Note: this uses load-admin-user-login target">
        <input addproperty="userLoginId" message="Enter user name (log in with the temporary password 'ofbiz'):"/>
        <antcall target="load-admin-user-login"/>
    </target>

    <target name="run-tests"
            description="Run OFBiz default tests; you have to manually execute 'ant load-demo' before and see results in runtime/logs/test-results/html/all-tests.html.">
        <java jar="ofbiz.jar" fork="true" resultproperty="test.result">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="test"/>
            <env key="LC_ALL" value="C"/>
        </java>
        <mkdir dir="runtime/logs/test-results/html"/>
        <junitreport todir="runtime/logs/test-results">
            <fileset dir="runtime/logs/test-results/">
                <include name="*.xml"/>
            </fileset>
            <report format="frames" todir="runtime/logs/test-results/html"/>
        </junitreport>
        <fail message="Test run was unsuccessful">
            <condition>
                <not>
                    <equals arg1="${test.result}" arg2="0"/>
                </not>
            </condition>
        </fail>
    </target>

    <target name="run-tests-with-cobertura" depends="download-cobertura, run-tests"
            description="Download Cobertura and perform code coverage (same as run-tests). You will need a valid Internet connection to download cobertura"/>

    <target name="_check-separated-tests-already-setup">
        <available file="runtime/test-list-build.xml" property="_separated-tests-already-setup"/>
    </target>
    <target name="_setup-separated-test-run" depends="_check-separated-tests-already-setup" unless="_separated-tests-already-setup">
        <java jar="ofbiz.jar" fork="true">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="testlist"/>
            <arg file="runtime/test-list-build.xml"/>
            <arg value="-ant"/>
            <env key="LC_ALL" value="C"/>
        </java>
    </target>
    <target name="run-test"
            description="Run a single test, syntax eg: ant run-test -Dtest.component=service -Dtest.case=service-soap-tests">
        <fail unless="test.component">test.component is a required parameter: -Dtest.component=componentname</fail>
        <fail unless="test.case">test.case is a required parameter: -Dtest.case=testcasename</fail>
        <java jar="ofbiz.jar" fork="true" resultproperty="test.result">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="test"/>
            <arg value="-component=${test.component}"/>
            <arg value="-case=${test.case}"/>
            <env key="LC_ALL" value="C"/>
        </java>
        <delete dir="runtime/logs/test-results/${test.component}-${test.case}"/>
        <mkdir dir="runtime/logs/test-results/${test.component}-${test.case}"/>
        <move todir="runtime/logs/test-results/${test.component}-${test.case}">
            <fileset dir="runtime/logs/test-results" includes="*.xml"/>
        </move>
        <fail message="Test run was unsuccessful">
            <condition>
                <not>
                    <equals arg1="${test.result}" arg2="0"/>
                </not>
            </condition>
        </fail>
    </target>
    <target name="run-test-debug"
            description="Run a single test in debug mode, syntax eg: ant run-test-debug -Dtest.component=service -Dtest.case=service-soap-tests">
        <fail unless="test.component">test.component is a required parameter: -Dtest.component=componentname</fail>
        <fail unless="test.case">test.case is a required parameter: -Dtest.case=testcasename</fail>
        <java jar="ofbiz.jar" fork="true" resultproperty="test.result">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <jvmarg value="-Xnoagent"/>
            <jvmarg value="-Djava.compiler=NONE"/>
            <jvmarg value="-Xdebug"/>
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8091"/>
            <arg value="test"/>
            <arg value="-component=${test.component}"/>
            <arg value="-case=${test.case}"/>
            <env key="LC_ALL" value="C"/>
        </java>
        <delete dir="runtime/logs/test-results/${test.component}-${test.case}"/>
        <mkdir dir="runtime/logs/test-results/${test.component}-${test.case}"/>
        <move todir="runtime/logs/test-results/${test.component}-${test.case}">
            <fileset dir="runtime/logs/test-results" includes="*.xml"/>
        </move>
        <fail message="Test run was unsuccessful">
            <condition>
                <not>
                    <equals arg1="${test.result}" arg2="0"/>
                </not>
            </condition>
        </fail>
    </target>
    <target name="run-test-suite"
            description="Run a single test suite, syntax eg: ant run-test-suite -Dtest.component=mycomponent -Dtest.suiteName=mytests">
        <fail unless="test.component">test.component is a required parameter: -Dtest.component=componentname</fail>
        <fail unless="test.suiteName">test.suiteName is a required parameter: -Dtest.suiteName=testsuitename</fail>
        <java jar="ofbiz.jar" fork="true" resultproperty="test.result">
            <jvmarg value="${memory.initial.param}"/>
            <jvmarg value="${memory.max.param}"/>
            <jvmarg value="${memory.maxpermsize.param}"/>
            <arg value="test"/>
            <arg value="-component=${test.component}"/>
            <arg value="-suitename=${test.suiteName}"/>
            <env key="LC_ALL" value="C"/>
        </java>
        <fail message="Test run was unsuccessful">
            <condition>
                <not>
                    <equals arg1="${test.result}" arg2="0"/>
                </not>
            </condition>
        </fail>
    </target>
    <target name="run-test-list" depends="_setup-separated-test-run"
            description="Run all configured tests, stopping/starting ofbiz between each test">
        <delete dir="runtime/logs/test-results"/>
        <ant antfile="runtime/test-list-build.xml" target="all-tests"/>
    </target>

    <target name="cobertura-report"
            description="Generate a HTML code coverage report with cobertura, can be found in runtime/logs/cobertura-report">
        <delete dir="runtime/logs/cobertura-report"/>
        <mkdir dir="runtime/logs/cobertura-report"/>
        <taskdef resource="tasks.properties">
            <classpath>
                <fileset dir="framework/base/lib">
                    <include name="cobertura-1.9.4.1.jar" />
                    <include name="log4j-1.2.17.jar" />
                    <include name="scripting/asm*.jar" />
                    <include name="scripting/jakarta-oro-2.0.8.jar" />
                </fileset>
            </classpath>
        </taskdef>
        <cobertura-merge datafile="runtime/logs/cobertura.dat">
            <fileset dir="runtime/logs">
                <include name="cobertura-base.dat"/>
                <include name="cobertura-components.dat"/>
            </fileset>
        </cobertura-merge>
        <cobertura-report datafile="runtime/logs/cobertura.dat" destdir="runtime/logs/cobertura-report">
            <dirset dir=".">
                <include name="*/*/src"/>
            </dirset>

            <include name="**/*.java"/>
        </cobertura-report>
    </target>

    <target name="cobertura-report-xml"
            description="Generate a XML file from the cobertura report, this will be use by sonar">
        <delete dir="runtime/logs/cobertura-report"/>
        <mkdir dir="runtime/logs/cobertura-report"/>
        <taskdef resource="tasks.properties">
            <classpath>
                <fileset dir="framework/base/lib">
                    <include name="cobertura-1.9.4.1.jar" />
                    <include name="log4j-1.2.17.jar" />
                    <include name="scripting/asm*.jar" />
                    <include name="scripting/jakarta-oro-2.0.8.jar" />
                </fileset>
            </classpath>
        </taskdef>
        <cobertura-merge datafile="runtime/logs/cobertura.dat">
            <fileset dir="runtime/logs">
                <include name="cobertura-base.dat"/>
                <include name="cobertura-components.dat"/>
            </fileset>
        </cobertura-merge>
        <cobertura-report format="xml" datafile="runtime/logs/cobertura.dat" destdir="runtime/logs/cobertura-report">
            <dirset dir=".">
                <include name="*/*/src"/>
            </dirset>
            <include name="**/*.java"/>
        </cobertura-report>
    </target>

    <target name="sonar" depends="download-sonar-ant-task, sonar-init"
            description="Sonar code analysis. You need a Sonar instance running to use it. More info on http://www.sonarsource.org/">
        <exec executable="svn" dir="." output="runtime/svninfo_tmp.xml">
            <arg value="info"/>
            <arg value="--xml"/>
        </exec>
        <xmlproperty file="runtime/svninfo_tmp.xml"/>

        <property name="sonar.sources" value="specialpurpose/appserver/src, framework/base/src, framework/bi/src,
            framework/catalina/src, framework/common/src, framework/datafile/src, framework/entity/src, framework/entityext/src,
            framework/example/src, framework/geronimo/src, framework/jetty/src,
            framework/minilang/src, framework/security/src, framework/service/src, framework/sql/src, framework/start/src,
            framework/testtools/src, framework/webapp/src, framework/webtools/src, framework/widget/src,
            applications/accounting/src, applications/commonext/src, applications/content/src, applications/humanres/src,
            applications/manufacturing/src, applications/marketing/src, applications/order/src, applications/party/src,
            applications/product/src, applications/securityext/src, applications/workeffort/src, specialpurpose/assetmaint/src,
            specialpurpose/ebay/src, specialpurpose/ebaystore/src, specialpurpose/ecommerce/src, specialpurpose/googlebase/src,
            specialpurpose/googlecheckout/src, specialpurpose/hhfacility/src, specialpurpose/oagis/src, specialpurpose/pos/src,
            specialpurpose/scrum/src, specialpurpose/birt/src" />
        <property name="sonar.tests" value="framework/base/src/org/ofbiz/base/test, framework/entity/src/org/ofbiz/entity/test,
            framework/service/src/org/ofbiz/service/test, framework/sql/src/org/ofbiz/sql/test,
            applications/accounting/src/org/ofbiz/accounting/test, applications/content/src/org/ofbiz/content/test,
            applications/product/src/org/ofbiz/product/test, applications/product/src/org/ofbiz/shipment/test,
            applications/securityext/src/org/ofbiz/securityext/test" />

        <!-- list of optional Sonar properties -->
        <property name="sonar.projectName" value="Apache OFBiz" />
        <sonar:sonar key="org.apache:ofbiz" version="${info.entry.commit(revision)}" xmlns:sonar="antlib:org.sonar.ant:sonar"/>
        <property name="sonar.dynamicAnalysis" value="reuseReports" />
        <property name="sonar.cobertura.reportPath" value="runtime/logs/cobertura-report/coverage.xml"/>
        <property name="sonar.java.source" value="1.7" />
        <property name="sonar.java.target" value="1.7" />
        <!-- default for jdbc url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8-->
        <property name="sonar.jdbc.url" value="${sonar.jdbc.url}"/>
        <property name="sonar.jdbc.driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="sonar.jdbc.username" value="${sonar.jdbc.username}" />
        <property name="sonar.jdbc.password" value="${sonar.jdbc.password}" />

        <!-- SERVER ON A REMOTE HOST -->
        <property name="sonar.host.url" value="${sonar.host.url}" />
    </target>

    <target name="full-sonar">
        <antcall target="clean-all"/>
        <antcall target="load-demo"/>
        <antcall target="run-tests"/>
        <antcall target="cobertura-report-xml"/>
        <antcall target="sonar"/>
    </target>

    <!-- ================================================================== -->
    <!--    Ivy targets, more info at  http://ant.apache.org/ivy/  -->
    <!-- ================================================================== -->

    <target name="download-cobertura" depends="ivy-init">
        <ivy:retrieve pattern="framework/base/lib/[artifact]-[revision].[ext]" conf="cobertura"/>
    </target>

    <target name="download-PG-JDBC" depends="ivy-init" description="Download postgres jdbc driver">
        <ivy:retrieve pattern="framework/entity/lib/jdbc/[artifact]-[revision].[ext]" conf="postgres"/>
    </target>

    <target name="download-sonar-ant-task" depends="ivy-init">
        <ivy:retrieve pattern="framework/base/lib/[artifact]-[revision].[ext]" conf="sonar-ant-task"/>
    </target>

    <target name="download-mySQL-JDBC" depends="ivy-init" description="Download mySQL jdbc driver">
        <ivy:retrieve pattern="framework/entity/lib/jdbc/[artifact]-[revision].[ext]" conf="mysql"/>
    </target>

    <!-- ================================================================== -->
    <!-- Create New Component. This target will create basic directory structure for an OFBiz component in hot-deploy directory. -->
    <!-- ================================================================== -->

    <target name="create-component"
            description="Create the layout of an OFBiz component in the hot-deploy folder.">
        <input addproperty="component-name" message="Component name: (e.g. mycomponent) [Mandatory]"/>
        <input addproperty="component-resource-name" message="Component resource name: (e.g. MyComponent) [Mandatory]"/>
        <input addproperty="webapp-name" message="Webapp name: (e.g. mycomponent) [Mandatory]"/>
        <input addproperty="base-permission" message="Base permission: (e.g. MYCOMPONENT) [Mandatory]"/>
        <echo>The following hot-deploy component will be created:
            Name: ${component-name}
            Resource Name: ${component-resource-name}
            Webapp Name: ${webapp-name}
            Base permission: ${base-permission}
            Folder: ${basedir}/hot-deploy/${component-name}
        </echo>
        <input addproperty="confirm-component-creation" message="Confirm: " defaultvalue="N" validargs="Y,N,y,n"/>
        <fail message="Component creation cancelled by the user.">
            <condition>
                <equals arg1="${confirm-component-creation}" arg2="N" casesensitive="false"/>
            </condition>
        </fail>
        <fail message="Component name is mandatory">
            <condition>
                <equals arg1="${component-name}" arg2="" casesensitive="false" trim="yes"/>
            </condition>
        </fail>
        <fail message="Resource name is mandatory">
            <condition>
                <equals arg1="${component-resource-name}" arg2="" casesensitive="false" trim="yes"/>
            </condition>
        </fail>
        <fail message="Webapp name is mandatory">
            <condition>
                <equals arg1="${webapp-name}" arg2="" casesensitive="false" trim="yes"/>
            </condition>
        </fail>
        <fail message="Base permission is mandatory">
            <condition>
                <equals arg1="${base-permission}" arg2="" casesensitive="false" trim="yes"/>
            </condition>
        </fail>
        <filterset id="replacePlaceholders">
            <filter token="component-name" value="${component-name}"/>
            <filter token="component-resource-name" value="${component-resource-name}"/>
            <filter token="base-permission" value="${base-permission}"/>
            <filter token="webapp-name" value="${webapp-name}"/>
        </filterset>
        <mkdir dir="${basedir}/hot-deploy/${component-name}"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/config"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/data"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/data/helpdata"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/dtd"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/documents"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/entitydef"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/lib"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/patches"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/patches/staging"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/patches/production"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/script"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/servicedef"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/src"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/testdef"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/webapp"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/error"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/WEB-INF"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/WEB-INF/actions"/>
        <mkdir dir="${basedir}/hot-deploy/${component-name}/widget/"/>
        <copy file="${basedir}/framework/resources/templates/ofbiz-component.xml" tofile="${basedir}/hot-deploy/${component-name}/ofbiz-component.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/build.xml" tofile="${basedir}/hot-deploy/${component-name}/build.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/TypeData.xml" tofile="${basedir}/hot-deploy/${component-name}/data/${component-resource-name}TypeData.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/SecurityPermissionSeedData.xml" tofile="${basedir}/hot-deploy/${component-name}/data/${component-resource-name}SecurityPermissionSeedData.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/SecurityGroupDemoData.xml" tofile="${basedir}/hot-deploy/${component-name}/data/${component-resource-name}SecurityGroupDemoData.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/DemoData.xml" tofile="${basedir}/hot-deploy/${component-name}/data/${component-resource-name}DemoData.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/HELP.xml" tofile="${basedir}/hot-deploy/${component-name}/data/helpdata/HELP_${component-resource-name}.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/document.xml" tofile="${basedir}/hot-deploy/${component-name}/documents/${component-resource-name}.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/entitymodel.xml" tofile="${basedir}/hot-deploy/${component-name}/entitydef/entitymodel.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/services.xml" tofile="${basedir}/hot-deploy/${component-name}/servicedef/services.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/Tests.xml" tofile="${basedir}/hot-deploy/${component-name}/testdef/${component-resource-name}Tests.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/UiLabels.xml" tofile="${basedir}/hot-deploy/${component-name}/config/${component-resource-name}UiLabels.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/index.jsp" tofile="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/index.jsp" encoding="iso-8859-1">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/error.jsp" tofile="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/error/error.jsp" encoding="iso-8859-1">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/controller.xml" tofile="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/WEB-INF/controller.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/web.xml" tofile="${basedir}/hot-deploy/${component-name}/webapp/${webapp-name}/WEB-INF/web.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/CommonScreens.xml" tofile="${basedir}/hot-deploy/${component-name}/widget/CommonScreens.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/Screens.xml" tofile="${basedir}/hot-deploy/${component-name}/widget/${component-resource-name}Screens.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/Menus.xml" tofile="${basedir}/hot-deploy/${component-name}/widget/${component-resource-name}Menus.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <copy file="${basedir}/framework/resources/templates/Forms.xml" tofile="${basedir}/hot-deploy/${component-name}/widget/${component-resource-name}Forms.xml" encoding="utf-8">
            <filterset refid="replacePlaceholders"/>
        </copy>
        <echo>Component successfully created in folder ${basedir}/hot-deploy/${component-name}.
            Restart OFBiz and then visit the URL: http://localhost:8080/${webapp-name}
        </echo>
    </target>

    <!-- ================================================================== -->
    <!-- kek helper                                                         -->
    <!-- ================================================================== -->

    <target name="gen-kek"
            description="Generate a new key-encrypting-key for use in entityengine.xml">
        <java classname="org.ofbiz.base.crypto.Main" fork="false">
            <arg value="-kek"/>
            <classpath>
                <path location="framework/base/build/lib/ofbiz-base.jar"/>
                <path location="framework/base/lib/commons/commons-codec-1.10.jar"/>
            </classpath>
        </java>
    </target>

    <!-- ================================================================== -->
    <!-- Old tasks.                                                         -->
    <!-- ================================================================== -->
    <target name="run">
        <echo message="The 'run' command has been renamed 'start'; please use 'ant start' to start OFBiz."/>
    </target>
    <target name="run-debug">
        <echo message="The 'run-debug' command has been renamed 'start-debug'; please use 'ant start-debug' to start OFBiz in debug mode."/>
    </target>
    <target name="run-pos">
        <echo message="The 'run-pos' command has been renamed 'start-pos'; please use 'ant start-pos' to start the OFBiz POS."/>
    </target>
    <target name="run-install">
        <echo message="The 'run-install' command has been renamed 'load-demo'; please use 'ant load-demo' to load seed and demo data."/>
    </target>
    <target name="run-install-multitenant">
        <echo message="The 'run-install-multitenant' command has been renamed 'load-demo-multitenant'; please use 'ant load-demo-multitenant' to load seed and demo data for multi-tenancy."/>
    </target>
    <target name="run-install-seed">
        <echo message="The 'run-install-seed' command has been renamed 'load-seed'; please use 'ant load-seed' to load seed data."/>
    </target>
    <target name="run-install-extseed">
        <echo message="The 'run-install-extseed' command has been renamed 'load-extseed'; please use 'ant load-extseed' to load seed, seed-initial and ext data."/>
    </target>
    <target name="run-install-exttest">
        <echo message="The 'run-install-exttest' command has been renamed 'load-exttest'; please use 'ant load-exttest' to load seed, seed-initial, ext and ext-test data."/>
    </target>
    <target name="run-install-readers">
        <echo message="The 'run-install-readers' command has been renamed 'load-readers'; please use 'ant load-readers' to load data using the command line argument data-readers."/>
    </target>
    <target name="run-install-file">
        <echo message="The 'run-install-file' command has been renamed 'load-file'; please use 'ant load-file' to load data from a given file."/>
    </target>
    <target name="run-install-file-in-delegator">
        <echo message="The 'run-install-file-in-delegator' command has been renamed 'load-file'; please use 'ant load-file' to load data from a given file."/>
    </target>
</project>