<commit_before><!--
  Ant build file for curn

  $Id$
  ===========================================================================
  This software is released under a Berkeley-style license:

  Copyright (c) 2004 <NAME>. All rights reserved.

  Redistribution and use in source and binary forms are permitted provided
  that: (1) source distributions retain this entire copyright notice and
  comment; and (2) modifications made to the software are prominently
  mentioned, and a copy of the original software (or a pointer to its
  location) are included. The name of the author may not be used to endorse
  or promote products derived from this software without specific prior
  written permission.

  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

  Effectively, this means you can do what you want with the software except
  remove this notice or take advantage of the author's name. If you modify
  the software and redistribute your modified version, you must indicate that
  your version is a modification of the original, and you must provide either
  a pointer to or a copy of the original.

-->

<project name="curn" default="curn" basedir=".">

  <description>
This Ant build file builds the "curn" (Customizable Utilitarian RSS Notifier)
tool and its associated libraries. It can also be used to build binary,
source and documentation packages.
  </description>

  <!--
  ***************************************************************************
				Properties
  ***************************************************************************
  -->

  <!-- set global properties for this build -->

  <property name="build" location="classes"/>
  <property name="pkg.path" value="org/clapper/curn"/>
  <property name="src.top" location="src"/>
  <property name="src.dir" location="${src.top}/${pkg.path}"/>
  <property name="dist"  location="dist"/>
  <property name="build.compiler" value="jikes"/>
  <property name="build.compiler.emacs" value="true"/>
  <property name="build.info.file"
            value="${build}/${pkg.path}/BuildInfoBundle.properties"/>
  <property name="javac.listfiles" value="no"/>
  <property name="code_jar_name" value="curn"/>
  <property name="code_jar_file" value="${code_jar_name}.jar"/>
  <property name="code_jar_dir" value="${dist}/lib"/>
  <property name="code_jar_path" value="${code_jar_dir}/${code_jar_file}"/>
  <property name="docs_top_dir" value="docs"/>
  <property name="javadocs_top_dir" value="javadocs"/>
  <property name="javadocs_api_dir" value="${javadocs_top_dir}/curn/api"/>
  <property name="zip_dir_prefix" value="curn/"/>
  <property name="javadoc_zip_dir_prefix" value=""/>
  <property name="release_dir" value="${dist}/release"/>

  <!--
  ***************************************************************************
			    Paths and Patterns
  ***************************************************************************
  -->

  <path id="project.class.path">
    <pathelement location="lib/"/>
    <pathelement path="${java.class.path}/"/>
    <pathelement path="classes/"/>
  </path>

  <!--
  ***************************************************************************
			  Initialization Targets
  ***************************************************************************
  -->

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp>
      <format property="build.date" pattern="dd MMMM, yyyy HH:mm:ss z"
              locale="en"/>
    </tstamp>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
    <depend srcdir="${src.dir}" destdir="${build}"/>
  </target>

  <!--
  ***************************************************************************
			       Meta-Targets
  ***************************************************************************
  -->

  <target name="all" depends="curn"/>

  <target name="curn"
          depends="init,main,output,third.party.parsers,bundles,-build.info"
          description="Compiles the source"/>

  <target name="third.party.parsers"
          depends="parser.informa,parser.rome"/>

  <!--
  ***************************************************************************
		      Main (Top-level) Sources Target
  ***************************************************************************
  -->

  <target name="main">
    <javac srcdir="${src.dir}"
           sourcepath="${src.top}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <include name="*.java"/>
      <include name="util/*.java"/>
      <include name="parser/*.java"/>
      <include name="parser/minirss/*.java"/>
      <include name="parser/tester.java"/>

      <exclude name="parser/rome/*.java"/>
      <exclude name="parser/informa/*.java"/>

    </javac>

  </target>

  <!--
  ***************************************************************************
			  Resource Bundle Target
  ***************************************************************************
  -->

  <target name="bundles">
    <copy todir="${build}">
      <fileset dir="${src.top}">
        <include name="**/*.properties"/>
      </fileset>
    </copy>
  </target>

  <!--
  ***************************************************************************
			  Informa Parser Targets
	      (Only built if Informa libraries are present.)
  ***************************************************************************
  -->

  <target name="-check.informa.exists">
    <available classname="de.nava.informa.parsers.FeedParser"
               property="informa.exists" value="true"/>
  </target>

  <target name="-check.informa"
          depends="-check.informa.exists"
          unless="informa.exists">
    <echo>
