Project

General

Profile

« Previous | Next » 

Revision 2599

Refactored the build to use a <path> element for the classpath rather
than ant properties. This makes the classpath easier to manage, but required
changes throughout the build. I think everything should still build fine --
it works for me.

Upgraded the JDBC driver for postgres to the version 8 driver.

Fixed problems with the postgres SQL scripts that were preventing them
from being run from ant. Works for me now, but looks like the oracle
scripts might be missing a few tables from its drop list.

View differences:

build.xml
33 33
  <property environment="env"/>
34 34
  <property file="build.properties"/>  <!-- USER SPECIFIC PROPS -->
35 35

  
36
  <!-- Determine which tomcat we are using and tomcat-specific settings -->
37
  <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
38
    <equals arg1="${tomcatversion}" arg2="tomcat3" />
39
  </condition>
40
  <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
41
    <equals arg1="${tomcatversion}" arg2="tomcat4" />
42
  </condition>
43
  <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
44
    <equals arg1="${tomcatversion}" arg2="tomcat5" />
45
  </condition>
46

  
47
  <path id="compile.classpath">
48
    <pathelement location="${jsdk}"/>
49
    <pathelement location="lib" />
50
    <fileset dir="lib">
51
      <include name="*.jar"/>
52
    </fileset>
53
    <fileset dir="lib/lsid_lib">
54
      <include name="*.jar"/>
55
    </fileset>
56
    <fileset dir="${jdbc_base}">
57
      <include name="classes111.zip"/>
58
      <include name="msbase.jar"/>
59
      <include name="msutil.jar"/>
60
      <include name="mssqlserver.jar"/>
61
    </fileset>
62
  </path>
63

  
36 64
  <target name="check-db">
37 65
    <condition property="use-oracle">
38 66
      <equals arg1="${database}" arg2="oracle" />
......
119 147
      <property name="defaultcontenttype" value="application/octet-stream" />
120 148
      <property name="utilitiesdir" value="../utilities" />
121 149

  
122
      <!-- Make sure these paths match the location of the jar files
123
           on your system, the defaults should usually work -->
124
      <condition property="jsdk" value="${tomcat}/lib/common/servlet.jar">
125
        <equals arg1="${tomcatversion}" arg2="tomcat3" />
126
      </condition>
127
      <condition property="jsdk" value="${tomcat}/common/lib/servlet.jar">
128
        <equals arg1="${tomcatversion}" arg2="tomcat4" />
129
      </condition>
130
      <condition property="jsdk" value="${tomcat}/common/lib/servlet-api.jar">
131
        <equals arg1="${tomcatversion}" arg2="tomcat5" />
132
      </condition>
133 150
      <echo>*********** tomcatversion = ${tomcatversion}</echo>
134 151
      <echo>*********** set jsdk to ${jsdk}</echo>
135
      <property name="xmlp"
136
                value="lib/xercesImpl.jar" />
137
      <property name="cos"
138
                value="lib/cos.jar" />
139
      <property name="morpho"
140
                value="lib/morpho.jar" />
141
      <property name="xalan"
142
                value="lib/xalan/xalan.jar" />
143
      <property name="apis"
144
                value="lib/xalan/xml-apis.jar" />
145
      <property name="httpclient"
146
                value="lib/httpclient.jar" />
147
      <property name="emlparser"
148
                value="lib/eml.jar" />
149
      <property name="configxml"
150
                value="lib/configxml.jar" />
151
      <property name="itislib"
152
                value="lib/itislib.jar" />
153
      <property name="util"
154
                value="lib/utilities.jar" />
155
      <property name="log4j"
156
                value="lib/log4j-1.2.12.jar" />
157 152
  </target>
158 153

  
159 154
   <target name="init" depends="config">
......
244 239
      <filter token="sender"               value="knb-software\@nceas.ucsb.edu"/>
245 240
      <filter token="cgiurl"               value="http://${server}/cgi-bin/ldapweb.cgi"/>
246 241

  
247
      <property name="cpath"
248
                value="${xmlp}:${xalan}:${apis}:${jdbc}:${jsdk}:${cos}:${morpho}:${emlparser}:${jdbc-add1}:${jdbc-add2}:${util}:${httpclient}:${log4j}"/>
249

  
250 242
      <filter token="docrooturl" value="./" />
251 243
      <filter token="database" value="${database}" />
