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

<!-- Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
     
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
     
         http://www.apache.org/licenses/LICENSE-2.0
     
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. -->

<!-- ====================================================================== 
     build-java-source    
     Compile the Java source and package in component archives.
     ====================================================================== -->
<project name="build-java-source" default="default" basedir="../modules">
    <description>
		Compile the Java source and package in component archives.
    </description>

    <!-- Users need to set this property to use a different compiler -->
    <!-- To use the eclipse compiler set the value of the below      -->
    <!-- property to be "org.eclipse.jdt.core.JDTCompilerAdapter"    -->
    <!-- This requires that the CLASSPATH of the environment where   -->
    <!-- this Ant is running includes the Eclipse archives           -->
    <!-- jdtCompilerAdapter.jar and org.eclipse.jdt.core_3.1.0.jar   -->
    <property name="build.compiler" value="modern" />

    <property name="build.output" location="../bin" />
    <property name="depends.jars" location="../depends/jars" />
    <property name="depends.files" location="../depends/files" />
    <property name="components.patternsets" location="../depends/patternsets" />
    <property name="components.output" location="../components" />
    <property name="target.output" location="../deploy" />


    <!-- ================================= 
          target: default              
         ================================= -->
    <target name="default" 
        description="Compile the Java source and package in component archives." 
        depends="clean, compile, package, layout" />


    <!-- ================================= 
          target: clean            
         ================================= -->
    <target name="clean" depends="clean-bin, clean-layout, clean-package" />


    <!-- ================================= 
          target: clean-bin              
         ================================= -->
    <target name="clean-bin" description="Delete all built classes">
        <delete includeemptydirs="true" failonerror="false">
            <fileset dir="${build.output}">
                <include name="**/**" />
            </fileset>
        </delete>
    </target>

    <!-- ================================= 
          target: clean-package
         ================================= -->
    <target name="clean-package" description="Delete all built component jars">
        <delete includeemptydirs="true" failonerror="false">
            <fileset dir="${components.output}">
                <include name="**/**" />
            </fileset>
        </delete>
    </target>

    <!-- ================================= 
          target: package
         ================================= -->
    <target name="package" depends="compile" description="Create component jars">
        <mkdir dir="${components.output}" />

        <!-- Create archive jar -->
        <jar destfile="${components.output}/archive.jar" manifest="archive/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/archive.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create (non-functional) kernel jar (to compile against) -->
        <jar destfile="${components.output}/kernel-stubs.jar" manifest="kernel/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create luni jar -->
        <jar destfile="${components.output}/luni.jar" manifest="luni/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/luni.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create nio jar -->
        <jar destfile="${components.output}/nio.jar" manifest="nio/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/nio.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create nio_char jar -->
        <jar destfile="${components.output}/nio_char.jar" manifest="nio_char/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/nio_char.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create security jar -->
        <jar destfile="${components.output}/security.jar" manifest="security/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/security.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create text jar -->
        <jar destfile="${components.output}/text.jar" manifest="text/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/text.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create math jar -->
        <jar destfile="${components.output}/math.jar" manifest="math/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/math.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create regex jar -->
        <jar destfile="${components.output}/regex.jar" manifest="regex/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/regex.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>
    </target>


    <!-- ================================= 
          target: compile              
         ================================= -->
    <target name="compile" depends="copy-resources" description="Compile the source">
        <mkdir dir="${build.output}" />

        <javac destdir="${build.output}" source="1.4" target="1.4" debug="on">
            <src path="kernel/src/main/java" />
            <src path="regex/src/main/java" />
            <src path="math/src/main/java" />
            <src path="archive/src/main/java" />
            <src path="luni/src/main/java" />
            <src path="nio/src/main/java" />
            <src path="nio_char/src/main/java" />
<!--  gmj : HACK :            <src path="security/src/main/java" /> -->
            <src path="security2/src/common/javasrc" />
            <src path="security2/src/windows/javasrc" />
        	
            <src path="text/src/main/java" />
            <classpath location="${build.output}" />
            <classpath>
                <fileset dir="${depends.jars}">
                    <include name="*.jar" />
                </fileset>
            </classpath>
        </javac>
    </target>


    <!-- ================================= 
          target: copy-resources              
         ================================= -->
    <target name="copy-resources" description="Copy non-Java files under src tree to the build output">
        <mkdir dir="${build.output}" />

        <copy todir="${build.output}" includeemptydirs="false">
            <fileset dir="archive/src/main/java">
                <exclude name="**/*.java" /><commit_msg>add a simple sql jar to the build <commit_after><?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
     
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
     
         http://www.apache.org/licenses/LICENSE-2.0
     
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License. -->

<!-- ====================================================================== 
     build-java-source    
     Compile the Java source and package in component archives.
     ====================================================================== -->