*** The Informa parser is not currently available in the build environment.
*** Because Informa is missing, all targets that require it will be skipped.
*** To enable these targets, download Informa from
*** http://informa.sourceforge.net/ and follow the instructions in curn's
*** docs/BUILDING.txt file.
    </echo>
  </target>

  <target name="parser.informa"
          depends="-check.informa"
	  if="informa.exists">
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="parser.informa">
        <include name="parser/informa/*.java"/>
      </patternset>

    </javac>
  </target>

  <target name="informa" depends="parser.informa"/>

  <!--
  ***************************************************************************
			    Rome Parser Targets
		(Only built if Rome libraries are present.)
  ***************************************************************************
  -->

  <target name="-check.rome.exists">
    <available classname="com.sun.syndication.io.SyndFeedInput"
               property="rome.exists" value="true"/>
  </target>

  <target name="-check.rome"
          depends="-check.rome.exists"
          unless="rome.exists">
    <echo>
*** The Rome parser is not currently available in the build environment.
*** Because Informa is missing, all targets that require it will be skipped.
*** To enable these targets, download Rome from  https://rome.dev.java.net/
*** and install it according to the instructions.
    </echo>
  </target>

  <target name="parser.rome"
          depends="-check.rome"
	  if="rome.exists">
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="parser.rome">
        <include name="parser/rome/*.java"/>
      </patternset>

    </javac>
  </target>

  <target name="rome" depends="parser.rome"/>

  <!--
  ***************************************************************************
			Main Output Handler Targets
  ***************************************************************************
  -->

  <target name="output">
    <!--
      First the local targets.
    -->
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output">
         <include name="output/*.java"/>
      </patternset>

    </javac>

    <!--
     Now the subtargets.
    -->
    <antcall target="output.html"/>
    <antcall target="output.script"/>
    <antcall target="email"/>
  </target>

  <!--
  ***************************************************************************
			HTML Output Handler Targets
  ***************************************************************************
  -->

  <patternset id="generated.HTMLOutputHandler.java.pattern">
    <include name="output/html/*HTML.java"/>
  </patternset>

  <patternset id="permanent.HTMLOutputHandler.java.pattern">
    <include name="output/html/*.java"/>
    <exclude name="output/html/*HTML.java"/>
  </patternset>

  <fileset id="generated.HTMLOutputHandler.java.files" dir="${src.dir}">
    <patternset refid="generated.HTMLOutputHandler.java.pattern"/>
  </fileset>

  <fileset id="permanent.HTMLOutputHandler.java.files" dir="${src.dir}">
    <patternset refid="permanent.HTMLOutputHandler.java.pattern"/>
  </fileset>

  <fileset id="generated.HTMLOutputHandler.files" dir="${src.dir}">
    <patternset refid="generated.HTMLOutputHandler.java.pattern"/>
    <patternset>
      <include name="output/html/*.optionCheck"/>
    </patternset>
  </fileset>

  <target name="output.html" depends="-check.xmlc" if="xmlc.exists">

    <!-- Make the <xmlc> task available -->

    <taskdef name="xmlc" classname="org.enhydra.xml.xmlc.taskdef.Xmlc"/>

    <!--
    Specifying "packagename" forces <xmlc> to create the generated Java source
    files a subdirectory. And, even then, the package name is wrong.
    Specifying just "packagedir" causes it to create a bad "package"
    line, but the file is at least local. Then, we edit it. (Yuck.)
     -->

    <xmlc srcdir="${src.dir}/output/html"
          sourceout="${src.dir}/output/html"
          includes="*.html"
          keep="yes"
          verbose="no"
          packagedir=".">
      <arg value="-delete-class"/>
      <arg value="mockup"/>
    </xmlc>

    <replaceregexp match="^package.*;"
                   replace="package org.clapper.curn.output.html;"
                   flags="g"
                   byline="true">
      <fileset dir="${src.dir}" includes="output/html/*.java">
        <contains text="XMLC GENERATED" casesensitive="yes"/>
      </fileset>
    </replaceregexp>

    <!--

    The XMLC-generated Java sources contain various anomalies (including
    identifiers with "$" characters) that cause Jikes to complain. Compile
    them separately, with various Jikes warnings disabled.

    -->

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Pno-naming-convention"/>
      <compilerarg compiler="jikes" value="+Pno-switchcheck"/>
      <compilerarg compiler="jikes" value="+Pno-shadow"/>
      <compilerarg compiler="jikes" value="-nowarn"/>

      <classpath refid="project.class.path"/>
      <patternset refid="generated.HTMLOutputHandler.java.pattern"/>

    </javac>

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>
      <patternset refid="permanent.HTMLOutputHandler.java.pattern"/>

    </javac>
  </target>

  <target name="-check.xmlc.exists">
    <available classname="org.enhydra.xml.xmlc.taskdef.Xmlc"
               property="xmlc.exists" value="true"/>
  </target>

  <target name="-check.xmlc" depends="-check.xmlc.exists" unless="xmlc.exists">
    <echo>