252 244
      <filter token="jdbc-connect" value="${jdbc-connect}"/>
......
321 313
   	  <filter token="timedreplicationinterval" value="${timedreplicationinterval}" />
322 314
      
323 315
   	  <property name="srcdir" value="./src" />
316
   	  <property name="lib.dir" value="./lib" />
324 317
      <property name="testdir" value="./test" />
325 318
      <property name="testtorun" value="BuildIndexTest" />
326 319
      <property name="junittestsdir" value="./test/edu/ucsb/nceas/metacattest" />
......
360 353
          <not><available file="lib/dtd/eml-dataset-2.0.0beta6.dtd"/></not>
361 354
        </or>
362 355
      </condition>
356

  
363 357
   </target>
364 358

  
365 359
   <target name="prepare" depends="init">
......
387 381

  
388 382
       <javac srcdir="${build.src}"
389 383
              destdir="${build.dest}"
390
              classpath="${cpath}"
391 384
              debug="${debug}"
392
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java"/>
385
              excludes="**/*.sql **/stringclient/** **/client/*.java **/harvesterClient/*.java">
386
        <classpath>
387
          <path refid="compile.classpath"/>
388
        </classpath>
389
      </javac>
393 390
   </target>
394 391

  
395 392
   <target name="jar" depends="compile,geteml"
......
426 423
    description="Compiles metacat-client java code to build dir">
427 424
       <javac srcdir="${build.src}"
428 425
              destdir="${build.dest}"
429
              classpath="${cpath}"
430
              includes="edu/ucsb/nceas/metacat/client/*" />
426
              includes="edu/ucsb/nceas/metacat/client/*">
427
          <classpath>
428
            <path refid="compile.classpath"/>
429
          </classpath>
430
        </javac>
431 431
   </target>
432 432

  
433 433
   <target name="clientjar" depends="client"
......
439 439

  
440 440
   <target name="harvester" depends="client"
441 441
           description="Compiles harvester java code to build dir">
442
       <echo message="classpath is:   ${cpath}"/>
443 442
       <javac srcdir="${build.src}"
444 443
              destdir="${build.dest}"
445
              classpath="${cpath}"
446
              includes="edu/ucsb/nceas/metacat/harvesterClient/*" />
444
              includes="edu/ucsb/nceas/metacat/harvesterClient/*">
445
          <classpath>
446
            <path refid="compile.classpath"/>
447
          </classpath>
448
        </javac>
447 449
   </target>
448 450

  
449 451
   <target name="harvesterjar" depends="harvester"
......
565 567
     <echo/>
566 568
     <echo>Registering the Schemas with the new Metacat instance...</echo>
567 569
     <sql driver="${dbDriver}"
568
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
569 570
          url="${jdbc-connect}"
570 571
          userid="${user}"
571 572
          password="${password}"
572
          src="${build.src}/loaddtdschema.sql" />
573
          src="${build.src}/loaddtdschema.sql">
574
       <classpath>
575
         <path refid="compile.classpath"/>
576
       </classpath>
577
     </sql>
573 578
   </target>
574 579

  
575 580
   <target name="installdb" depends="prepare"
......
577 582
     <echo/>
578 583
     <echo>Installing the database tables...</echo>
579 584
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
585
     <echo/>
580 586
     <sql driver="${dbDriver}"
581
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
582 587
          url="${jdbc-connect}"
583 588
          userid="${user}"
584 589
          password="${password}"
585
          src="${build.src}/${install-sql}" />
590
          src="${build.src}/${install-sql}">
591
       <classpath>
592
         <path refid="compile.classpath"/>
593
       </classpath>
594
     </sql>
586 595
   </target>
587 596

  
597
   <target name="dropdb" depends="prepare"
598
            description="WARNING: Drops the database tables">
599
     <echo/>
600
     <echo>Dropping the database tables...</echo>
601
     <echo>In case of failure, run the sql script manually. Look at Metacat install instructions for more details</echo>
602
     <echo/>
603
     <sql driver="${dbDriver}"
604
          url="${jdbc-connect}"
605
          userid="${user}"
606
          password="${password}"
607
          src="${build.src}/drop-postgres.sql">
608
       <classpath>
609
         <path refid="compile.classpath"/>
610
       </classpath>
611
     </sql>
612
   </target>