<project name="build-java-source" default="default" basedir="../modules">
    <description>
		Compile the Java source and package in component archives.
    </description>

    <!-- Users need to set this property to use a different compiler -->
    <!-- To use the eclipse compiler set the value of the below      -->
    <!-- property to be "org.eclipse.jdt.core.JDTCompilerAdapter"    -->
    <!-- This requires that the CLASSPATH of the environment where   -->
    <!-- this Ant is running includes the Eclipse archives           -->
    <!-- jdtCompilerAdapter.jar and org.eclipse.jdt.core_3.1.0.jar   -->
    <property name="build.compiler" value="modern" />

    <property name="build.output" location="../bin" />
    <property name="depends.jars" location="../depends/jars" />
    <property name="depends.files" location="../depends/files" />
    <property name="components.patternsets" location="../depends/patternsets" />
    <property name="components.output" location="../components" />
    <property name="target.output" location="../deploy" />


    <!-- ================================= 
          target: default              
         ================================= -->
    <target name="default" 
        description="Compile the Java source and package in component archives." 
        depends="clean, compile, package, layout" />


    <!-- ================================= 
          target: clean            
         ================================= -->
    <target name="clean" depends="clean-bin, clean-layout, clean-package" />


    <!-- ================================= 
          target: clean-bin              
         ================================= -->
    <target name="clean-bin" description="Delete all built classes">
        <delete includeemptydirs="true" failonerror="false">
            <fileset dir="${build.output}">
                <include name="**/**" />
            </fileset>
        </delete>
    </target>

    <!-- ================================= 
          target: clean-package
         ================================= -->
    <target name="clean-package" description="Delete all built component jars">
        <delete includeemptydirs="true" failonerror="false">
            <fileset dir="${components.output}">
                <include name="**/**" />
            </fileset>
        </delete>
    </target>

    <!-- ================================= 
          target: package
         ================================= -->
    <target name="package" depends="compile" description="Create component jars">
        <mkdir dir="${components.output}" />

        <!-- Create archive jar -->
        <jar destfile="${components.output}/archive.jar" manifest="archive/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/archive.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create (non-functional) kernel jar (to compile against) -->
        <jar destfile="${components.output}/kernel-stubs.jar" manifest="kernel/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create luni jar -->
        <jar destfile="${components.output}/luni.jar" manifest="luni/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/luni.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create nio jar -->
        <jar destfile="${components.output}/nio.jar" manifest="nio/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/nio.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create nio_char jar -->
        <jar destfile="${components.output}/nio_char.jar" manifest="nio_char/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/nio_char.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create security jar -->
        <jar destfile="${components.output}/security.jar" manifest="security/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/security.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create text jar -->
        <jar destfile="${components.output}/text.jar" manifest="text/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/text.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create math jar -->
        <jar destfile="${components.output}/math.jar" manifest="math/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/math.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

        <!-- Create regex jar -->
        <jar destfile="${components.output}/regex.jar" manifest="regex/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/regex.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>
    	
        <!-- Create sql jar -->
        <jar destfile="${components.output}/sql.jar" manifest="sql/META-INF/MANIFEST.MF">
            <fileset dir="${build.output}" 
                includesfile="${components.patternsets}/sql.txt" 
                excludesfile="${components.patternsets}/kernel.txt" />
        </jar>

    </target>


    <!-- ================================= 
          target: compile              
         ================================= -->
    <target name="compile" depends="copy-resources" description="Compile the source">
        <mkdir dir="${build.output}" />

        <javac destdir="${build.output}" source="1.4" target="1.4" debug="on">
            <src path="kernel/src/main/java" />
            <src path="regex/src/main/java" />
            <src path="math/src/main/java" />
            <src path="archive/src/main/java" />
            <src path="luni/src/main/java" />
            <src path="nio/src/main/java" />
            <src path="nio_char/src/main/java" />
<!--  gmj : HACK :            <src path="security/src/main/java" /> -->
            <src path="security2/src/common/javasrc" />
            <src path="security2/src/windows/javasrc" />
            
        	<src path="sql/src/main/java" />        	
            <src path="text/src/main/java" />
        	
            <classpath location="${build.output}" />
            <classpath>
                <fileset dir="${depends.jars}">
                    <include name="*.jar" />
                </fileset>
            </classpath>
        </javac>
    </target>


    <!-- ================================= 
          target: copy-resources              
         ================================= -->
    <target name="copy-resources" description="Copy non-Java files under src tree to the build output">
        <mkdir dir="${build.output}" />

        <copy todir="${build.output}" includeemptydirs="false">
            <fileset dir="archive/src/main/java">
                <exclude name="**/*.java" />
{'fraction_non_alphanumeric': 0.2159660855027466, 'fraction_numerical': 0.002866013852400287, 'mean_word_length': 2.282830262642101, 'pattern_counts': {'":': 0, '<': 226, '<?xml version=': 2, '>': 226, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '70192', 'n_tokens_mistral': 4350, 'n_tokens_neox': 4062, 'n_words': 885}