*** XMLC is not currently available in the build environment. Because of
*** this, all targets that require XMLC will be skipped. To enable these
*** targets, place a copy of xmlc-taskdef.jar and the XMLC runtime jars
*** in ANT_HOME/lib or in the CLASSPATH. XMLC is available at
*** http://xmlc.objectweb.org/
    </echo>
  </target>

  <!--
  ***************************************************************************
		       Script Output Handler Targets
  ***************************************************************************
  -->

  <target name="output.script" depends="-check.bsf" if="bsf.exists">

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output.script">
        <include name="output/script/*.java"/>
      </patternset>

    </javac>

  </target>

  <target name="-check.bsf.exists">
    <available classname="org.apache.bsf.BSFManager"
               property="bsf.exists" value="true"/>
  </target>

  <target name="-check.bsf" depends="-check.bsf.exists" unless="bsf.exists">
    <echo>
*** The Jakarta Apache Bean Scripting Framework (BSF) is not currently
*** available in the build environment. Because of this, all targets that
*** require BSF will be skipped. To enable these targets, place a copy of
*** bsf.jar in ANT_HOME/lib or in the CLASSPATH. BSF is available at
*** http://jakarta.apache.org/bsf/
    </echo>
  </target>

  <!--
  ***************************************************************************
		       Email Output Handler Targets
  ***************************************************************************
  -->

  <target name="-check.email.exists">
    <available classname="org.clapper.util.mail.EmailMessage"
               property="email.exists" value="true"/>
  </target>

  <target name="-check.email" depends="-check.email.exists"
          unless="email.exists">
    <echo>