613

  
588 614
   <target name="upgrade12" depends="prepare"
589 615
            description="Updates the database tables to upgrade to version 1.2">
590 616
     <echo/>
591 617
     <echo>Updating the database tables to upgrade to version 1.2...</echo>
592 618
     <sql driver="${dbDriver}"
593
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
594 619
          url="${jdbc-connect}"
595 620
          userid="${user}"
596 621
          password="${password}"
597
          src="${build.src}/${upgrade-1.2-sql}" />
622
          src="${build.src}/${upgrade-1.2-sql}">
623
       <classpath>
624
         <path refid="compile.classpath"/>
625
       </classpath>
626
     </sql>
598 627
   </target>
599 628

  
600 629
   <target name="upgrade13" depends="prepare"
......
602 631
     <echo/>
603 632
     <echo>Updating the database tables to upgrade to version 1.3...</echo>
604 633
     <sql driver="${dbDriver}"
605
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
606 634
          url="${jdbc-connect}"
607 635
          userid="${user}"
608 636
          password="${password}"
609
          src="${build.src}/${upgrade-1.3-sql}" />
637
          src="${build.src}/${upgrade-1.3-sql}">
638
       <classpath>
639
         <path refid="compile.classpath"/>
640
       </classpath>
641
     </sql>
610 642
   </target>
611 643

  
612 644
   <target name="upgrade14" depends="prepare"
......
614 646
     <echo/>
615 647
     <echo>Updating the database tables to upgrade to version 1.4...</echo>
616 648
     <sql driver="${dbDriver}"
617
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
618 649
          url="${jdbc-connect}"
619 650
          userid="${user}"
620 651
          password="${password}"
621
          src="${build.src}/${upgrade-1.4-sql}" />
652
          src="${build.src}/${upgrade-1.4-sql}">
653
       <classpath>
654
         <path refid="compile.classpath"/>
655
       </classpath>
656
     </sql>
622 657
   </target>
623 658

  
624 659
   <target name="upgrade15" depends="sqlupgrade15"
......
630 665

  
631 666
     <javac srcdir="${build.tmp}"
632 667
            destdir="${build.tmp}"
633
            classpath="${cpath}"
634 668
            debug="${debug}"
635
            includes="upgrade_db_to_1_5.java"/>
669
            includes="upgrade_db_to_1_5.java">
670
       <classpath>
671
         <path refid="compile.classpath"/>
672
       </classpath>
673
     </javac>
636 674

  
637
     <java classname="upgrade_db_to_1_5"
638
           classpath="${cpath}:${build.tmp}"/>
675
     <java classname="upgrade_db_to_1_5">
676
       <classpath>
677
         <path refid="compile.classpath"/>
678
         <fileset dir="${build.tmp}"/>
679
       </classpath>
680
     </java>
639 681

  
640 682
   </target>
641 683

  
......
644 686
     <echo/>
645 687
     <echo>Updating the database tables to upgrade to version 1.6...</echo>
646 688
     <sql driver="${dbDriver}"
647
          classpath="${jdbc}:${jdbc-add1}:${jdbc-add2}"
648 689
          url="${jdbc-connect}"
649 690
          userid="${user}"
650 691
          password="${password}"
651
          src="${build.src}/${upgrade-1.6-sql}" />
692
          src="${build.src}/${upgrade-1.6-sql}">
693
       <classpath>
694
         <path refid="compile.classpath"/>
695
       </classpath>
696
     </sql>
652 697
   </target>
653 698

  
654 699

  
......
818 863
           <include name="*.jar"/>
819 864
         </fileset>
820 865
       </copy>
821
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
822 866
       <copy file="lib/web.xml.${tomcatversion}"
823 867
             tofile="${build.war}/web.xml" />
824 868
       <copy file="lib/metacat.properties" todir="${war.webinf}"
......
885 929
      <!-- copy and compile the tests into a jar file -->
886 930
      <javac srcdir="${build.tests}"
887 931
             destdir="${build.tests}"
888
             classpath="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar"
889 932
             debug="on"
890
       includes="**/*.java" />
933
       includes="**/*.java">
934
        <classpath>
935
          <path refid="compile.classpath"/>
936
          <fileset dir="${build.dir}">
937
            <includes name="${name}.jar"/>
938
            <includes name="${name}-client.jar"/>
939
            <includes name="harvester.jar"/>
