<commit_before><?xml version="1.0"?>
<!--
    Copyright (C) 2004-2009 Orbeon, Inc.

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<?xml-stylesheet type="text/xsl" href="ant2html.xsl"?>
<project name="orbeon" default="orbeon-war" basedir=".">

    <!--<echoproperties/>-->

    <!-- set global build.root to be dir containing this file. -->
    <dirname property="build.root" file="${ant.file}"/>
    <property name="lib.dir" location="lib"/>
    <property name="build.dir" location="build"/>
    <property name="project.name" value="orbeon"/>
    <property name="war.dir" value="${build.dir}/${project.name}-war"/>
    <property name="war.inf" value="${war.dir}/WEB-INF"/>
    <property name="war.classes" value="${war.inf}/classes"/>
    <property name="war.lib" value="${war.inf}/lib"/>
    <property name="deploy.dir" value="${build.dir}/deploy"/>

    <property name="src.dir" location="src"/>

    <fileset id="war.libs" dir="${lib.dir}">
        <include name="dom4j-1_6_1.jar"/>
        <include name="log4j-1_2_15.jar"/>
        <include name="jaxen-1_1_beta_9.jar"/>
        <include name="saxpath-dev_orbeon.jar"/>

        <include name="xerces-resolver-2_9_orbeon_20070711.jar"/>
        <include name="xerces-serializer-2_9_orbeon_20070711.jar"/>
        <include name="xerces-xml-apis-2_9_orbeon_20070711.jar"/>
        <include name="xerces-xercesImpl-2_9_orbeon_20070711.jar"/>

        <include name="commons-collections-3_1.jar"/>
        <include name="commons-lang-2_3.jar"/>
        <include name="commons-cli-1_0.jar"/>
        <include name="commons-fileupload-1.2.1.jar"/>
        <include name="commons-io-1_1.jar"/>
        <include name="commons-beanutils-1_5.jar"/>
        <include name="commons-pool-1.3.jar"/>
        <include name="commons-discovery-0_2.jar"/>
        <include name="commons-httpclient-3_1.jar"/>
        <include name="commons-codec-1_3.jar"/>

        <include name="commons-digester-1_5.jar"/>
        <include name="commons-validator-1_0_2.jar"/>
        <include name="commons-logging-1_0_4.jar"/>

        <include name="axis_1_2_1-axis.jar"/>
        <include name="axis_1_2_1-jaxrpc.jar"/>
        <include name="axis_1_2_1-saaj.jar"/>
        <include name="axis_1_2_1-wsdl4j-1.5.1.jar"/>
        <include name="jakarta-oro-2_0_8_orbeon.jar"/>

        <include name="msv-20081113_orbeon_20081209.jar"/>
        <include name="msv-isorelax-20070407.jar"/>
        <include name="msv-xsdlib-20070407_orbeon_20100309.jar"/>
        <include name="msv-relaxngDatatype-20070407.jar"/>

        <include name="hsqldb-1_8_0_7.jar"/>
        <include name="jfreechart*"/>
        <include name="jcommon*"/>
        <include name="activation-1_0_2.jar"/>
        <include name="jtidy-8.0-20060801.131059-3.jar"/>
        <include name="tagsoup-1.2.jar"/>
        <include name="saxon-9-1-0-8_orbeon_20100413.jar"/>
        <include name="batik-all-1_6.jar"/>
        <include name="avalon-framework-4_2_0.jar"/>
        <include name="fop-0_93.jar"/>
        <include name="xmlgraphics-commons-1_1.jar"/>
        <include name="jakarta-poi*"/>
        <include name="metadata-extractor-2_1.jar"/>
        <include name="castor-0_9_4_3-xml.jar"/>
        <include name="antlr-2_7_4_orbeon.jar"/>
        <include name="jakarta-slide-webdavlib-2.0rc1.jar"/>

        <include name="exist-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-modules-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-optional-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-ngram-module-1_2_6_orbeon_20090702.jar"/>

        <include name="exist-antlr-2_7_6.jar"/>
        <include name="exist-jgroups-all-exist.jar"/>
        <include name="exist-jta.jar"/>
        <include name="exist-quartz-1_6_0.jar"/>
        <include name="exist-stax-api-1_0_1.jar"/>
        <include name="exist-ws-commons-util-1.0.2.jar"/>
        <include name="exist-xmldb.jar"/>
        <include name="exist-xmlrpc-client-3_1_1.jar"/>
        <include name="exist-xmlrpc-common-3_1_1.jar"/>
        <include name="exist-xmlrpc-server-3_1_1.jar"/>

        <include name="flyingsaucer-core-renderer_orbeon_20100512.jar"/>
        <include name="flyingsaucer-20100212-itext-2_1_7.jar"/>
        <include name="itext-bcmail-jdk14-138.jar"/>
        <include name="itext-bcprov-jdk14-138.jar"/>

        <include name="barcode4j-1.0.jar"/>

        <include name="jms-api-1_1.jar"/>
        <include name="mail-1_3_2.jar"/>

        <include name="pdfbox-0_7_1.jar"/>

        <!-- For directory scanner and SSH support -->
        <include name="ant-1_6_5.jar"/>

        <!-- For SSH support (currently in oxf:file processor) -->
        <include name="ant-jsch-1_6_5.jar"/>
        <include name="jsch-0.1.42.jar"/>
    </fileset>

    <target name="init">

        <tstamp/>
        <!--
            Past version numbers:

            dev-3.7.1       => released dev version
            dev-post-3.7.1  => post-release nightly build

            Future version numbers:

            3.8.0.beta      => beta for 3.8.0
            3.8.0.rc1       => release candidate for 3.8.0
            3.8.0           => final 3.8.0
            3.8.0.post      => builds post 3.8.0

            Full release number example:

            3.8.0.201004010558 => final 3.8.0

            Suffix CE or PE is separate from the version number.
         -->
        <property name="version.number" value="3.8.0.post"/>
        <property name="edition" value="CE"/>
        <!-- Can be overridden on command-line to provide different suffix -->
        <property name="artifact.suffix" value="-${edition}"/>
        <property name="version.suffix" value=""/>
        <tstamp>
            <format property="time" pattern="yyyyMMddHHmm" timezone="GMT"/>
        </tstamp>
        <property name="release.number" value="${version.number}.${time}${version.suffix}"/>

        <!-- User-friendly message -->
        <echo message="Building Orbeon Forms ${release.number}"/>

        <!-- dump version string with dots in into a file, then read that file convert -->
        <!-- the dots to underscores while reading.   i.e. convert 2.5.4-3234 to      -->
        <!-- 2_5_4_3234                                                                -->
        <tempfile property="ops-temp-version-file"/>
        <echo message="${project.name}-version=${release.number}" file="${ops-temp-version-file}"/>

        <loadproperties srcFile="${ops-temp-version-file}">
            <filterchain>
                <tokenfilter>
                    <!-- Cannot seem to be able to tell ant to replace "-" here! -->
                    <replacestring from="." to="_"/>
                </tokenfilter>
            </filterchain>
        </loadproperties>
        <delete file="${ops-temp-version-file}"/>

        <!-- Provide custom version number to TeamCity -->
        <echo message="##teamcity[buildNumber '${orbeon-version}']"/>

        <property name="java-src.dir" value="${src.dir}/java"/>
        <property name="examples-cli-src.dir" value="${src.dir}/examples-cli"/>
        <property name="resources.dir" value="${src.dir}/resources"/>
        <property name="resources-packaged.dir" value="${src.dir}/resources-packaged"/>
        <property name="test-src.dir" location="test/src"/>

        <property name="build.classes.dir" value="${build.dir}/classes"/>
        <property name="build.test-classes.dir" value="${build.dir}/test-classes"/>
        <property name="build.lib.dir" value="${build.dir}/lib"/>
        <property name="build.distrib.dir" value="${build.dir}/distrib"/>
        <property name="build.temp.dir" value="${build.dir}/temp"/>
        <property name="build.doc.dir" value="${build.dir}/doc"/>

        <property name="test.tmp.dir" location="${build.temp.dir}/test"/>
        <property name="test.exist-db.dir" location="${src.dir}/resources-packaged/ops/unit-tests/exist-data"/>

        <property name="jar.file" value="${build.lib.dir}/${project.name}.jar"/>
        <property name="xforms-filter.jar.file" value="${build.lib.dir}/${project.name}-xforms-filter.jar"/>
        <property name="cli.jar.file" value="${build.lib.dir}/${project.name}-cli.jar"/>
        <property name="resources-private.jar.file" value="${build.lib.dir}/${project.name}-resources-private.jar"/>
        <property name="resources-public.jar.file" value="${build.lib.dir}/${project.name}-resources-public.jar"/>
        <property name="form-runner.jar.file" value="${build.lib.dir}/${project.name}-form-runner.jar"/>
        <property name="form-builder.jar.file" value="${build.lib.dir}/${project.name}-form-builder.jar"/>

        <property name="build.compiler" value="modern"/>
        <property name="build.compiler.pedantic" value="false"/>
        <property name="build.compiler.fulldepend" value="true"/>
        <property name="build.debug" value="on"/>
    </target>

    <!-- Create build dir and web application dir -->
    <target name="prepare" depends="init">
        <mkdir dir="${build.classes.dir}"/>
        <mkdir dir="${build.lib.dir}"/>
        <condition property="is.debug">
            <equals arg1="${debug.enabled}" arg2="true"/>
        </condition>
    </target>

    <!-- Set classpath to compile and run the application -->
    <target name="classpath" depends="prepare">
        <path id="class.path">
            <pathelement location="${jar.file}"/>
            <fileset dir="${lib.dir}">
                <include name="**/*.jar"/>
            </fileset>
            <!--            <pathelement location="${build.classes.dir}"/>-->
            <pathelement location="${java.home}/../lib/tools.jar"/>
        </path>
    </target>

    <!-- Compile source -->
    <target name="classes" depends="classpath" unless="skip.compilation">
        <mkdir dir="${build.dir}/src"/>
        <copy todir="${build.dir}/src" file="${java-src.dir}/org/orbeon/oxf/common/Version.java" overwrite="true">
            <filterset>
                <filter token="RELEASE" value="${release.number}"/>
                <filter token="EDITION" value="${edition}"/>
            </filterset>
        </copy>
        <javac destdir="${build.classes.dir}"
            classpathref="class.path"
            debug="${build.debug}" optimize="off" target="1.5" source="1.5"
            fork="false" memoryInitialSize="128m" memoryMaximumSize="256m" encoding="utf-8">
            <src path="${build.dir}/src"/>
            <src path="${java-src.dir}"/>
            <exclude name="org/orbeon/oxf/common/Version.java"/>
            <exclude name="org/orbeon/oxf/xforms/analysis/PathMapUIDependencies.java"/>
        </javac>
    </target>

    <!-- Compile test source -->
    <target name="test-classes" depends="classes">
        <mkdir dir="${build.test-classes.dir}"/>
        <javac srcdir="${test-src.dir}" destdir="${build.test-classes.dir}"
            classpathref="class.path" debug="on" optimize="off" target="1.5" source="1.5"
            includes="**/*.java" encoding="utf-8">
        </javac>
    </target>

    <target name="transform" depends="prepare">
      <property name="xsd-prefix" value="/org/orbeon/oxf/xml/schemas/page-flow-controller"/>
      <xslt
        style="src/xslt/page-flow-controller-xsd.xslt"
        in="${java-src.dir}${xsd-prefix}.xsd"
        out="${build.classes.dir}${xsd-prefix}-runtime.xsd"
      />
    </target>

    <!-- JARs -->
    <target name="jars" depends="classes,transform,orbeon-css-templates,orbeon-minify-js">
      <jar destfile="${jar.file}" compress="false">
          <fileset dir="${java-src.dir}">
              <include name="**/*.xml"/>
              <include name="**/*.rng"/>
              <include name="**/*.css"/>
              <include name="**/*.xsd"/>
              <include name="**/*.properties"/>
          </fileset>
          <fileset dir="${build.classes.dir}">
              <include name="**/*.class"/>
              <include name="**/*.xsd"/>
              <!-- These classes go into their own JAR -->
              <exclude name="org/orbeon/oxf/servlet/OPSXFormsFilter*.class"/>
              <exclude name="org/orbeon/oxf/servlet/OrbeonXFormsFilter*.class"/>
          </fileset>
          <fileset dir="${resources-packaged.dir}">
              <include name="config/*-processors.xml"/>
              <include name="*.xml"/>
          </fileset>
          <!-- WHY DO WE NEED THIS? WE DON'T WANT ANYBODY TO TOUCH OUR XERCES, RIGHT? -->
          <!--<zipfileset dir="descriptors/jar" prefix="META-INF">-->
            <!--<exclude name='*.MF' />-->
          <!--</zipfileset>-->
        </jar>

        <jar destfile="${xforms-filter.jar.file}" compress="false">
          <fileset dir="${build.classes.dir}">
              <include name="org/orbeon/oxf/servlet/OPSXFormsFilter*.class"/>
              <include name="org/orbeon/oxf/servlet/OrbeonXFormsFilter*.class"/>
          </fileset>
        </jar>

        <pathconvert dirsep="/" pathsep=" " property="cli.jar.mf.cp" refid="war.libs">
          <map from="${lib.dir}" to="lib"/>
        </pathconvert>

        <basename file="${jar.file}" property="jar.name"/>

        <jar destfile="${cli.jar.file}" compress="false"  >
          <manifest>
            <attribute name="Main-Class" value="org.orbeon.oxf.main.OPS"/>
            <attribute name="Class-Path" value="lib/${jar.name} lib/${project.name}-resources-private.jar commons-cli-1_0.jar ${cli.jar.mf.cp}"/>
          </manifest>
        </jar>

        <!-- Build private resources JAR -->
        <jar destfile="${resources-private.jar.file}" compress="false">
            <fileset dir="${resources-packaged.dir}">
                <include name="xbl/**/*.xbl"/>
                <include name="xbl/**/*.xsl"/>
                <include name="xbl/**/*.xml"/>
                <include name="ops/**"/>
                <exclude name="ops/unit-tests"/>
                <exclude name="ops/unit-tests/**"/>
                <exclude name="ops/css-templates"/>
                <exclude name="ops/css-templates/**"/>
                <exclude name="ops/**/*.css"/>
                <exclude name="ops/**/*.js"/>
                <exclude name="ops/**/*.gif"/>
                <exclude name="ops/**/*.png"/>
                <exclude name="ops/**/*.ico"/>
                <exclude name="ops/**/*.jpg"/>
                <exclude name="ops/**/*.html"/>
                <exclude name="ops/**/*.htc"/>
                <exclude name="ops/fckeditor/_samples"/>
                <exclude name="ops/fckeditor/_samples/**"/>
                <exclude name="ops/fckeditor/editor/_source"/>
                <exclude name="ops/fckeditor/editor/_source/**"/>
                <exclude name="ops/fckeditor/_testcases"/>
                <exclude name="ops/fckeditor/_testcases/**"/>
                <exclude name="ops/fckeditor/**/*.cfm"/>
                <exclude name="ops/fckeditor/**/*.cfc"/>
                <exclude name="ops/fckeditor/**/*.asp"/>
                <exclude name="ops/fckeditor/**/*.afp"/>
                <exclude name="ops/fckeditor/**/*.cgi"/>
                <exclude name="ops/fckeditor/**/*.py"/>
                <exclude name="ops/fckeditor/**/*.aspx"/>
                <exclude name="ops/fckeditor/**/*.php"/>
                <exclude name="ops/fckeditor/**/*.pl"/>
                <exclude name="ops/fckeditor/**/*.lasso"/>
                <include name="oxf/**"/>
                <include name="config/**"/>
                <exclude name="config/theme"/>
                <exclude name="config/theme/**"/>
                <!-- We keep these in orbeon.jar -->
                <exclude name="config/*-processors.xml"/>
            </fileset>
        </jar>

        <!-- Build public resources JAR -->
        <jar destfile="${resources-public.jar.file}" compress="false">
            <fileset dir="${resources-packaged.dir}">
                <include name="xbl/**/*.css"/>
                <include name="xbl/**/*.js"/>
                <include name="xbl/**/*.gif"/>
                <include name="xbl/**/*.png"/>
                <include name="xbl/**/*.jpg"/>
                <include name="xbl/**/*.html"/>
                <include name="xbl/**/*.xhtml"/>
                <include name="xbl/**/*.htc"/>
                <include name="ops/**/*.css"/>
                <include name="ops/**/*.js"/>
                <include name="ops/**/*.gif"/>
                <include name="ops/**/*.png"/>
                <include name="ops/**/*.ico"/>
                <include name="ops/**/*.jpg"/>
                <include name="ops/**/*.html"/>
                <include name="ops/**/*.htc"/>
                <exclude name="ops/fckeditor/_samples"/>
                <exclude name="ops/fckeditor/_samples/**"/>
                <exclude name="ops/fckeditor/editor/_source"/>
                <exclude name="ops/fckeditor/editor/_source/**"/>
                <exclude name="ops/fckeditor/_testcases"/>
                <exclude name="ops/fckeditor/_testcases/**"/>
                <exclude name="config/theme"/>
                <exclude name="config/theme/**"/>
            </fileset>
            <zipfileset dir="${build.temp.dir}/theme" prefix="config/theme">
                <include name="*.css"/>
            </zipfileset>
            <zipfileset dir="${war.dir}/WEB-INF/resources/ops" prefix="ops">
                <include name="**/*.js"/>
            </zipfileset>
        </jar>

        <!-- Build Form Runner JAR -->
        <jar destfile="${form-runner.jar.file}" compress="false">
            <fileset dir="${resources.dir}">
                <include name="apps/fr/**/*.*"/>
                <exclude name="apps/fr/persistence/oracle/**/*.*"/>
                <exclude name="apps/fr/alfresco/**/*.*"/>
                <exclude name="apps/fr/print/print-pdf-template.xpl"/>
            </fileset>
        </jar><commit_msg>Fixed include vs. exclude.<commit_after><?xml version="1.0"?>