*** The email classes from the org.clapper.util.mail package are not
*** currently available in the build environment. Curn will build without
*** internal email support.
    </echo>
  </target>

  <target name="email" depends="-check.email" if="email.exists">

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output.email">
        <include name="output/email/*.java"/>
      </patternset>

    </javac>
  </target>

  <!--
  ***************************************************************************
		      Version and Build-info Targets
  ***************************************************************************
  -->

  <!-- Load the API version from the appropriate resource bundle -->

  <target name="-get.version" description="Get the version stamp">
    <property file="${build}/org/clapper/curn/Curn.properties"/>
    <echo>Version: ${curn.version}</echo>
  </target>

  <target name="version" depends="-get.version"/>

  <target name="-build.info" depends="-get.version">

    <taskdef name="make_build_info"
             classname="org.clapper.util.ant.MakeBuildInfoTask"/>

    <condition property="compiler" value="${build.compiler}">
      <isset property="build.compiler"/>
    </condition>

    <condition property="compiler" value="javac">
      <not>
        <isset property="build.compiler"/>
      </not>
    </condition>

    <make_build_info file="${build.info.file}"
                     antversion="${ant.version}"
                     compiler="${compiler}"/>
  </target>

  <!--
  ***************************************************************************
			      Javadoc targets
  ***************************************************************************
  -->

  <target name="javadocs" description="Generate API Javadocs">
    <mkdir dir="${javadocs_api_dir}"/>
    <javadoc
             destdir="${javadocs_api_dir}"
             sourcepath="${src.top}"
	     source="1.4"
	     breakiterator="true"
             author="true"
             version="true"
             splitindex="true"
             use="true"
             excludepackagenames=""
	     overview="overview.html"
             packagenames="org.clapper.curn.*"
             classpathref="project.class.path"
             windowtitle="clapper.org curn utility">
      <doctitle><![CDATA[<h1><i>curn</i>: Customizable Utilitarian RSS Notifier</h1>]]></doctitle>
      <bottom><![CDATA[<i>Copyright &#169; 2004 <NAME>. All Rights Reserved.</i>]]></bottom>
    </javadoc>
  </target>

  <target name="javadoc" depends="javadocs"/>

  <!--
  ***************************************************************************
			     Packaging Targets
  ***************************************************************************
  -->

  <target name="-set.version.properties" depends="-get.version">
    <property name="versioned_src_zipfile"
              value="src-${VERSION}.zip"/>

    <property name="versioned_code_jar_file"
              value="${code_jar_name}-${VERSION}.jar"/>

    <property name="versioned_docs_zipfile"
              value="docs-${VERSION}.zip"/>

    <property name="versioned_javadocs_zipfile"
              value="javadocs-${VERSION}.zip"/>
  </target>

  <target name="code.jar" depends="all"
          description="Generate the binary jar file">
    <mkdir dir="${code_jar_dir}"/>
    <jar jarfile="${code_jar_path}" basedir="${build}"/>
  </target>

  <target name="dist" depends="code.jar"
          description="Synonym for code.jar"/>

  <target name="javadoczip" depends="javadocs"
          description="Builds the javadocs zip file">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_javadocs_zipfile}">
      <zipfileset dir="${javadocs_top_dir}"
                  prefix="${javadoc_zip_dir_prefix}"/>
    </zip>
  </target>

  <target name="doczip"
          description="Builds the non-Javadocs documentation zip file">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_docs_zipfile}">
      <zipfileset dir="${docs_top_dir}"
                  prefix="${zip_dir_prefix}"/>
    </zip>
  </target>

  <target name="srczip" depends=""
          description="Generate the source zip">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_src_zipfile}">
      <zipfileset dir="."
                  prefix="${zip_dir_prefix}" casesensitive="yes">
        <exclude name="${dist}/**"/>
        <exclude name="${build}"/>
        <exclude name="**/CVS"/>
        <include name="**/*.java"/>
        <include name="**/package.html"/>
        <include name="overview.html"/>
        <include name="**/*.xml"/>
      </zipfileset>
    </zip>
  </target>

  <target name="fulldist"
          depends="dist,-set.version.properties,srczip,doczip,javadoczip"
          description="Generate the distribution and source jars">
    <copy file="${code_jar_path}"
          tofile="${release_dir}/${versioned_code_jar_file}"/>
  </target>

  <!--
  ***************************************************************************
			     Clean-up Targets
  ***************************************************************************
  -->

  <target name="clean"
          description="clean up" >

    <delete failonerror="false">
      <fileset refid="generated.HTMLOutputHandler.files"/>
    </delete>

    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${build}"/>
    </delete>

    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${dist}"/>
    </delete>
  </target>
</project>
<commit_msg>Fixed references to version.<commit_after><!--
  Ant build file for curn

  $Id$
  ===========================================================================
  This software is released under a Berkeley-style license:

  Copyright (c) 2004 <NAME>. All rights reserved.

  Redistribution and use in source and binary forms are permitted provided
  that: (1) source distributions retain this entire copyright notice and
  comment; and (2) modifications made to the software are prominently
  mentioned, and a copy of the original software (or a pointer to its
  location) are included. The name of the author may not be used to endorse
  or promote products derived from this software without specific prior
  written permission.

  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

  Effectively, this means you can do what you want with the software except
  remove this notice or take advantage of the author's name. If you modify
  the software and redistribute your modified version, you must indicate that
  your version is a modification of the original, and you must provide either
  a pointer to or a copy of the original.

