       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         </javac>
     295         <copy todir="${build.classes}">
     296             <fileset dir="${legal.dir}">
     297                 <include name="copyright.txt"/>
     298             </fileset>
     299         </copy>
     300
     301     </target>
     302
     303     <target name="compile.test.copyright.classes">
     304         <mkdir dir="${build.classes}"/>
     305         <javac encoding="iso-8859-1" debug="true" source="1.7" target="1.7"
     306                srcdir="${test.dir}"
     307                destdir="${build.classes}"
     308                classpath="${jdk14.classpath}">
     309             <patternset refid="test.packages"/>
     310                 </javac>
     311         </target>
     312
     313     <target name="compile.junit.classes" if="jar.junit.dependencies.present" depends="verify-dependencies, compile.classes,compile.junit.resources">
     314         <mkdir dir="${build.junit.classes}"/>
     315         <javac encoding="iso-8859-1" debug="true" source="1.7" target="1.7"
     316                srcdir="${src.dir}"
     317                destdir="${build.junit.classes}"
     318                classpath="${jdk14.classpath}:${build.classes}:${asmjar}:${asmcommonsjar}:${junitlib}">
     319             <patternset refid="javatest.junit.packages"/>
     320         </javac>
     321
     322         <copy todir="${build.junit.classes}">
     323             <fileset dir="${legal.dir}">
     324                 <include name="copyright.txt"/>
     325             </fileset>
     326         </copy>
     327
     328     </target>
     329
     330     <target name="compile-javatest.help" depends="compile-javatest.help.main,compile-javatestAgent.help"/>
     331
     332     <target name="compile.resources" depends="stamp">
     333         <copy todir="${build.classes}">
     334             <fileset dir="${src.dir}">
     335                 <patternset refid="interview.resources"/>
     336                 <patternset refid="javatest.resources"/>
     337             </fileset>
     338         </copy>
     339         <mkdir dir="${build.classes}/META-INF/"/>
     340         <buildinfo/>
     341         <copy file="${src.dir}/com/sun/javatest/tool/i18n.properties"
     342               tofile="${build.classes}/com/sun/javatest/tool/i18n_fr.properties"/>
     343         <mkdir dir="${build.classes}/META-INF/services"/>
     344         <copy file="${build.dir}/JavaTest.cmdMgrs.lst" tofile="${build.classes}/META-INF/services/com.sun.javatest.tool.CommandManager.lst"/>
     345         <copy file="${build.dir}/JavaTest.toolMgrs.lst" tofile="${build.classes}/META-INF/services/com.sun.javatest.tool.ToolManager.lst"/>
     346         <copy file="${build.dir}/com.sun.javatest.report.ReportFormat" tofile="${build.classes}/META-INF/services/com.sun.javatest.report.ReportFormat"/>
     347     </target>
     348
     349     <target name="compile.junit.resources" if="jar.junit.dependencies.present" depends="stamp">
     350         <copy todir="${build.junit.classes}">
     351             <fileset dir="${src.dir}">
     352                 <patternset refid="javatest.junit.resources"/>
     353             </fileset>
     354         </copy>
     355         <mkdir dir="${build.classes}/META-INF/"/>
     356         <buildinfo/>
     357     </target>
     358
     359
     360     <target name="run" depends="compile" description="Run application.">
     361         <fail unless="run.class">${run.class.missing}</fail>
     362         <java fork="true" classname="${run.class}">
     363             <classpath>
     364                 <path path="${run.classpath}"/>
     365             </classpath>
     366         </java>
     367     </target>
     368
     369     <target name="javadoc" description="Creates API documentation for the JT Harness source.">
     370         <condition property="javadoc.add" value="${javadoc.additionalparam} -Xdoclint:none" else="${javadoc.additionalparam}">
     371             <or>
     372                 <contains string="${java.version}" substring="1.8" />
     373                 <matches pattern="^9.*" string="${java.version}"/>
     374             </or>
     375         </condition>
     376
     377         <mkdir dir="${javadoc.dir}"/>
     378         <javadoc destdir="${javadoc.dir}" encoding="${javadoc.encoding}" notree="${javadoc.notree}" use="${javadoc.use}"
     379                  nonavbar="${javadoc.nonavbar}"
     380                  noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}"
     381                  version="${javadoc.version}"
     382                  windowtitle="${javadoc.windowtitle}" private="${javadoc.private}"
     383                  additionalparam="${javadoc.add}" failonerror="true"
     384                  useexternalfile="true">
     385             <classpath>
     386                 <path path="${jcommjar}:${ant.home}/lib/ant.jar"/>
     387             </classpath>
     388             <sourcepath>
     389                 <pathelement location="${src.dir}"/>
     390             </sourcepath>
     391             <bottom><![CDATA[ ${javadoc.footer} ]]></bottom>
     392             <!-- list of packages with useful development doc -->
     393             <!-- expand if desired -->
     394             <package name="com.sun.javatest" />
     395             <package name="com.sun.interview" />
     396             <package name="com.sun.javatest.interview" />
     397             <package name="com.sun.javatest.finder" />
     398             <package name="com.sun.javatest.lib" />
     399             <package name="com.sun.javatest.util" />
     400             <package name="com.sun.javatest.tool" />
     401             <package name="com.sun.javatest.exec" />
     402             <package name="com.sun.javatest.report" />
     403         </javadoc>
     404     </target>
     405
     406     <target name="test" depends="jar,test-nohead,test-i18n,test-copyrights,test-sanity" description="Runs test on JT Harness.">
     407         <java fork="true" failonerror="true" classname="${run.class}">
     408             <classpath>
     409                 <path path="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     410             </classpath>
     411             <arg value="-version"/>
     412         </java>
     413     </target>
     414
     415         <target name="test-sanity" depends="test-sanity-version,test-sanity-simpletck" />
     416
     417         <target name="test-sanity-version" depends="jar">
     418                 <java fork="true" failonerror="false" classname="${run.class}"
     419                         outputproperty="test.sanity.version.output"
     420                         resultproperty="test.sanity.version.result">
     421                         <classpath>
     422                                 <path path="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     423                         </classpath>
     424                         <arg value="-version"/>
     425                 </java>
     426
     427                 <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" />
     428
     429                 <condition property="test.sanity.version.success">
     430                         <and>
     431                                 <equals arg1="${test.sanity.version.result}" arg2="0" />
     432                                 <!--<matches singleline="true" string="${test.sanity.version.output}" pattern="${test-sanity-version-pattern}" />-->
     433                         </and>
     434                 </condition>
     435                 <fail unless="test.sanity.version.success">
     436                         "java ${run.class} -version" exited with code "${test.sanity.version.result}"
     437
     438                         The output:
     439                         ${test.sanity.version.output}
     440
     441                         Pattern: ${test-sanity-version-pattern}</fail>
     442         </target>
     443
     444         <target name="test-sanity-simpletck" depends="jar,build-examples">
     445                 <property name="libs" value="${BUILD_DIR}/binaries/examples/tutorial/demots/lib" />
     446                 <delete dir="${build.tmp}/sanity-demo-wd" />
     447                 <java fork="true" failonerror="false" jar="${BUILD_DIR}/binaries/lib/javatest.jar"
     448                         outputproperty="test.sanity.simpletck.output"
     449                         resultproperty="test.sanity.simpletck.result">
     450                         <classpath>
     451                                 <path path="${libs}/demots.jar" />
     452                                 <path path="${libs}/demoapi.jar" />
     453                         </classpath>
     454                         <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" />
     455                 </java>
     456
     457                 <property name="test-sanity-simpletck-pattern" value="Test results: passed: 16" />
     458
     459                 <condition property="test.sanity.simpletck.success">
     460                         <and>
     461                                 <equals arg1="${test.sanity.simpletck.result}" arg2="0" />
     462                                 <!--<matches singleline="true" string="${test.sanity.simpletck.output}" pattern="${test-sanity-simpletck-pattern}" />-->
     463                         </and>
     464                 </condition>
     465                 <fail unless="test.sanity.simpletck.success">
     466                         Simple tck run exited with code "${test.sanity.simpletck.result}"
     467
     468                         The output:
     469                         ${test.sanity.simpletck.output}
     470
     471                         Pattern: ${test-sanity-simpletck-pattern}</fail>
     472         </target>
     473
     474     <target name="test-nohead" depends="dist" description="Runs all tests, which do not need display">
     475           <antcall target="test-statusmsg"/>
     476     </target>
     477
     478     <target name="test-statusmsg" depends="jar" description="Tests the message string filtering of the Status class">
     479         <junit fork="no" haltonerror="off" printsummary="withOutAndErr" filtertrace="off" showoutput="on">
     480             <classpath>
     481                 <pathelement location="${junitlib}"/>
     482             </classpath>
     483               <test name="StatusFilterTest"/>
     484         </junit>
     485     </target>
     486
     487     <target name="compile-javatest.help.main" unless="javatest.help.ok" >
     488         <!-- copy across the help files -->
     489         <delete dir="${build.javatest.help}"/>
     490         <mkdir dir="${build.tmp}"/>
     491
     492         <copy todir="${build.javatest.help}" >
     493             <fileset dir="${src.dir}/com/sun/javatest/help/">
     494                 <patternset refid="helpset"/>
     495             </fileset>
     496         </copy>
     497         <copy todir="${build.classes}">
     498             <fileset dir="${src.dir}">
     499                 <patternset refid="helpset"/>
     500             </fileset>
     501         </copy>
     502     </target>
     503
     504     <target name="check-javatest.help">
     505         <dependset>
     506             <srcfileset dir="${src.javatest.help}" />
     507             <targetfileset dir="${build.javatest.help}" />
     508         </dependset>
     509         <available property="javatest.help.ok" file="${build.javatest.help}/default/map.xml"/>
     510     </target>
     511     <target name="compile-javatestAgent.help" unless="javatestAgent.help.ok" >
     512         <!-- copy across the help files -->
     513         <copy todir="${build.javatestAgent.help}">
     514             <fileset dir="${src.dir}/com/sun/javatest/agent/help/">
     515                 <patternset refid="helpset"/>
     516                 <exclude name="**/*.tif"/>
     517             </fileset>
     518         </copy>
     519     </target>
     520
     521     <target name="check-javatestAgent.help">
     522         <dependset>
     523             <srcfileset dir="${src.javatestAgent.help}" />
     524             <targetfileset dir="${build.javatestAgent.help}" />
     525         </dependset>
     526         <available property="javatestAgent.help.ok" file="${build.javatestAgent.help}/default/map.xml"/>
     527     </target>
     528     <!-- ********** jct-utils ********************************************** -->
     529
     530     <target name="compile-jct.utils">
     531         <mkdir dir="${build.classes}"/>
     532         <javac encoding="iso-8859-1" debug="true" source="1.4"
     533                srcdir="${src.dir}"
     534                destdir="${build.classes}">
     535             <include name="com/sun/jct/utils/glossarygen/**"/>
     536             <include name="com/sun/jct/utils/indexgen/**"/>
     537             <include name="com/sun/jct/utils/mapmerge/**"/>
     538         </javac>
     539     </target>
     540
     541     <!-- ********** examples ********************************************** -->
     542     <target name="build-examples" depends="build-tutorial"/>
     543
     544     <target name="build-tutorial" depends="jar">
     545         <property name="build.examples" location="${BUILD_DIR}/binaries/examples/tutorial"/>
     546         <mkdir dir="${build.tmp}/${exam.dir}/demoapi"/>
     547         <mkdir dir="${build.tmp}/${exam.dir}/simpleTags"/>
     548         <mkdir dir="${build.examples}/demots/lib"/>
     549
     550         <javac encoding="iso-8859-1" debug="true" source="1.6"
     551                srcdir="${exam.dir}/tutorial/demoapi"
     552                destdir="${build.tmp}/${exam.dir}/demoapi">
     553         </javac>
     554         <jar destfile="${build.examples}/demots/lib/demoapi.jar"
     555              basedir="${build.tmp}/${exam.dir}/demoapi" index="false">
     556             <manifest>
     557                 <attribute name="Built-By"   value="${user.name}"/>
     558                 <attribute name="Main-Class" value="${run.class}"/>
     559             </manifest>
     560         </jar>
     561         <copy todir="${build.examples}/demots/lib">
     562             <fileset file="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     563         </copy>
     564
     565
     566         <javac encoding="iso-8859-1" debug="true" source="1.6"
     567                srcdir="${exam.dir}/tutorial/simpleTags"
     568                destdir="${build.tmp}/${exam.dir}/simpleTags"
     569                classpath="${BUILD_DIR}/binaries/lib/javatest.jar:${build.examples}/demots/lib/demoapi.jar">
     570         </javac>
     571         <copy todir="${build.tmp}/${exam.dir}/simpleTags">
     572             <fileset dir="${exam.dir}/tutorial/simpleTags/src">
     573                 <include name="**/moreInfo/**"/>
     574                 <include name="**/*.properties"/>
     575             </fileset>
     576         </copy>
     577
     578         <jar destfile="${build.examples}/demots/lib/jtdemots.jar"
     579              basedir="${build.tmp}/${exam.dir}/simpleTags" index="false">
     580             <manifest>
     581                 <attribute name="Built-By"   value="${user.name}"/>
     582                 <attribute name="Main-Class" value="${run.class}"/>
     583             </manifest>
     584         </jar>
     585         <copy todir="${build.examples}/demots">
     586             <fileset dir="${exam.dir}/tutorial/simpleTags/demots"/>
     587         </copy>
     588         <copy todir="${build.examples}">
     589             <fileset dir="${exam.dir}/tutorial/doc"/>
     590         </copy>
     591         <copy todir="${build.examples}/demoapi">
     592             <fileset dir="${exam.dir}/tutorial/demoapi"/>
     593         </copy>
     594
     595
     596         </target>
     597
     598
     599         <target name="build-services-ts" depends="build-tutorial">
     600             <property name="services.ts" location="${BUILD_DIR}/binaries/examples/services_ts"/>
     601             <mkdir dir="${build.tmp}/${exam.dir}/services_demo/classes"/>
     602             <mkdir dir="${services.ts}/lib"/>
     603
     604             <copy todir="${services.ts}/lib">
     605                 <fileset file="${BUILD_DIR}/binaries/lib/javatest.jar"/>
     606                 <fileset file="${build.examples}/demots/lib/demoapi.jar"/>
     607             </copy>
     608
     609
     610             <javac encoding="iso-8859-1" debug="true"
     611                    srcdir="${exam.dir}/services_demo/src"
     612                    destdir="${build.tmp}/${exam.dir}/services_demo/classes"
     613                    classpath="${BUILD_DIR}/binaries/lib/javatest.jar">
     614             </javac>
     615             <copy todir="${build.tmp}/${exam.dir}/services_demo/classes">
     616                 <fileset dir="${exam.dir}/services_demo/src">
     617                     <include name="**/moreinfo/**"/>
     618                     <include name="**/*.properties"/>
     619                 </fileset>
     620             </copy>
     621
     622             <jar destfile="${services.ts}/lib/jtservices.jar"
     623                  basedir="${build.tmp}/${exam.dir}/services_demo/classes" index="false">
     624                  <manifest>
     625                      <attribute name="Built-By"   value="${user.name}"/>
     626                      <attribute name="Main-Class" value="${run.class}"/>
     627                  </manifest>
     628              </jar>
     629
     630              <copy todir="${services.ts}">
     631                  <fileset dir="${exam.dir}/services_demo/services_ts"/>
     632              </copy>
     633
     634          </target>
     635
     636
     637         <!--
     638         ********** copyright checker **********************************************
     639         -->
     640         <property file="build/copyright.properties"/>
     641         <target name="test-copyrights" depends="compile.test.copyright.classes">
     642                 <taskdef name="checkCopyrights" classpath="${build.classes}" classname="com.sun.jct.utils.copyrightcheck.CheckCopyrights"/>
     643                 <checkCopyrights pattern="${copyright.pattern}" dir="${src.dir}" includes="${copyright.includes}" excludes="${copyright.excludes}" failOnError="yes"/>
     644         </target>
     645 </project>