<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================================= -->
<!-- eXist build file                                                        -->
<!-- ======================================================================= -->

<!-- $Id$ -->

<project basedir="../.." default="all" name="exist">

	<!-- import common targets -->
	<!-- <import file="../../build.xml"/> -->

	<!-- setup properties -->
    <property name="jetty.dir" value="tools/jetty"/>
    <property name="src" value="./src"/>
    <property name="src.webapp" value="./webapp"/>
    <property name="samples" value="./samples"/>
    <property name="bin" value="./bin"/>

    <property name="lib.core" value="./lib/core"/>
    <property name="lib.optional" value="./lib/optional"/>
    <property name="lib.endorsed" value="./lib/endorsed"/>
    <property name="lib.cocoon" value="./lib/cocoon"/>
    <property name="lib.user" value="./lib/user"/>
    <property name="lib.extensions" value="./extensions"/>

    <property name="build" value="./build"/>
    <property name="build.src" value="${build}/src"/>
    <property name="build.scripts" value="${build}/scripts"/>
    <property name="build.soap" value="${build}/soap"/>
    <property name="build.classes" value="${build}/classes"/>
    <property name="build.docs" value="${build}/docs"/>
    <property name="build.docs.src" value="${build.docs}/source"/>
    <property name="build.docs.html" value="${build.docs}/html"/>
    <property name="build.examples" value="${build}/examples"/>
    <property name="build.extensions" value="./extensions"/>
    <property name="build.extensions.indexes" value="${build.extensions}/indexes"/>
    <property name="tools.ant" value="./tools/ant"/>
    <property name="dist" value="./dist"/>
    <property name="webapp.dir" value="${dist}/webapp"/>
    <property name="build.compiler" value="modern"/>
    <property name="build.compiler.source" value="1.4"/>
    <property name="build.compiler.target" value="1.4"/>
    <property name="build.debug" value="on"/>
    <property name="build.optimize" value="on"/>
    <property name="build.deprecation" value="on"/>
    <property name="jvmarg" value="-Xmx128000k -Xms32000k -Djetty.home=${jetty.dir} -Dexist.home=${basedir}"/>
    <property name="xmldb.src" value="undefined"/>
    <property name="dist.dir" value="${dist}/${project.name}-${project.version}"/>

    <!-- setup conditional properties -->
    <available file="${xmldb.src}" type="dir" property="has.xmldb.src"/>
    <available file="${catalina.home}/bin" property="catalina.present"/>
    <available file="key.store" property="key.store.present"/>

    <!-- check build file for index extensions -->
    <uptodate property="extensions.uptodate"
              srcfile="${build.extensions.indexes}/modules.xml" targetfile="${build.extensions.indexes}/build.xml"/>

    <!-- additional set of ant tasks -->
    <property name="asocat-exist.jar" location="${tools.ant}/lib/asocat-exist.jar"/>

    <!-- setup class path -->
    <path id="classpath.core">
        <fileset dir="${lib.core}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.optional}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.endorsed}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.cocoon}">
        		<include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.user}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.extensions}">
            <include name="**/lib/*.jar"/>
        </fileset>        

        <fileset dir="${tools.ant}/lib">
            <include name="*.jar"/>
        </fileset>
        
        <pathelement path="exist.jar"/>
        <pathelement path="exist-optional.jar"/>
        <pathelement path="exist-modules.jar"/>
        <pathelement path="start.jar"/>
        <pathelement path="${java.class.path}"/>
    </path>
    
    <path id="classpath.jetty">
        <fileset dir="${jetty.dir}/lib">
            <include name="*.jar"/>
        </fileset>
    </path>
    
    <taskdef name="java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="axis-admin" classname="org.apache.axis.tools.ant.axis.AdminClientTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="cocoon" classname="org.apache.cocoon.CocoonTask">
        <classpath refid="classpath.core"/>
    </taskdef>
    
    <!-- =================================================================== -->
    <!-- Prepare the build                                                   -->
    <!-- =================================================================== -->
    <target name="prepare" depends="svn-prepare">
        
        <tstamp/>
        <property file="VERSION.txt"/>
        
        <echo message="-------------------------"/>
        <echo message="eXist ${project.version} build"/>
        <echo message="-------------------------"/>
        <echo message="SVN revision ${svn.revision}"/>    	
        <echo message=""/>
        <echo message="${ant.version}"/>
        <echo message="-------------------------"/>
        <echo/>
        <echo message="basedir=${basedir}"/>
        
        <mkdir dir="${build.classes}"/>
        <mkdir dir="${jetty.dir}/logs"/>
        <mkdir dir="${jetty.dir}/work"/>
        
        <filter token="version" value="${project.version}-${DSTAMP}"/>
        <filter token="database" value="native"/>

        <copy file="${src.webapp}/header.xml.tmpl"
            tofile="${src.webapp}/header.xml" filtering="true" overwrite="true" />
        <copy file="${src.webapp}/header.xml.tmpl"
            tofile="${src.webapp}/xquery/header.xml" filtering="true" overwrite="true"/>
        <copy file="${src.webapp}/xqts/config.xml.tmpl"
            tofile="${src.webapp}/xqts/config.xml" filtering="true"/>

        <copy file="${basedir}/conf.xml.tmpl" tofile="${basedir}/conf.xml" filtering="true"/>
        <copy file="${basedir}/client.properties.tmpl" tofile="${basedir}/client.properties" filtering="true"/>
        <copy file="${basedir}/server.xml.tmpl" tofile="${basedir}/server.xml" filtering="true"/>
        <copy file="${basedir}/descriptor.xml.tmpl" tofile="${basedir}/descriptor.xml" filtering="true"/>
        <copy file="${basedir}/mime-types.xml.tmpl" tofile="${basedir}/mime-types.xml" filtering="true"/>
        <copy file="${basedir}/mime-types.xml" tofile="${src}/org/exist/util/mime-types.xml" />
            
        <!-- <ant antfile="build.xml" dir="extensions/indexes" target="prepare"/> -->
    </target>

    <!-- =================================================================== -->
    <!-- Compiles the source code                                            --><commit_msg>Version message that is inserted in web index page was changed to include the current SVN revision number, to make it easier to track which SVN revision is running.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!-- ======================================================================= -->