-->

<project name="curn" default="curn" basedir=".">

  <description>
This Ant build file builds the "curn" (Customizable Utilitarian RSS Notifier)
tool and its associated libraries. It can also be used to build binary,
source and documentation packages.
  </description>

  <!--
  ***************************************************************************
				Properties
  ***************************************************************************
  -->

  <!-- set global properties for this build -->

  <property name="build" location="classes"/>
  <property name="pkg.path" value="org/clapper/curn"/>
  <property name="src.top" location="src"/>
  <property name="src.dir" location="${src.top}/${pkg.path}"/>
  <property name="dist"  location="dist"/>
  <property name="build.compiler" value="jikes"/>
  <property name="build.compiler.emacs" value="true"/>
  <property name="build.info.file"
            value="${build}/${pkg.path}/BuildInfoBundle.properties"/>
  <property name="javac.listfiles" value="no"/>
  <property name="code_jar_name" value="curn"/>
  <property name="code_jar_file" value="${code_jar_name}.jar"/>
  <property name="code_jar_dir" value="${dist}/lib"/>
  <property name="code_jar_path" value="${code_jar_dir}/${code_jar_file}"/>
  <property name="docs_top_dir" value="docs"/>
  <property name="javadocs_top_dir" value="javadocs"/>
  <property name="javadocs_api_dir" value="${javadocs_top_dir}/curn/api"/>
  <property name="zip_dir_prefix" value="curn/"/>
  <property name="javadoc_zip_dir_prefix" value=""/>
  <property name="release_dir" value="${dist}/release"/>

  <!--
  ***************************************************************************
			    Paths and Patterns
  ***************************************************************************
  -->

  <path id="project.class.path">
    <pathelement location="lib/"/>
    <pathelement path="${java.class.path}/"/>
    <pathelement path="classes/"/>
  </path>

  <!--
  ***************************************************************************
			  Initialization Targets
  ***************************************************************************
  -->

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp>
      <format property="build.date" pattern="dd MMMM, yyyy HH:mm:ss z"
              locale="en"/>
    </tstamp>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
    <depend srcdir="${src.dir}" destdir="${build}"/>
  </target>

  <!--
  ***************************************************************************
			       Meta-Targets
  ***************************************************************************
  -->

  <target name="all" depends="curn"/>

  <target name="curn"
          depends="init,main,output,third.party.parsers,bundles,-build.info"
          description="Compiles the source"/>

  <target name="third.party.parsers"
          depends="parser.informa,parser.rome"/>

  <!--
  ***************************************************************************
		      Main (Top-level) Sources Target
  ***************************************************************************
  -->

  <target name="main">
    <javac srcdir="${src.dir}"
           sourcepath="${src.top}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <include name="*.java"/>
      <include name="util/*.java"/>
      <include name="parser/*.java"/>
      <include name="parser/minirss/*.java"/>
      <include name="parser/tester.java"/>

      <exclude name="parser/rome/*.java"/>
      <exclude name="parser/informa/*.java"/>

    </javac>

  </target>

  <!--
  ***************************************************************************
			  Resource Bundle Target
  ***************************************************************************
  -->

  <target name="bundles">
    <copy todir="${build}">
      <fileset dir="${src.top}">
        <include name="**/*.properties"/>
      </fileset>
    </copy>
  </target>

  <!--
  ***************************************************************************
			  Informa Parser Targets
	      (Only built if Informa libraries are present.)
  ***************************************************************************
  -->

  <target name="-check.informa.exists">
    <available classname="de.nava.informa.parsers.FeedParser"
               property="informa.exists" value="true"/>
  </target>

  <target name="-check.informa"
          depends="-check.informa.exists"
          unless="informa.exists">
    <echo>
