       1 <?xml version='1.0' encoding='ISO-8859-1' ?>
       2 <!--
       3   Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
       4   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5
       6   This code is free software; you can redistribute it and/or modify it
       7   under the terms of the GNU General Public License version 2 only, as
       8   published by the Free Software Foundation.  Oracle designates this
       9   particular file as subject to the "Classpath" exception as provided
      10   by Oracle in the LICENSE file that accompanied this code.
      11
      12   This code is distributed in the hope that it will be useful, but WITHOUT
      13   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      14   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      15   version 2 for more details (a copy is included in the LICENSE file that
      16   accompanied this code).
      17
      18   You should have received a copy of the GNU General Public License version
      19   2 along with this work; if not, write to the Free Software Foundation,
      20   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
      21
      22   Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
      23   or visit www.oracle.com if you need additional information or have any
      24   questions.
      25 -->
      26 <project name="jtharness" default="build" basedir="..">
      27
      28     <import file="build-i18ncheck.xml"/>
      29     <import file="check-dependencies.xml"/>
      30
      31     <property file="build/local.properties"/>
      32     <property file="build/build.properties"/>
      33
      34     <import file="jtlite/build-jtlite.xml"/>
      35
      36     <property environment="env"/>
      37
      38     <patternset id="helpset">
      39         <include name="**/*.hs"/>
      40         <include name="**/default/**"/>
      41         <include name="**/images/**"/>
      42         <exclude name="com/sun/javatest/tool/images/spl_*.gif"/>
      43     </patternset>
      44
      45     <target name="build" depends="dist" description="Creates the build-distribution."/>
      46
      47     <target name="clean" description="Removes the entire build-distribution directory.">
      48         <delete dir="${BUILD_DIR}"/>
      49     </target>
      50
      51     <target name="stamp" description="Set up build time properties.">
      52         <tstamp>
      53             <format property="build.date" pattern="MMMMM dd, yyyy" locale="en"/>
      54             <format property="build.date.time" pattern="MMMMM dd, yyyy hh:mm aa" locale="en"/>
      55         </tstamp>
      56
      57     </target>
      58
      59     <presetdef name="buildinfo">
      60         <echo file="${build.classes}/META-INF/buildInfo.txt"># Build info
      61             date=${build.date}
      62             version=${build.version}
      63             milestone=${build.milestone}
      64             build=${build.number}
      65             java=Java(TM) 2 SDK, Version ${java.version}
      66             bundle-type=Classpath Loader
      67             harness-variety=Full Bundle
      68         </echo>
      69     </presetdef>
      70
      71     <!-- ********** JT Harness *********************************************** -->
      72
      73     <property name="src.javatest.help" location="${src.dir}/com/sun/javatest/help"/>
      74     <property name="src.javatestAgent.help" location="${src.dir}/com/sun/javatest/agent/help"/>
      75     <!--
      76     <property name="src.javatest.help" location="${doc.dir}/javatest/help"/>
      77     <property name="src.javatestAgent.help" location="${doc.dir}/javatest/agent/help"/>
      78     -->
      79     <property name="build.javatest.help" location="${build.classes}/com/sun/javatest/help"/>
      80     <property name="build.javatestAgent.help" location="${build.classes}/com/sun/javatest/agent/help"/>
      81
      82     <patternset id="interview.resources">
      83         <include name="com/sun/interview/**/*.properties"/>
      84         <include name="com/sun/interview/wizard/*.gif"/>
      85         <include name="com/sun/interview/wizard/selectiontree/resources/*.gif"/>
      86     </patternset>
      87
      88     <patternset id="javatest.resources">
      89         <include name="com/sun/javatest/**/*.properties"/>
      90         <include name="com/sun/javatest/**/*.xsd"/>
      91         <include name="com/sun/javatest/**/*.gif"/>
      92         <include name="com/sun/javatest/**/*.css"/>
      93         <exclude name="com/sun/javatest/tool/images/spl_*.gif"/>
      94     </patternset>
      95
      96     <patternset id="javatest.junit.resources">
      97         <include name="com/sun/javatest/junit/**/*.properties"/>
      98     </patternset>
      99
     100     <patternset id="javatest.packages">
     101         <include name="com/sun/interview/**"/>
     102         <include name="com/sun/javatest/**"/>
     103         <exclude name="com/sun/javatest/junit/**"/>
     104         <exclude name="com/sun/javatest/agent/SerialPort*.java" unless="jcomm.present"/>
     105         <exclude name="com/sun/javatest/servlets/*.java" unless="servlet.present"/>
     106     </patternset>
     107
     108         <patternset id="test.packages">
     109                 <include name="com/sun/jct/utils/copyrightcheck/**" />
     110         </patternset>
     111
     112     <patternset id="javatest.jdk11.files">
     113         <include name="com/sun/javatest/Command.java"/>
     114         <include name="com/sun/javatest/JavaTestSecurityManager.java"/>
     115         <include name="com/sun/javatest/ProductInfo.java"/>
     116         <include name="com/sun/javatest/Test.java"/>
     117         <include name="com/sun/javatest/Status.java "/>
     118         <include name="com/sun/javatest/tool/Main.java "/>
     119         <include name="com/sun/javatest/agent/*.java"/>
     120         <exclude name="com/sun/javatest/agent/AgentClassLoader2.java"/>
     121         <exclude name="com/sun/javatest/agent/AgentMonitorCommandManager.java"/>
     122         <exclude name="com/sun/javatest/agent/AgentMonitorBatchCommandManager.java"/>
     123         <exclude name="com/sun/javatest/agent/AgentMonitorTool.java"/>
     124         <exclude name="com/sun/javatest/agent/AgentMonitorToolManager.java"/>
     125         <include name="com/sun/javatest/util/*.java"/>
     126         <include name="com/sun/javatest/util/FileInfoCache.java"/>
     127         <include name="com/sun/javatest/util/ReadAheadIterator.java"/>
     128     </patternset>
     129
     130     <patternset id="javatest.junit.packages">
     131         <include name="com/sun/javatest/junit/**"/>
     132     </patternset>
     133
     134     <target name="dist" depends="jar,jar.junit,dist.doc,build-examples,lite,test-copyrights" description="Creates the build-distribution.">
     135         <property name="zip.prefix" value="jtharness-${build.version}"/>
     136         <property name="zip.root" location="${BUILD_DIR}/tmp/zip/${zip.prefix}"/>
     137
     138         <mkdir dir="${zip.root}"/>
     139         <copy todir="${zip.root}">
     140             <fileset dir="${BUILD_DIR}/binaries"/>
     141         </copy>
     142
     143         <mkdir dir="${BUILD_DIR}/bundles"/>
     144         <zip destfile="${BUILD_DIR}/bundles/${zip.prefix}.zip" filesOnly="true"
     145              basedir="${zip.root}/.." excludes="${zip.prefix}/examples/*, ${zip.prefix}/examples/"/>
     146         <zip destfile="${BUILD_DIR}/bundles/${zip.prefix}-examples.zip" filesOnly="true"
     147              basedir="${zip.root}/.."
     148              includes="${zip.prefix}/examples, ${zip.prefix}/examples/**, ${zip.prefix}/legal/*,
     149                        ${zip.prefix}/ReleaseNotes-jtharness.html"
     150              excludes="${zip.prefix}/examples/**/*.jar"/>
     151     </target>
     152
     153     <target name="dist.doc" depends="javadoc">
     154         <property name="target.legal.dir" value="${BUILD_DIR}/binaries/legal"/>
     155         <mkdir dir="${target.legal.dir}"/>
     156         <copy todir="${target.legal.dir}">
     157             <fileset dir="${legal.dir}"/>
     158         </copy>
     159
     160         <property name="target.doc.dir" value="${BUILD_DIR}/binaries/doc"/>
     161         <mkdir dir="${target.doc.dir}"/>
     162         <copy todir="${target.doc.dir}">
     163             <fileset dir="${doc.dir}">
     164                 <include name="classDepLists/**"/>
     165             </fileset>
     166         </copy>
     167
     168         <property name="target.docshare.dir" value="${BUILD_DIR}/binaries/doc/shared"/>
     169         <mkdir dir="${target.doc.dir}/shared"/>
     170         <copy todir="${target.doc.dir}/shared">
     171             <fileset dir="${doc.dir}/deliverables/shared"/>
     172         </copy>
     173
     174         <property name="target.javadoc.dir" value="${target.doc.dir}/api"/>
     175         <mkdir dir="${target.javadoc.dir}"/>
     176         <copy todir="${target.javadoc.dir}">
     177             <fileset dir="${javadoc.dir}"/>
     178         </copy>
     179
     180         <!-- API docs -->
     181         <property name="target.javadoc.dir" value="${target.doc.dir}/api"/>
     182         <mkdir dir="${target.javadoc.dir}"/>
     183         <copy todir="${target.javadoc.dir}">
     184             <fileset dir="${javadoc.dir}"/>
     185         </copy>
     186
     187         <!-- copy to top of binary -->
     188         <copy todir="${BUILD_DIR}/binaries/">
     189             <fileset dir="${doc.dir}/deliverables">
     190                 <include name="ReleaseNotes-jtharness.html"/>
     191             </fileset>
     192         </copy>
     193
     194         <replace file="${BUILD_DIR}/binaries/ReleaseNotes-jtharness.html">
     195            <replacetoken><![CDATA[href="../../legal/copyright.txt"]]></replacetoken>
     196            <replacevalue><![CDATA[href="legal/copyright.txt"]]></replacevalue>
     197         </replace>
     198
     199         <replace file="${BUILD_DIR}/binaries/ReleaseNotes-jtharness.html">
     200            <replacetoken><![CDATA[href="../../document.css"]]></replacetoken>
     201            <replacevalue><![CDATA[href="doc/document.css"]]></replacevalue>
     202         </replace>
     203
     204         <replace file="${BUILD_DIR}/binaries/ReleaseNotes-jtharness.html"
     205                 token="BUILD_VERSION"
     206                 value="${build.version}"/>
     207
     208     <replace file="${BUILD_DIR}/binaries/ReleaseNotes-jtharness.html"
     209              token="BUILD_DATE"
     210              value="${build.date}"/>
     211
     212         <!-- clone release notes as index.html for convenience -->
     213         <copy tofile="${BUILD_DIR}/binaries/index.html"
     214               file="${BUILD_DIR}/binaries/ReleaseNotes-jtharness.html"/>
     215
     216         <!-- copy to doc/ directory -->
     217         <copy todir="${BUILD_DIR}/binaries/doc">
     218             <fileset dir="${doc.dir}/deliverables">
     219                 <include name="junit.html"/>
     220                 <include name="document.css"/>
     221             </fileset>
     222         </copy>
     223
     224
     225     </target>
     226
     227     <!-- JAR Section -->
     228
     229     <target name="jar" depends="jar.check,stamp" unless="javatest.jar.ok" description="Build JAR.">
     230         <mkdir dir="${BUILD_DIR}/binaries/lib"/>
     231         <jar destfile="${BUILD_DIR}/binaries/lib/javatest.jar" basedir="${build.classes}" index="false">
     232             <manifest>
     233                 <attribute name="Built-By"   value="${user.name}"/>
     234                 <attribute name="Main-Class" value="${run.class}"/>
     235             </manifest>
     236             <include name="META-INF/buildInfo.txt"/>
     237             <include name="copyright.txt"/>
     238             <include name="META-INF/services/com.sun.javatest.tool.*.lst"/>
     239             <include name="META-INF/services/com.sun.javatest.report.ReportFormat"/>
     240             <patternset refid="javatest.packages"/>
     241         </jar>
     242     </target>
     243
     244     <target name="jar.check" depends="compile">
     245         <dependset>
     246             <srcfileset dir="${build.classes}">
     247                 <include name="META-INF/services/com.sun.javatest.tool.*.lst"/>
     248                 <include name="META-INF/services/com.sun.javatest.report.ReportFormat"/>
     249                 <patternset refid="javatest.packages"/>
     250             </srcfileset>
     251             <targetfilelist dir="${BUILD_DIR}/binaries/lib" files="javatest.jar"/>
     252         </dependset>
     253         <available property="javatest.jar.ok" file="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     254     </target>
     255
     256     <!-- JAR - JUnit Support Section -->
     257
     258     <target name="jar.junit" depends="jar.junit.check,stamp" if="jar.junit.dependencies.present" unless="jt-junit.jar.ok" description="Build JUnit JAR.">
     259         <mkdir dir="${BUILD_DIR}/binaries/lib"/>
     260         <jar destfile="${BUILD_DIR}/binaries/lib/jt-junit.jar" basedir="${build.junit.classes}" index="false">
     261             <manifest>
     262                 <attribute name="Built-By"   value="${user.name}"/>
     263             </manifest>
     264             <include name="META-INF/buildInfo.txt"/>
     265             <include name="copyright.txt"/>
     266             <patternset refid="javatest.junit.packages"/>
     267         </jar>
     268     </target>
     269
     270     <target name="jar.junit.check" if="jar.junit.dependencies.present" depends="compile.junit.classes">
     271         <dependset>
     272             <srcfileset dir="${build.junit.classes}">
     273                 <patternset refid="javatest.junit.packages"/>
     274             </srcfileset>
     275             <targetfilelist dir="${BUILD_DIR}/binaries/lib" files="jt-junit.jar"/>
     276         </dependset>
     277         <available property="jt-junit.jar.ok" file="${BUILD_DIR}/binaries/lib/jt-junit.jar"/>
     278     </target>
     279
     280     <!-- Compilation Section -->
     281
     282     <target name="compile" depends="verify-dependencies, compile.classes,compile.resources,compile-javatest.help" description="Compile project."/>
     283
     284     <target name="compile.classes">
     285
     286         <delete dir="${build.classes}" quiet="true"/>
     287         <mkdir dir="${build.classes}"/>
     288         <javac encoding="iso-8859-1" debug="true" source="1.7" target="1.7"
     289                srcdir="${src.dir}"
     290                sourcepath=""
     291                destdir="${build.classes}"
     292                classpath="${jdk14.classpath}:${jcommjar}">
     293             <patternset refid="javatest.packages"/>
     294             <compilerarg value="-version"/>
     295             <compilerarg value="-Xlint:rawtypes"/>
     296             <compilerarg value="-Xlint:cast"/>
     297         </javac>
     298         <copy todir="${build.classes}">
     299             <fileset dir="${legal.dir}">
     300                 <include name="copyright.txt"/>
     301             </fileset>
     302         </copy>
     303
     304     </target>
     305
     306     <target name="compile.test.copyright.classes">
     307         <mkdir dir="${build.classes}"/>
     308         <javac encoding="iso-8859-1" debug="true" source="1.7" target="1.7"
     309                srcdir="${test.dir}"
     310                destdir="${build.classes}"
     311                classpath="${jdk14.classpath}">
     312             <patternset refid="test.packages"/>
     313             <compilerarg value="-version"/>
     314             <compilerarg value="-Xlint:rawtypes"/>
     315             <compilerarg value="-Xlint:cast"/>
     316                 </javac>
     317         </target>
     318
     319     <target name="compile.junit.classes" if="jar.junit.dependencies.present" depends="verify-dependencies, compile.classes,compile.junit.resources">
     320         <mkdir dir="${build.junit.classes}"/>
     321         <javac encoding="iso-8859-1" debug="true" source="1.7" target="1.7"
     322                srcdir="${src.dir}"
     323                destdir="${build.junit.classes}"
     324                classpath="${jdk14.classpath}:${build.classes}:${asmjar}:${asmcommonsjar}:${junitlib}">
     325             <patternset refid="javatest.junit.packages"/>
     326             <compilerarg value="-version"/>
     327             <compilerarg value="-Xlint:rawtypes"/>
     328             <compilerarg value="-Xlint:cast"/>
     329         </javac>
     330
     331         <copy todir="${build.junit.classes}">
     332             <fileset dir="${legal.dir}">
     333                 <include name="copyright.txt"/>
     334             </fileset>
     335         </copy>
     336
     337     </target>
     338
     339     <target name="compile-javatest.help" depends="compile-javatest.help.main,compile-javatestAgent.help"/>
     340
     341     <target name="compile.resources" depends="stamp">
     342         <copy todir="${build.classes}">
     343             <fileset dir="${src.dir}">
     344                 <patternset refid="interview.resources"/>
     345                 <patternset refid="javatest.resources"/>
     346             </fileset>
     347         </copy>
     348         <mkdir dir="${build.classes}/META-INF/"/>
     349         <buildinfo/>
     350         <copy file="${src.dir}/com/sun/javatest/tool/i18n.properties"
     351               tofile="${build.classes}/com/sun/javatest/tool/i18n_fr.properties"/>
     352         <mkdir dir="${build.classes}/META-INF/services"/>
     353         <copy file="${build.dir}/JavaTest.cmdMgrs.lst" tofile="${build.classes}/META-INF/services/com.sun.javatest.tool.CommandManager.lst"/>
     354         <copy file="${build.dir}/JavaTest.toolMgrs.lst" tofile="${build.classes}/META-INF/services/com.sun.javatest.tool.ToolManager.lst"/>
     355         <copy file="${build.dir}/com.sun.javatest.report.ReportFormat" tofile="${build.classes}/META-INF/services/com.sun.javatest.report.ReportFormat"/>
     356     </target>
     357
     358     <target name="compile.junit.resources" if="jar.junit.dependencies.present" depends="stamp">
     359         <copy todir="${build.junit.classes}">
     360             <fileset dir="${src.dir}">
     361                 <patternset refid="javatest.junit.resources"/>
     362             </fileset>
     363         </copy>
     364         <mkdir dir="${build.classes}/META-INF/"/>
     365         <buildinfo/>
     366     </target>
     367
     368
     369     <target name="run" depends="compile" description="Run application.">
     370         <fail unless="run.class">${run.class.missing}</fail>
     371         <java fork="true" classname="${run.class}">
     372             <classpath>
     373                 <path path="${run.classpath}"/>
     374             </classpath>
     375         </java>
     376     </target>
     377
     378     <target name="javadoc" description="Creates API documentation for the JT Harness source.">
     379         <condition property="javadoc.add" value="${javadoc.additionalparam} -Xdoclint:none" else="${javadoc.additionalparam}">
     380             <or>
     381                 <contains string="${java.version}" substring="1.8" />
     382                 <matches pattern="^9.*" string="${java.version}"/>
     383             </or>
     384         </condition>
     385
     386         <mkdir dir="${javadoc.dir}"/>
     387         <javadoc destdir="${javadoc.dir}" encoding="${javadoc.encoding}" notree="${javadoc.notree}" use="${javadoc.use}"
     388                  nonavbar="${javadoc.nonavbar}"
     389                  noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}"
     390                  version="${javadoc.version}"
     391                  windowtitle="${javadoc.windowtitle}" private="${javadoc.private}"
     392                  additionalparam="${javadoc.add}" failonerror="true"
     393                  useexternalfile="true">
     394             <classpath>
     395                 <path path="${jcommjar}:${ant.home}/lib/ant.jar"/>
     396             </classpath>
     397             <sourcepath>
     398                 <pathelement location="${src.dir}"/>
     399             </sourcepath>
     400             <bottom><![CDATA[ ${javadoc.footer} ]]></bottom>
     401             <!-- list of packages with useful development doc -->
     402             <!-- expand if desired -->
     403             <package name="com.sun.javatest" />
     404             <package name="com.sun.interview" />
     405             <package name="com.sun.javatest.interview" />
     406             <package name="com.sun.javatest.finder" />
     407             <package name="com.sun.javatest.lib" />
     408             <package name="com.sun.javatest.util" />
     409             <package name="com.sun.javatest.tool" />
     410             <package name="com.sun.javatest.exec" />
     411             <package name="com.sun.javatest.report" />
     412         </javadoc>
     413     </target>
     414
     415     <target name="test" depends="jar,test-nohead,test-i18n,test-copyrights,test-sanity" description="Runs test on JT Harness.">
     416         <java fork="true" failonerror="true" classname="${run.class}">
     417             <classpath>
     418                 <path path="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     419             </classpath>
     420             <arg value="-version"/>
     421         </java>
     422     </target>
     423
     424         <target name="test-sanity" depends="test-sanity-version,test-sanity-simpletck" />
     425
     426         <target name="test-sanity-version" depends="jar">
     427                 <java fork="true" failonerror="false" classname="${run.class}"
     428                         outputproperty="test.sanity.version.output"
     429                         resultproperty="test.sanity.version.result">
     430                         <classpath>
     431                                 <path path="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     432                         </classpath>
     433                         <arg value="-version"/>
     434                 </java>
     435
     436                 <property name="test-sanity-version-pattern" value="JT Harness, version ${build.version}.*\nCopyright \(C\) 1996-[0-9][0-9][0-9][0-9] Sun Microsystems, Inc\. All rights reserved" />
     437
     438                 <condition property="test.sanity.version.success">
     439                         <and>
     440                                 <equals arg1="${test.sanity.version.result}" arg2="0" />
     441                                 <!--<matches singleline="true" string="${test.sanity.version.output}" pattern="${test-sanity-version-pattern}" />-->
     442                         </and>
     443                 </condition>
     444                 <fail unless="test.sanity.version.success">
     445                         "java ${run.class} -version" exited with code "${test.sanity.version.result}"
     446
     447                         The output:
     448                         ${test.sanity.version.output}
     449
     450                         Pattern: ${test-sanity-version-pattern}</fail>
     451         </target>
     452
     453         <target name="test-sanity-simpletck" depends="jar,build-examples">
     454                 <property name="libs" value="${BUILD_DIR}/binaries/examples/tutorial/demots/lib" />
     455                 <delete dir="${build.tmp}/sanity-demo-wd" />
     456                 <java fork="true" failonerror="false" jar="${BUILD_DIR}/binaries/lib/javatest.jar"
     457                         outputproperty="test.sanity.simpletck.output"
     458                         resultproperty="test.sanity.simpletck.result">
     459                         <classpath>
     460                                 <path path="${libs}/demots.jar" />
     461                                 <path path="${libs}/demoapi.jar" />
     462                         </classpath>
     463                         <arg line="-verbose:max -ts ${BUILD_DIR}/binaries/examples/tutorial/demots/ -wd -create ${build.tmp}/sanity-demo-wd -config ${libs}/demots.jti -set demoTS.jvm ${java.home}/bin/java -excludelist lib/demo.jtx -runtests -writeReport report" />
     464                 </java>
     465
     466                 <property name="test-sanity-simpletck-pattern" value="Test results: passed: 16" />
     467
     468                 <condition property="test.sanity.simpletck.success">
     469                         <and>
     470                                 <equals arg1="${test.sanity.simpletck.result}" arg2="0" />
     471                                 <!--<matches singleline="true" string="${test.sanity.simpletck.output}" pattern="${test-sanity-simpletck-pattern}" />-->
     472                         </and>
     473                 </condition>
     474                 <fail unless="test.sanity.simpletck.success">
     475                         Simple tck run exited with code "${test.sanity.simpletck.result}"
     476
     477                         The output:
     478                         ${test.sanity.simpletck.output}
     479
     480                         Pattern: ${test-sanity-simpletck-pattern}</fail>
     481         </target>
     482
     483     <target name="test-nohead" depends="dist" description="Runs all tests, which do not need display">
     484           <antcall target="test-statusmsg"/>
     485     </target>
     486
     487     <target name="test-statusmsg" depends="jar" description="Tests the message string filtering of the Status class">
     488         <junit fork="no" haltonerror="off" printsummary="withOutAndErr" filtertrace="off" showoutput="on">
     489             <classpath>
     490                 <pathelement location="${junitlib}"/>
     491             </classpath>
     492               <test name="StatusFilterTest"/>
     493         </junit>
     494     </target>
     495
     496     <target name="compile-javatest.help.main" unless="javatest.help.ok" >
     497         <!-- copy across the help files -->
     498         <delete dir="${build.javatest.help}"/>
     499         <mkdir dir="${build.tmp}"/>
     500
     501         <copy todir="${build.javatest.help}" >
     502             <fileset dir="${src.dir}/com/sun/javatest/help/">
     503                 <patternset refid="helpset"/>
     504             </fileset>
     505         </copy>
     506         <copy todir="${build.classes}">
     507             <fileset dir="${src.dir}">
     508                 <patternset refid="helpset"/>
     509             </fileset>
     510         </copy>
     511     </target>
     512
     513     <target name="check-javatest.help">
     514         <dependset>
     515             <srcfileset dir="${src.javatest.help}" />
     516             <targetfileset dir="${build.javatest.help}" />
     517         </dependset>
     518         <available property="javatest.help.ok" file="${build.javatest.help}/default/map.xml"/>
     519     </target>
     520     <target name="compile-javatestAgent.help" unless="javatestAgent.help.ok" >
     521         <!-- copy across the help files -->
     522         <copy todir="${build.javatestAgent.help}">
     523             <fileset dir="${src.dir}/com/sun/javatest/agent/help/">
     524                 <patternset refid="helpset"/>
     525                 <exclude name="**/*.tif"/>
     526             </fileset>
     527         </copy>
     528     </target>
     529
     530     <target name="check-javatestAgent.help">
     531         <dependset>
     532             <srcfileset dir="${src.javatestAgent.help}" />
     533             <targetfileset dir="${build.javatestAgent.help}" />
     534         </dependset>
     535         <available property="javatestAgent.help.ok" file="${build.javatestAgent.help}/default/map.xml"/>
     536     </target>
     537     <!-- ********** jct-utils ********************************************** -->
     538
     539     <target name="compile-jct.utils">
     540         <mkdir dir="${build.classes}"/>
     541         <javac encoding="iso-8859-1" debug="true" source="1.4"
     542                srcdir="${src.dir}"
     543                destdir="${build.classes}">
     544             <include name="com/sun/jct/utils/glossarygen/**"/>
     545             <include name="com/sun/jct/utils/indexgen/**"/>
     546             <include name="com/sun/jct/utils/mapmerge/**"/>
     547             <compilerarg value="-version"/>
     548             <compilerarg value="-Xlint:rawtypes"/>
     549             <compilerarg value="-Xlint:cast"/>
     550         </javac>
     551     </target>
     552
     553     <!-- ********** examples ********************************************** -->
     554     <target name="build-examples" depends="build-tutorial"/>
     555
     556     <target name="build-tutorial" depends="jar">
     557         <property name="build.examples" location="${BUILD_DIR}/binaries/examples/tutorial"/>
     558         <mkdir dir="${build.tmp}/${exam.dir}/demoapi"/>
     559         <mkdir dir="${build.tmp}/${exam.dir}/simpleTags"/>
     560         <mkdir dir="${build.examples}/demots/lib"/>
     561
     562         <javac encoding="iso-8859-1" debug="true" source="1.6"
     563                srcdir="${exam.dir}/tutorial/demoapi"
     564                destdir="${build.tmp}/${exam.dir}/demoapi">
     565             <compilerarg value="-version"/>
     566             <compilerarg value="-Xlint:rawtypes"/>
     567             <compilerarg value="-Xlint:cast"/>
     568         </javac>
     569         <jar destfile="${build.examples}/demots/lib/demoapi.jar"
     570              basedir="${build.tmp}/${exam.dir}/demoapi" index="false">
     571             <manifest>
     572                 <attribute name="Built-By"   value="${user.name}"/>
     573                 <attribute name="Main-Class" value="${run.class}"/>
     574             </manifest>
     575         </jar>
     576         <copy todir="${build.examples}/demots/lib">
     577             <fileset file="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     578         </copy>
     579
     580
     581         <javac encoding="iso-8859-1" debug="true" source="1.6"
     582                srcdir="${exam.dir}/tutorial/simpleTags"
     583                destdir="${build.tmp}/${exam.dir}/simpleTags"
     584                classpath="${BUILD_DIR}/binaries/lib/javatest.jar:${build.examples}/demots/lib/demoapi.jar">
     585             <compilerarg value="-version"/>
     586             <compilerarg value="-Xlint:rawtypes"/>
     587             <compilerarg value="-Xlint:cast"/>
     588         </javac>
     589         <copy todir="${build.tmp}/${exam.dir}/simpleTags">
     590             <fileset dir="${exam.dir}/tutorial/simpleTags/src">
     591                 <include name="**/moreInfo/**"/>
     592                 <include name="**/*.properties"/>
     593             </fileset>
     594         </copy>
     595
     596         <jar destfile="${build.examples}/demots/lib/jtdemots.jar"
     597              basedir="${build.tmp}/${exam.dir}/simpleTags" index="false">
     598             <manifest>
     599                 <attribute name="Built-By"   value="${user.name}"/>
     600                 <attribute name="Main-Class" value="${run.class}"/>
     601             </manifest>
     602         </jar>
     603         <copy todir="${build.examples}/demots">
     604             <fileset dir="${exam.dir}/tutorial/simpleTags/demots"/>
     605         </copy>
     606         <copy todir="${build.examples}">
     607             <fileset dir="${exam.dir}/tutorial/doc"/>
     608         </copy>
     609         <copy todir="${build.examples}/demoapi">
     610             <fileset dir="${exam.dir}/tutorial/demoapi"/>
     611         </copy>
     612
     613
     614         </target>
     615
     616
     617         <target name="build-services-ts" depends="build-tutorial">
     618             <property name="services.ts" location="${BUILD_DIR}/binaries/examples/services_ts"/>
     619             <mkdir dir="${build.tmp}/${exam.dir}/services_demo/classes"/>
     620             <mkdir dir="${services.ts}/lib"/>
     621
     622             <copy todir="${services.ts}/lib">
     623                 <fileset file="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     624                 <fileset file="${build.examples}/demots/lib/demoapi.jar"/>
     625             </copy>
     626
     627
     628             <javac encoding="iso-8859-1" debug="true"
     629                    srcdir="${exam.dir}/services_demo/src"
     630                    destdir="${build.tmp}/${exam.dir}/services_demo/classes"
     631                    classpath="${BUILD_DIR}/binaries/lib/javatest.jar">
     632                 <compilerarg value="-version"/>
     633                 <compilerarg value="-Xlint:rawtypes"/>
     634                 <compilerarg value="-Xlint:cast"/>
     635             </javac>
     636             <copy todir="${build.tmp}/${exam.dir}/services_demo/classes">
     637                 <fileset dir="${exam.dir}/services_demo/src">
     638                     <include name="**/moreinfo/**"/>
     639                     <include name="**/*.properties"/>
     640                 </fileset>
     641             </copy>
     642
     643             <jar destfile="${services.ts}/lib/jtservices.jar"
     644                  basedir="${build.tmp}/${exam.dir}/services_demo/classes" index="false">
     645                  <manifest>
     646                      <attribute name="Built-By"   value="${user.name}"/>
     647                      <attribute name="Main-Class" value="${run.class}"/>
     648                  </manifest>
     649              </jar>
     650
     651              <copy todir="${services.ts}">
     652                  <fileset dir="${exam.dir}/services_demo/services_ts"/>
     653              </copy>
     654
     655          </target>
     656
     657
     658         <!--
     659         ********** copyright checker **********************************************
     660         -->
     661         <property file="build/copyright.properties"/>
     662         <target name="test-copyrights" depends="compile.test.copyright.classes">
     663                 <taskdef name="checkCopyrights" classpath="${build.classes}" classname="com.sun.jct.utils.copyrightcheck.CheckCopyrights"/>
     664                 <checkCopyrights pattern="${copyright.pattern}" dir="${src.dir}" includes="${copyright.includes}" excludes="${copyright.excludes}" failOnError="yes"/>
     665         </target>
     666 </project>
    --- EOF ---