<!-- eXist build file                                                        -->
<!-- ======================================================================= -->

<!-- $Id$ -->

<project basedir="../.." default="all" name="exist">

	<!-- import common targets -->
	<!-- <import file="../../build.xml"/> -->

	<!-- setup properties -->
    <property name="jetty.dir" value="tools/jetty"/>
    <property name="src" value="./src"/>
    <property name="src.webapp" value="./webapp"/>
    <property name="samples" value="./samples"/>
    <property name="bin" value="./bin"/>

    <property name="lib.core" value="./lib/core"/>
    <property name="lib.optional" value="./lib/optional"/>
    <property name="lib.endorsed" value="./lib/endorsed"/>
    <property name="lib.cocoon" value="./lib/cocoon"/>
    <property name="lib.user" value="./lib/user"/>
    <property name="lib.extensions" value="./extensions"/>

    <property name="build" value="./build"/>
    <property name="build.src" value="${build}/src"/>
    <property name="build.scripts" value="${build}/scripts"/>
    <property name="build.soap" value="${build}/soap"/>
    <property name="build.classes" value="${build}/classes"/>
    <property name="build.docs" value="${build}/docs"/>
    <property name="build.docs.src" value="${build.docs}/source"/>
    <property name="build.docs.html" value="${build.docs}/html"/>
    <property name="build.examples" value="${build}/examples"/>
    <property name="build.extensions" value="./extensions"/>
    <property name="build.extensions.indexes" value="${build.extensions}/indexes"/>
    <property name="tools.ant" value="./tools/ant"/>
    <property name="dist" value="./dist"/>
    <property name="webapp.dir" value="${dist}/webapp"/>
    <property name="build.compiler" value="modern"/>
    <property name="build.compiler.source" value="1.4"/>
    <property name="build.compiler.target" value="1.4"/>
    <property name="build.debug" value="on"/>
    <property name="build.optimize" value="on"/>
    <property name="build.deprecation" value="on"/>
    <property name="jvmarg" value="-Xmx128000k -Xms32000k -Djetty.home=${jetty.dir} -Dexist.home=${basedir}"/>
    <property name="xmldb.src" value="undefined"/>
    <property name="dist.dir" value="${dist}/${project.name}-${project.version}"/>

    <!-- setup conditional properties -->
    <available file="${xmldb.src}" type="dir" property="has.xmldb.src"/>
    <available file="${catalina.home}/bin" property="catalina.present"/>
    <available file="key.store" property="key.store.present"/>

    <!-- check build file for index extensions -->
    <uptodate property="extensions.uptodate"
              srcfile="${build.extensions.indexes}/modules.xml" targetfile="${build.extensions.indexes}/build.xml"/>

    <!-- additional set of ant tasks -->
    <property name="asocat-exist.jar" location="${tools.ant}/lib/asocat-exist.jar"/>

    <!-- setup class path -->
    <path id="classpath.core">
        <fileset dir="${lib.core}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.optional}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.endorsed}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.cocoon}">
        		<include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.user}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${lib.extensions}">
            <include name="**/lib/*.jar"/>
        </fileset>        

        <fileset dir="${tools.ant}/lib">
            <include name="*.jar"/>
        </fileset>
        
        <pathelement path="exist.jar"/>
        <pathelement path="exist-optional.jar"/>
        <pathelement path="exist-modules.jar"/>
        <pathelement path="start.jar"/>
        <pathelement path="${java.class.path}"/>
    </path>
    
    <path id="classpath.jetty">
        <fileset dir="${jetty.dir}/lib">
            <include name="*.jar"/>
        </fileset>
    </path>
    
    <taskdef name="java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="axis-admin" classname="org.apache.axis.tools.ant.axis.AdminClientTask">
        <classpath refid="classpath.core"/>
    </taskdef>

    <taskdef name="cocoon" classname="org.apache.cocoon.CocoonTask">
        <classpath refid="classpath.core"/>
    </taskdef>
    
    <!-- =================================================================== -->
    <!-- Prepare the build                                                   -->
    <!-- =================================================================== -->
    <target name="prepare" depends="svn-prepare">
        
        <tstamp/>
        <property file="VERSION.txt"/>
        
        <echo message="-------------------------"/>
        <echo message="eXist ${project.version} build"/>
        <echo message="-------------------------"/>
        <echo message="SVN revision ${svn.revision}"/>    	
        <echo message=""/>
        <echo message="${ant.version}"/>
        <echo message="-------------------------"/>
        <echo/>
        <echo message="basedir=${basedir}"/>
        
        <mkdir dir="${build.classes}"/>
        <mkdir dir="${jetty.dir}/logs"/>
        <mkdir dir="${jetty.dir}/work"/>
        
        <filter token="version" value="${project.version}-rev:${svn.revision}-${DSTAMP}"/>
        <filter token="database" value="native"/>

        <copy file="${src.webapp}/header.xml.tmpl"
            tofile="${src.webapp}/header.xml" filtering="true" overwrite="true" />
        <copy file="${src.webapp}/header.xml.tmpl"
            tofile="${src.webapp}/xquery/header.xml" filtering="true" overwrite="true"/>
        <copy file="${src.webapp}/xqts/config.xml.tmpl"
            tofile="${src.webapp}/xqts/config.xml" filtering="true"/>

        <copy file="${basedir}/conf.xml.tmpl" tofile="${basedir}/conf.xml" filtering="true"/>
        <copy file="${basedir}/client.properties.tmpl" tofile="${basedir}/client.properties" filtering="true"/>
        <copy file="${basedir}/server.xml.tmpl" tofile="${basedir}/server.xml" filtering="true"/>
        <copy file="${basedir}/descriptor.xml.tmpl" tofile="${basedir}/descriptor.xml" filtering="true"/>
        <copy file="${basedir}/mime-types.xml.tmpl" tofile="${basedir}/mime-types.xml" filtering="true"/>
        <copy file="${basedir}/mime-types.xml" tofile="${src}/org/exist/util/mime-types.xml" />
            
        <!-- <ant antfile="build.xml" dir="extensions/indexes" target="prepare"/> -->
    </target>

    <!-- =================================================================== -->
    <!-- Compiles the source code                                            -->
{'fraction_non_alphanumeric': 0.25564014807571417, 'fraction_numerical': 0.0030732695397080395, 'mean_word_length': 2.6902061855670105, 'pattern_counts': {'":': 0, '<': 267, '<?xml version=': 2, '>': 267, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 48}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1852734', 'n_tokens_mistral': 4153, 'n_tokens_neox': 3992, 'n_words': 678}