*** The Informa parser is not currently available in the build environment.
*** Because Informa is missing, all targets that require it will be skipped.
*** To enable these targets, download Informa from
*** http://informa.sourceforge.net/ and follow the instructions in curn's
*** docs/BUILDING.txt file.
    </echo>
  </target>

  <target name="parser.informa"
          depends="-check.informa"
	  if="informa.exists">
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="parser.informa">
        <include name="parser/informa/*.java"/>
      </patternset>

    </javac>
  </target>

  <target name="informa" depends="parser.informa"/>

  <!--
  ***************************************************************************
			    Rome Parser Targets
		(Only built if Rome libraries are present.)
  ***************************************************************************
  -->

  <target name="-check.rome.exists">
    <available classname="com.sun.syndication.io.SyndFeedInput"
               property="rome.exists" value="true"/>
  </target>

  <target name="-check.rome"
          depends="-check.rome.exists"
          unless="rome.exists">
    <echo>
*** The Rome parser is not currently available in the build environment.
*** Because Informa is missing, all targets that require it will be skipped.
*** To enable these targets, download Rome from  https://rome.dev.java.net/
*** and install it according to the instructions.
    </echo>
  </target>

  <target name="parser.rome"
          depends="-check.rome"
	  if="rome.exists">
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="parser.rome">
        <include name="parser/rome/*.java"/>
      </patternset>

    </javac>
  </target>

  <target name="rome" depends="parser.rome"/>

  <!--
  ***************************************************************************
			Main Output Handler Targets
  ***************************************************************************
  -->

  <target name="output">
    <!--
      First the local targets.
    -->
    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output">
         <include name="output/*.java"/>
      </patternset>

    </javac>

    <!--
     Now the subtargets.
    -->
    <antcall target="output.html"/>
    <antcall target="output.script"/>
    <antcall target="email"/>
  </target>

  <!--
  ***************************************************************************
			HTML Output Handler Targets
  ***************************************************************************
  -->

  <patternset id="generated.HTMLOutputHandler.java.pattern">
    <include name="output/html/*HTML.java"/>
  </patternset>

  <patternset id="permanent.HTMLOutputHandler.java.pattern">
    <include name="output/html/*.java"/>
    <exclude name="output/html/*HTML.java"/>
  </patternset>

  <fileset id="generated.HTMLOutputHandler.java.files" dir="${src.dir}">
    <patternset refid="generated.HTMLOutputHandler.java.pattern"/>
  </fileset>

  <fileset id="permanent.HTMLOutputHandler.java.files" dir="${src.dir}">
    <patternset refid="permanent.HTMLOutputHandler.java.pattern"/>
  </fileset>

  <fileset id="generated.HTMLOutputHandler.files" dir="${src.dir}">
    <patternset refid="generated.HTMLOutputHandler.java.pattern"/>
    <patternset>
      <include name="output/html/*.optionCheck"/>
    </patternset>
  </fileset>

  <target name="output.html" depends="-check.xmlc" if="xmlc.exists">

    <!-- Make the <xmlc> task available -->

    <taskdef name="xmlc" classname="org.enhydra.xml.xmlc.taskdef.Xmlc"/>

    <!--
    Specifying "packagename" forces <xmlc> to create the generated Java source
    files a subdirectory. And, even then, the package name is wrong.
    Specifying just "packagedir" causes it to create a bad "package"
    line, but the file is at least local. Then, we edit it. (Yuck.)
     -->

    <xmlc srcdir="${src.dir}/output/html"
          sourceout="${src.dir}/output/html"
          includes="*.html"
          keep="yes"
          verbose="no"
          packagedir=".">
      <arg value="-delete-class"/>
      <arg value="mockup"/>
    </xmlc>

    <replaceregexp match="^package.*;"
                   replace="package org.clapper.curn.output.html;"
                   flags="g"
                   byline="true">
      <fileset dir="${src.dir}" includes="output/html/*.java">
        <contains text="XMLC GENERATED" casesensitive="yes"/>
      </fileset>
    </replaceregexp>

    <!--

    The XMLC-generated Java sources contain various anomalies (including
    identifiers with "$" characters) that cause Jikes to complain. Compile
    them separately, with various Jikes warnings disabled.

    -->

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Pno-naming-convention"/>
      <compilerarg compiler="jikes" value="+Pno-switchcheck"/>
      <compilerarg compiler="jikes" value="+Pno-shadow"/>
      <compilerarg compiler="jikes" value="-nowarn"/>

      <classpath refid="project.class.path"/>
      <patternset refid="generated.HTMLOutputHandler.java.pattern"/>

    </javac>

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>
      <patternset refid="permanent.HTMLOutputHandler.java.pattern"/>

    </javac>
  </target>

  <target name="-check.xmlc.exists">
    <available classname="org.enhydra.xml.xmlc.taskdef.Xmlc"
               property="xmlc.exists" value="true"/>
  </target>

  <target name="-check.xmlc" depends="-check.xmlc.exists" unless="xmlc.exists">
    <echo>