<!--
    Copyright (C) 2004-2009 Orbeon, Inc.

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<?xml-stylesheet type="text/xsl" href="ant2html.xsl"?>
<project name="orbeon" default="orbeon-war" basedir=".">

    <!--<echoproperties/>-->

    <!-- set global build.root to be dir containing this file. -->
    <dirname property="build.root" file="${ant.file}"/>
    <property name="lib.dir" location="lib"/>
    <property name="build.dir" location="build"/>
    <property name="project.name" value="orbeon"/>
    <property name="war.dir" value="${build.dir}/${project.name}-war"/>
    <property name="war.inf" value="${war.dir}/WEB-INF"/>
    <property name="war.classes" value="${war.inf}/classes"/>
    <property name="war.lib" value="${war.inf}/lib"/>
    <property name="deploy.dir" value="${build.dir}/deploy"/>

    <property name="src.dir" location="src"/>

    <fileset id="war.libs" dir="${lib.dir}">
        <include name="dom4j-1_6_1.jar"/>
        <include name="log4j-1_2_15.jar"/>
        <include name="jaxen-1_1_beta_9.jar"/>
        <include name="saxpath-dev_orbeon.jar"/>

        <include name="xerces-resolver-2_9_orbeon_20070711.jar"/>
        <include name="xerces-serializer-2_9_orbeon_20070711.jar"/>
        <include name="xerces-xml-apis-2_9_orbeon_20070711.jar"/>
        <include name="xerces-xercesImpl-2_9_orbeon_20070711.jar"/>

        <include name="commons-collections-3_1.jar"/>
        <include name="commons-lang-2_3.jar"/>
        <include name="commons-cli-1_0.jar"/>
        <include name="commons-fileupload-1.2.1.jar"/>
        <include name="commons-io-1_1.jar"/>
        <include name="commons-beanutils-1_5.jar"/>
        <include name="commons-pool-1.3.jar"/>
        <include name="commons-discovery-0_2.jar"/>
        <include name="commons-httpclient-3_1.jar"/>
        <include name="commons-codec-1_3.jar"/>

        <include name="commons-digester-1_5.jar"/>
        <include name="commons-validator-1_0_2.jar"/>
        <include name="commons-logging-1_0_4.jar"/>

        <include name="axis_1_2_1-axis.jar"/>
        <include name="axis_1_2_1-jaxrpc.jar"/>
        <include name="axis_1_2_1-saaj.jar"/>
        <include name="axis_1_2_1-wsdl4j-1.5.1.jar"/>
        <include name="jakarta-oro-2_0_8_orbeon.jar"/>

        <include name="msv-20081113_orbeon_20081209.jar"/>
        <include name="msv-isorelax-20070407.jar"/>
        <include name="msv-xsdlib-20070407_orbeon_20100309.jar"/>
        <include name="msv-relaxngDatatype-20070407.jar"/>

        <include name="hsqldb-1_8_0_7.jar"/>
        <include name="jfreechart*"/>
        <include name="jcommon*"/>
        <include name="activation-1_0_2.jar"/>
        <include name="jtidy-8.0-20060801.131059-3.jar"/>
        <include name="tagsoup-1.2.jar"/>
        <include name="saxon-9-1-0-8_orbeon_20100413.jar"/>
        <include name="batik-all-1_6.jar"/>
        <include name="avalon-framework-4_2_0.jar"/>
        <include name="fop-0_93.jar"/>
        <include name="xmlgraphics-commons-1_1.jar"/>
        <include name="jakarta-poi*"/>
        <include name="metadata-extractor-2_1.jar"/>
        <include name="castor-0_9_4_3-xml.jar"/>
        <include name="antlr-2_7_4_orbeon.jar"/>
        <include name="jakarta-slide-webdavlib-2.0rc1.jar"/>

        <include name="exist-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-modules-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-optional-1_2_6_orbeon_20090702.jar"/>
        <include name="exist-ngram-module-1_2_6_orbeon_20090702.jar"/>

        <include name="exist-antlr-2_7_6.jar"/>
        <include name="exist-jgroups-all-exist.jar"/>
        <include name="exist-jta.jar"/>
        <include name="exist-quartz-1_6_0.jar"/>
        <include name="exist-stax-api-1_0_1.jar"/>
        <include name="exist-ws-commons-util-1.0.2.jar"/>
        <include name="exist-xmldb.jar"/>
        <include name="exist-xmlrpc-client-3_1_1.jar"/>
        <include name="exist-xmlrpc-common-3_1_1.jar"/>
        <include name="exist-xmlrpc-server-3_1_1.jar"/>

        <include name="flyingsaucer-core-renderer_orbeon_20100512.jar"/>
        <include name="flyingsaucer-20100212-itext-2_1_7.jar"/>
        <include name="itext-bcmail-jdk14-138.jar"/>
        <include name="itext-bcprov-jdk14-138.jar"/>

        <include name="barcode4j-1.0.jar"/>

        <include name="jms-api-1_1.jar"/>
        <include name="mail-1_3_2.jar"/>

        <include name="pdfbox-0_7_1.jar"/>

        <!-- For directory scanner and SSH support -->
        <include name="ant-1_6_5.jar"/>

        <!-- For SSH support (currently in oxf:file processor) -->
        <include name="ant-jsch-1_6_5.jar"/>
        <include name="jsch-0.1.42.jar"/>
    </fileset>

    <target name="init">

        <tstamp/>
        <!--
            Past version numbers:

            dev-3.7.1       => released dev version
            dev-post-3.7.1  => post-release nightly build

            Future version numbers:

            3.8.0.beta      => beta for 3.8.0
            3.8.0.rc1       => release candidate for 3.8.0
            3.8.0           => final 3.8.0
            3.8.0.post      => builds post 3.8.0

            Full release number example:

            3.8.0.201004010558 => final 3.8.0

            Suffix CE or PE is separate from the version number.
         -->
        <property name="version.number" value="3.8.0.post"/>
        <property name="edition" value="CE"/>
        <!-- Can be overridden on command-line to provide different suffix -->
        <property name="artifact.suffix" value="-${edition}"/>
        <property name="version.suffix" value=""/>
        <tstamp>
            <format property="time" pattern="yyyyMMddHHmm" timezone="GMT"/>
        </tstamp>
        <property name="release.number" value="${version.number}.${time}${version.suffix}"/>

        <!-- User-friendly message -->
        <echo message="Building Orbeon Forms ${release.number}"/>

        <!-- dump version string with dots in into a file, then read that file convert -->
        <!-- the dots to underscores while reading.   i.e. convert 2.5.4-3234 to      -->
        <!-- 2_5_4_3234                                                                -->
        <tempfile property="ops-temp-version-file"/>
        <echo message="${project.name}-version=${release.number}" file="${ops-temp-version-file}"/>

        <loadproperties srcFile="${ops-temp-version-file}">
            <filterchain>
                <tokenfilter>
                    <!-- Cannot seem to be able to tell ant to replace "-" here! -->
                    <replacestring from="." to="_"/>
                </tokenfilter>
            </filterchain>
        </loadproperties>
        <delete file="${ops-temp-version-file}"/>

        <!-- Provide custom version number to TeamCity -->
        <echo message="##teamcity[buildNumber '${orbeon-version}']"/>

        <property name="java-src.dir" value="${src.dir}/java"/>
        <property name="examples-cli-src.dir" value="${src.dir}/examples-cli"/>
        <property name="resources.dir" value="${src.dir}/resources"/>
        <property name="resources-packaged.dir" value="${src.dir}/resources-packaged"/>
        <property name="test-src.dir" location="test/src"/>

        <property name="build.classes.dir" value="${build.dir}/classes"/>
        <property name="build.test-classes.dir" value="${build.dir}/test-classes"/>
        <property name="build.lib.dir" value="${build.dir}/lib"/>
        <property name="build.distrib.dir" value="${build.dir}/distrib"/>
        <property name="build.temp.dir" value="${build.dir}/temp"/>
        <property name="build.doc.dir" value="${build.dir}/doc"/>

        <property name="test.tmp.dir" location="${build.temp.dir}/test"/>
        <property name="test.exist-db.dir" location="${src.dir}/resources-packaged/ops/unit-tests/exist-data"/>

        <property name="jar.file" value="${build.lib.dir}/${project.name}.jar"/>
        <property name="xforms-filter.jar.file" value="${build.lib.dir}/${project.name}-xforms-filter.jar"/>
        <property name="cli.jar.file" value="${build.lib.dir}/${project.name}-cli.jar"/>
        <property name="resources-private.jar.file" value="${build.lib.dir}/${project.name}-resources-private.jar"/>
        <property name="resources-public.jar.file" value="${build.lib.dir}/${project.name}-resources-public.jar"/>
        <property name="form-runner.jar.file" value="${build.lib.dir}/${project.name}-form-runner.jar"/>
        <property name="form-builder.jar.file" value="${build.lib.dir}/${project.name}-form-builder.jar"/>

        <property name="build.compiler" value="modern"/>
        <property name="build.compiler.pedantic" value="false"/>
        <property name="build.compiler.fulldepend" value="true"/>
        <property name="build.debug" value="on"/>
    </target>

    <!-- Create build dir and web application dir -->
    <target name="prepare" depends="init">
        <mkdir dir="${build.classes.dir}"/>
        <mkdir dir="${build.lib.dir}"/>
        <condition property="is.debug">
            <equals arg1="${debug.enabled}" arg2="true"/>
        </condition>
    </target>

    <!-- Set classpath to compile and run the application -->
    <target name="classpath" depends="prepare">
        <path id="class.path">
            <pathelement location="${jar.file}"/>
            <fileset dir="${lib.dir}">
                <include name="**/*.jar"/>
            </fileset>
            <!--            <pathelement location="${build.classes.dir}"/>-->
            <pathelement location="${java.home}/../lib/tools.jar"/>
        </path>
    </target>

    <!-- Compile source -->
    <target name="classes" depends="classpath" unless="skip.compilation">
        <mkdir dir="${build.dir}/src"/>
        <copy todir="${build.dir}/src" file="${java-src.dir}/org/orbeon/oxf/common/Version.java" overwrite="true">
            <filterset>
                <filter token="RELEASE" value="${release.number}"/>
                <filter token="EDITION" value="${edition}"/>
            </filterset>
        </copy>
        <javac destdir="${build.classes.dir}"
            classpathref="class.path"
            debug="${build.debug}" optimize="off" target="1.5" source="1.5"
            fork="false" memoryInitialSize="128m" memoryMaximumSize="256m" encoding="utf-8">
            <src path="${build.dir}/src"/>
            <src path="${java-src.dir}"/>
            <exclude name="org/orbeon/oxf/common/Version.java"/>
            <exclude name="org/orbeon/oxf/xforms/analysis/PathMapUIDependencies.java"/>
        </javac>
    </target>

    <!-- Compile test source -->
    <target name="test-classes" depends="classes">
        <mkdir dir="${build.test-classes.dir}"/>
        <javac srcdir="${test-src.dir}" destdir="${build.test-classes.dir}"
            classpathref="class.path" debug="on" optimize="off" target="1.5" source="1.5"
            includes="**/*.java" encoding="utf-8">
        </javac>
    </target>

    <target name="transform" depends="prepare">
      <property name="xsd-prefix" value="/org/orbeon/oxf/xml/schemas/page-flow-controller"/>
      <xslt
        style="src/xslt/page-flow-controller-xsd.xslt"
        in="${java-src.dir}${xsd-prefix}.xsd"
        out="${build.classes.dir}${xsd-prefix}-runtime.xsd"
      />
    </target>

    <!-- JARs -->
    <target name="jars" depends="classes,transform,orbeon-css-templates,orbeon-minify-js">
      <jar destfile="${jar.file}" compress="false">
          <fileset dir="${java-src.dir}">
              <include name="**/*.xml"/>
              <include name="**/*.rng"/>
              <include name="**/*.css"/>
              <include name="**/*.xsd"/>
              <include name="**/*.properties"/>
          </fileset>
          <fileset dir="${build.classes.dir}">
              <include name="**/*.class"/>
              <include name="**/*.xsd"/>
              <!-- These classes go into their own JAR -->
              <exclude name="org/orbeon/oxf/servlet/OPSXFormsFilter*.class"/>
              <exclude name="org/orbeon/oxf/servlet/OrbeonXFormsFilter*.class"/>
          </fileset>
          <fileset dir="${resources-packaged.dir}">
              <include name="config/*-processors.xml"/>
              <include name="*.xml"/>
          </fileset>
          <!-- WHY DO WE NEED THIS? WE DON'T WANT ANYBODY TO TOUCH OUR XERCES, RIGHT? -->
          <!--<zipfileset dir="descriptors/jar" prefix="META-INF">-->
            <!--<exclude name='*.MF' />-->
          <!--</zipfileset>-->
        </jar>

        <jar destfile="${xforms-filter.jar.file}" compress="false">
          <fileset dir="${build.classes.dir}">
              <include name="org/orbeon/oxf/servlet/OPSXFormsFilter*.class"/>
              <include name="org/orbeon/oxf/servlet/OrbeonXFormsFilter*.class"/>
          </fileset>
        </jar>

        <pathconvert dirsep="/" pathsep=" " property="cli.jar.mf.cp" refid="war.libs">
          <map from="${lib.dir}" to="lib"/>
        </pathconvert>

        <basename file="${jar.file}" property="jar.name"/>

        <jar destfile="${cli.jar.file}" compress="false"  >
          <manifest>
            <attribute name="Main-Class" value="org.orbeon.oxf.main.OPS"/>
            <attribute name="Class-Path" value="lib/${jar.name} lib/${project.name}-resources-private.jar commons-cli-1_0.jar ${cli.jar.mf.cp}"/>
          </manifest>
        </jar>

        <!-- Build private resources JAR -->
        <jar destfile="${resources-private.jar.file}" compress="false">
            <fileset dir="${resources-packaged.dir}">
                <include name="xbl/**/*.xbl"/>
                <include name="xbl/**/*.xsl"/>
                <include name="xbl/**/*.xml"/>
                <include name="ops/**"/>
                <exclude name="ops/unit-tests"/>
                <exclude name="ops/unit-tests/**"/>
                <exclude name="ops/css-templates"/>
                <exclude name="ops/css-templates/**"/>
                <exclude name="ops/**/*.css"/>
                <exclude name="ops/**/*.js"/>
                <exclude name="ops/**/*.gif"/>
                <exclude name="ops/**/*.png"/>
                <exclude name="ops/**/*.ico"/>
                <exclude name="ops/**/*.jpg"/>
                <exclude name="ops/**/*.html"/>
                <exclude name="ops/**/*.htc"/>
                <exclude name="ops/fckeditor/_samples"/>
                <exclude name="ops/fckeditor/_samples/**"/>
                <exclude name="ops/fckeditor/editor/_source"/>
                <exclude name="ops/fckeditor/editor/_source/**"/>
                <exclude name="ops/fckeditor/_testcases"/>
                <exclude name="ops/fckeditor/_testcases/**"/>
                <exclude name="ops/fckeditor/**/*.cfm"/>
                <exclude name="ops/fckeditor/**/*.cfc"/>
                <exclude name="ops/fckeditor/**/*.asp"/>
                <exclude name="ops/fckeditor/**/*.afp"/>
                <exclude name="ops/fckeditor/**/*.cgi"/>
                <exclude name="ops/fckeditor/**/*.py"/>
                <exclude name="ops/fckeditor/**/*.aspx"/>
                <exclude name="ops/fckeditor/**/*.php"/>
                <exclude name="ops/fckeditor/**/*.pl"/>
                <exclude name="ops/fckeditor/**/*.lasso"/>
                <include name="oxf/**"/>
                <include name="config/**"/>
                <exclude name="config/theme"/>
                <exclude name="config/theme/**"/>
                <!-- We keep these in orbeon.jar -->
                <exclude name="config/*-processors.xml"/>
            </fileset>
        </jar>

        <!-- Build public resources JAR -->
        <jar destfile="${resources-public.jar.file}" compress="false">
            <fileset dir="${resources-packaged.dir}">
                <include name="xbl/**/*.css"/>
                <include name="xbl/**/*.js"/>
                <include name="xbl/**/*.gif"/>
                <include name="xbl/**/*.png"/>
                <include name="xbl/**/*.jpg"/>
                <include name="xbl/**/*.html"/>
                <include name="xbl/**/*.xhtml"/>
                <include name="xbl/**/*.htc"/>
                <include name="ops/**/*.css"/>
                <include name="ops/**/*.js"/>
                <include name="ops/**/*.gif"/>
                <include name="ops/**/*.png"/>
                <include name="ops/**/*.ico"/>
                <include name="ops/**/*.jpg"/>
                <include name="ops/**/*.html"/>
                <include name="ops/**/*.htc"/>
                <exclude name="ops/fckeditor/_samples"/>
                <exclude name="ops/fckeditor/_samples/**"/>
                <exclude name="ops/fckeditor/editor/_source"/>
                <exclude name="ops/fckeditor/editor/_source/**"/>
                <exclude name="ops/fckeditor/_testcases"/>
                <exclude name="ops/fckeditor/_testcases/**"/>
                <include name="config/theme/**/*.*"/>
            </fileset>
            <zipfileset dir="${build.temp.dir}/theme" prefix="config/theme">
                <include name="*.css"/>
            </zipfileset>
            <zipfileset dir="${war.dir}/WEB-INF/resources/ops" prefix="ops">
                <include name="**/*.js"/>
            </zipfileset>
        </jar>

        <!-- Build Form Runner JAR -->
        <jar destfile="${form-runner.jar.file}" compress="false">
            <fileset dir="${resources.dir}">
                <include name="apps/fr/**/*.*"/>
                <exclude name="apps/fr/persistence/oracle/**/*.*"/>
                <exclude name="apps/fr/alfresco/**/*.*"/>
                <exclude name="apps/fr/print/print-pdf-template.xpl"/>
            </fileset>
        </jar>
{'fraction_non_alphanumeric': 0.18925907779410964, 'fraction_numerical': 0.022973487941640808, 'mean_word_length': 2.1251275944198706, 'pattern_counts': {'":': 0, '<': 652, '<?xml version=': 2, '>': 666, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 30}, 'pii_count': 2, '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': '1710592', 'n_tokens_mistral': 11749, 'n_tokens_neox': 10997, 'n_words': 1862}