940
          </fileset>
941
        </classpath>
942
      </javac>
891 943

  
892 944
      <jar jarfile="${build.dir}/${name}-junittests.jar"
893 945
        basedir="${build.tests}"
......
902 954
             haltonerror="no">
903 955
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
904 956
        <classpath>
905
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
957
          <path refid="compile.classpath"/>
958
          <fileset dir="${build.dir}">
959
            <includes name="${name}.jar"/>
960
            <includes name="${name}-client.jar"/>
961
            <includes name="harvester.jar"/>
962
            <includes name="${name}-junittests.jar"/>
963
          </fileset>
906 964
        </classpath>
907 965

  
908 966
        <formatter type="plain" />
......
925 983
             haltonerror="no">
926 984
        <!--<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>-->
927 985
        <classpath>
928
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/${name}-junittests.jar" />
986
          <path refid="compile.classpath"/>
987
          <fileset dir="${build.dir}">
988
            <includes name="${name}.jar"/>
989
            <includes name="${name}-client.jar"/>
990
            <includes name="harvester.jar"/>
991
            <includes name="${name}-junittests.jar"/>
992
          </fileset>
929 993
        </classpath>
930 994

  
931 995
        <formatter type="plain" />
......
945 1009
            haltonfailure="off"
946 1010
            fork="yes"
947 1011
            haltonerror="off">
948
       <classpath>
949
         <pathelement path="${cpath}:${build.dir}/${name}.jar:${build.dir}/${name}-client.jar:${build.dir}/harvester.jar:${build.dir}/${name}-junittests.jar" />
950
       </classpath>
1012
        <classpath>
1013
          <path refid="compile.classpath"/>
1014
          <fileset dir="${build.dir}">
1015
            <includes name="${name}.jar"/>
1016
            <includes name="${name}-client.jar"/>
1017
            <includes name="harvester.jar"/>
1018
            <includes name="${name}-junittests.jar"/>
1019
          </fileset>
1020
        </classpath>
951 1021
       <formatter type="plain" />
952 1022
       <batchtest fork="yes" todir="${build.dir}">
953 1023
         <fileset dir="${build.tests}">
......
978 1048
      <mkdir dir="${build.metacatnettest}"/>
979 1049
      <javac srcdir="${junitnettestsdir}"
980 1050
             destdir="${build.metacatnettest}"
981
             classpath="${cpath}:${build.dir}/${name}.jar:${httpclient}"
982
             includes="**/*.java" />
1051
             includes="**/*.java">
1052
        <classpath>
1053
          <path refid="compile.classpath"/>
1054
          <fileset dir="${build.dir}">
1055
            <includes name="${name}.jar"/>
1056
          </fileset>
1057
        </classpath>
1058
      </javac>
983 1059

  
984 1060
      <jar jarfile="${build.dir}/${name}-junitnettests.jar"
985 1061
                    basedir="${build.metacatnettest}"
......
990 1066
             haltonerror="no">
991 1067
        <jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
992 1068
        <classpath>
993
          <pathelement path="${cpath}:${build.dir}/${name}.jar:${httpclient}:${build.dir}/${name}-junitnettests.jar:${itislib}" />
1069
          <path refid="compile.classpath"/>
1070
          <fileset dir="${build.dir}">
1071
            <includes name="${name}.jar"/>
1072
            <includes name="${name}-junitnettests.jar"/>
1073
          </fileset>
994 1074
        </classpath>
995 1075

  
996 1076
        <formatter type="plain" />
......
1032 1112
       <javadoc packagenames="edu.ucsb.nceas.*"
1033 1113
           sourcepath="${build.src}"
1034 1114
           destdir="${build.javadocs}"
1035
           classpath="${cpath}"
1036 1115
           author="true"
1037 1116
           version="true"
1038 1117
           use="true"
1039 1118
           windowtitle="${Name} API"
1040 1119
           doctitle="&lt;h1&gt;${Name}&lt;/h1&gt;"
1041
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;"
1042
       />
1120
           bottom="&lt;i&gt;Copyright &#169; 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.&lt;/i&gt;">
1121
         <classpath>
1122
           <path refid="compile.classpath"/>
1123
         </classpath>
1124
       </javadoc>
1043 1125
   </target>
1044 1126

  
1045 1127
   <target name="dist"

Also available in: Unified diff