*** XMLC is not currently available in the build environment. Because of
*** this, all targets that require XMLC will be skipped. To enable these
*** targets, place a copy of xmlc-taskdef.jar and the XMLC runtime jars
*** in ANT_HOME/lib or in the CLASSPATH. XMLC is available at
*** http://xmlc.objectweb.org/
    </echo>
  </target>

  <!--
  ***************************************************************************
		       Script Output Handler Targets
  ***************************************************************************
  -->

  <target name="output.script" depends="-check.bsf" if="bsf.exists">

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output.script">
        <include name="output/script/*.java"/>
      </patternset>

    </javac>

  </target>

  <target name="-check.bsf.exists">
    <available classname="org.apache.bsf.BSFManager"
               property="bsf.exists" value="true"/>
  </target>

  <target name="-check.bsf" depends="-check.bsf.exists" unless="bsf.exists">
    <echo>
*** The Jakarta Apache Bean Scripting Framework (BSF) is not currently
*** available in the build environment. Because of this, all targets that
*** require BSF will be skipped. To enable these targets, place a copy of
*** bsf.jar in ANT_HOME/lib or in the CLASSPATH. BSF is available at
*** http://jakarta.apache.org/bsf/
    </echo>
  </target>

  <!--
  ***************************************************************************
		       Email Output Handler Targets
  ***************************************************************************
  -->

  <target name="-check.email.exists">
    <available classname="org.clapper.util.mail.EmailMessage"
               property="email.exists" value="true"/>
  </target>

  <target name="-check.email" depends="-check.email.exists"
          unless="email.exists">
    <echo>
*** The email classes from the org.clapper.util.mail package are not
*** currently available in the build environment. Curn will build without
*** internal email support.
    </echo>
  </target>

  <target name="email" depends="-check.email" if="email.exists">

    <javac srcdir="${src.dir}"
	   source="1.4"
           depend="true"
           listfiles="${javac.listfiles}"
           destdir="${build}">

      <compilerarg compiler="jikes" value="+Peffective-java"/>
      <compilerarg compiler="jikes" value="+Punused-type-imports"/>
      <compilerarg compiler="jikes" value="+Punused-package-imports"/>

      <classpath refid="project.class.path"/>

      <patternset id="output.email">
        <include name="output/email/*.java"/>
      </patternset>

    </javac>
  </target>

  <!--
  ***************************************************************************
		      Version and Build-info Targets
  ***************************************************************************
  -->

  <!-- Load the API version from the appropriate resource bundle -->

  <target name="-get.version" description="Get the version stamp">
    <property file="${build}/org/clapper/curn/Curn.properties"/>
    <echo>Version: ${curn.version}</echo>
  </target>

  <target name="version" depends="-get.version"/>

  <target name="-build.info" depends="-get.version">

    <taskdef name="make_build_info"
             classname="org.clapper.util.ant.MakeBuildInfoTask"/>

    <condition property="compiler" value="${build.compiler}">
      <isset property="build.compiler"/>
    </condition>

    <condition property="compiler" value="javac">
      <not>
        <isset property="build.compiler"/>
      </not>
    </condition>

    <make_build_info file="${build.info.file}"
                     antversion="${ant.version}"
                     compiler="${compiler}"/>
  </target>

  <!--
  ***************************************************************************
			      Javadoc targets
  ***************************************************************************
  -->

  <target name="javadocs" description="Generate API Javadocs">
    <mkdir dir="${javadocs_api_dir}"/>
    <javadoc
             destdir="${javadocs_api_dir}"
             sourcepath="${src.top}"
	     source="1.4"
	     breakiterator="true"
             author="true"
             version="true"
             splitindex="true"
             use="true"
             excludepackagenames=""
	     overview="overview.html"
             packagenames="org.clapper.curn.*"
             classpathref="project.class.path"
             windowtitle="clapper.org curn utility">
      <doctitle><![CDATA[<h1><i>curn</i>: Customizable Utilitarian RSS Notifier</h1>]]></doctitle>
      <bottom><![CDATA[<i>Copyright &#169; 2004 <NAME>. All Rights Reserved.</i>]]></bottom>
    </javadoc>
  </target>

  <target name="javadoc" depends="javadocs"/>

  <!--
  ***************************************************************************
			     Packaging Targets
  ***************************************************************************
  -->

  <target name="-set.version.properties" depends="-get.version">
    <property name="versioned_src_zipfile"
              value="src-${curn.version}.zip"/>

    <property name="versioned_code_jar_file"
              value="${code_jar_name}-${curn.version}.jar"/>

    <property name="versioned_docs_zipfile"
              value="docs-${curn.version}.zip"/>

    <property name="versioned_javadocs_zipfile"
              value="javadocs-${curn.version}.zip"/>
  </target>

  <target name="code.jar" depends="all"
          description="Generate the binary jar file">
    <mkdir dir="${code_jar_dir}"/>
    <jar jarfile="${code_jar_path}" basedir="${build}"/>
  </target>

  <target name="dist" depends="code.jar"
          description="Synonym for code.jar"/>

  <target name="javadoczip" depends="javadocs"
          description="Builds the javadocs zip file">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_javadocs_zipfile}">
      <zipfileset dir="${javadocs_top_dir}"
                  prefix="${javadoc_zip_dir_prefix}"/>
    </zip>
  </target>

  <target name="doczip"
          description="Builds the non-Javadocs documentation zip file">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_docs_zipfile}">
      <zipfileset dir="${docs_top_dir}"
                  prefix="${zip_dir_prefix}"/>
    </zip>
  </target>

  <target name="srczip" depends=""
          description="Generate the source zip">
    <mkdir dir="${release_dir}"/>
    <zip destfile="${release_dir}/${versioned_src_zipfile}">
      <zipfileset dir="."
                  prefix="${zip_dir_prefix}" casesensitive="yes">
        <exclude name="${dist}/**"/>
        <exclude name="${build}"/>
        <exclude name="**/CVS"/>
        <include name="**/*.java"/>
        <include name="**/package.html"/>
        <include name="overview.html"/>
        <include name="**/*.xml"/>
      </zipfileset>
    </zip>
  </target>

  <target name="fulldist"
          depends="dist,-set.version.properties,srczip,doczip,javadoczip"
          description="Generate the distribution and source jars">
    <copy file="${code_jar_path}"
          tofile="${release_dir}/${versioned_code_jar_file}"/>
  </target>

  <!--
  ***************************************************************************
			     Clean-up Targets
  ***************************************************************************
  -->

  <target name="clean"
          description="clean up" >

    <delete failonerror="false">
      <fileset refid="generated.HTMLOutputHandler.files"/>
    </delete>

    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${build}"/>
    </delete>

    <delete failonerror="false" includeEmptyDirs="true">
      <fileset dir="${dist}"/>
    </delete>
  </target>
</project>

{'fraction_non_alphanumeric': 0.25890948387248336, 'fraction_numerical': 0.0015504968637677075, 'mean_word_length': 3.4513228066506327, 'pattern_counts': {'":': 0, '<': 639, '<?xml version=': 0, '>': 639, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 38}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4166766', 'n_tokens_mistral': 12144, 'n_tokens_neox': 11337, 'n_words': 2525}