<commit_before><!--
	FindBugs Ant build script.
	Based on original FindBugs Ant Script by <NAME>.
	Rewritten 1/5/2005 by <NAME>.
-->

<project name="findbugs" default="build">

	<!--
	        The local.properties properties file contains the location of eclipsePlugin.dir

	        This value is likely to be different for each checkout of the plugin,
	        so the local.properties file is not managed by cvs

	-->
	<property file="local.properties" />

	<property file="build.properties" />

	<property name="jar.dir" value="lib"/>
	<property name="plugin.dir" value="plugin"/>
	<property name="build.dir" value="build"/>
	<property name="junit.dir" value="build/junit"/>
	<property name="classes.dir" value="build/classes"/>
	<property name="eclipseClasses.dir" value="classesEclipse"/>
	<property name="junitclasses.dir" value="build/junitclasses"/>
	<property name="scripts.dir" value="bin"/>
	<property name="src.dir" value="src/java"/>
	<property name="src5.dir" value="src/java5"/>
	<property name="toolsrc.dir" value="src/tools"/>
	<property name="anttasksrc.dir" value="src/antTask"/>
	<property name="scriptsrc.dir" value="src/scripts"/>
	<property name="patch.dir" value="src/patches"/>
	<property name="xslsrc.dir" value="src/xsl"/>
	<property name="junitsrc.dir" value="src/junit"/>
	<property name="docsrc.dir" value="src/doc"/>
	<property name="etc.dir" value="etc"/>
	<property name="test.dir" value="test"/>
	<property name="doc.dir" value="doc"/>
	<property name="web.dir" value="web"/>
	<property name="apiDoc.dir" value="apiJavaDoc"/>
	<property name="annotationDoc.dir" value="annotationJavaDoc"/>
	<property name="jnlp.dir" value="jnlp"/>
	<property name="jsr305.dir" value="../JSR305-ri"/>
	<property name="pkg.base" value="edu/umd/cs/findbugs"/>
	<property name="engine.jar" value="${jar.dir}/findbugs.jar"/>
	<property name="oneFourCompatibility.jar" value="${build.dir}/oneFourCompatibility.jar"/>
	<property name="annotations.jar" value="${jar.dir}/annotations.jar"/>
	<property name="test.jar" value="${test.dir}/dumb.jar"/>
	<property name="sampleoutput.dir" value="build/sampleoutput"/>
	<property name="junittests.jar" value="build/junittests.jar"/>
	<property name="anttask.jar" value="${jar.dir}/findbugs-ant.jar"/>
	<property name="scripts.props" value="etc/script.properties"/>
	<property name="scripts.stamp" value="${build.dir}/scripts.stamp"/>
	<property name="allClassFiles.jar" value="${build.dir}/allClassFiles.jar"/>
	<property name="doc.props.file" value="${etc.dir}/doc.properties"/>
	<property name="version.props.file" value="${build.dir}/classes/edu/umd/cs/findbugs/version.properties"/>

	<path id="findbugs.classpath">
		<pathelement location="${jar.dir}/bcel.jar"/>
		<pathelement location="${jar.dir}/dom4j-1.6.1.jar"/>
		<pathelement location="${jar.dir}/AppleJavaExtensions.jar"/>
		<pathelement location="${jar.dir}/junit.jar"/>
		<pathelement location="${jar.dir}/asm-3.3.jar"/>
		<pathelement location="${jar.dir}/asm-commons-3.3.jar"/>
		<pathelement location="${jar.dir}/asm-tree-3.3.jar"/>
		<pathelement location="${jar.dir}/jaxen-1.1.1.jar"/>
		<pathelement location="${jar.dir}/jsr305.jar"/>
		<pathelement location="${jar.dir}/jFormatString.jar"/>
		<pathelement location="${jar.dir}/commons-lang-2.4.jar"/>
	</path>

	<path id="tools.classpath">
		<pathelement location="${classes.dir}"/>
		<pathelement location="${jar.dir}/findbugs.jar"/>
		<pathelement location="${jar.dir}/jdepend-2.9.jar"/>
		<path refid="findbugs.classpath"/>
	</path>

	<!-- Need these jars for ant target 'srcdist', which uses
             subversion.  Grab them at:
             http://subclipse.tigris.org/files/documents/906/32898/svnant-1.0.0.zip -->
	<path id="svn.classpath">
	    <pathelement location="${svnant.home}/lib/svnant.jar"/>
	    <pathelement location="${svnant.home}/lib/svnClientAdapter.jar"/>
	</path>

	<patternset id="codebase.data.pats">
		<include name="**/*.properties"/>
		<include name="**/*.png"/>
		<include name="**/*.html"/>
		<include name="**/*.db"/>
	</patternset>

	<patternset id="doc.src.pats">
		<include name="**/*.html"/>
		<include name="**/*.txt"/>
		<include name="**/*.xml"/>
		<include name="**/*.xsl"/>
	</patternset>

	<patternset id="doc.img.pats">
		<include name="**/*.png"/>
		<include name="**/*.css"/>
		<include name="**/*.txt"/>
		<include name="**/*.pdf"/>
	</patternset>

        <fileset id="plugin.jars" dir="${plugin.dir}" includes="*.jar"/>
	<property name="prop.plugin.jars" refid="plugin.jars"/>


	<!-- Default target builds scripts and jars, allowing execution using
		the working directory as FINDBUGS_HOME.  Also build test case jarfile. -->
	<target name="build" depends="jars,scripts,anttask"/>

	<!-- Rebuild from scratch. -->
	<target name="rebuild" depends="clean,build"/>

	<target name="mondo" depends="jars">
	<jar destfile="build/mondo.jar"
		manifest="etc/MANIFEST-findbugs-mondo.MF">
		<zipfileset src="${jar.dir}/bcel.jar"/>
		<zipfileset src="${jar.dir}/dom4j-1.6.1.jar"/>
		<zipfileset src="${jar.dir}/AppleJavaExtensions.jar"/>
		<zipfileset src="${jar.dir}/junit.jar"/>
		<zipfileset src="${jar.dir}/asm-3.3.jar"/>
		<zipfileset src="${jar.dir}/asm-commons-3.3.jar"/>
		<zipfileset src="${jar.dir}/asm-tree-3.3.jar"/>
		<zipfileset src="${jar.dir}/jaxen-1.1.1.jar"/>
		<zipfileset src="${jar.dir}/jsr305.jar"/>
		<zipfileset src="${jar.dir}/jFormatString.jar"/>
		<zipfileset src="${jar.dir}/commons-lang-2.4.jar"/>
		<zipfileset src="${jar.dir}/findbugs.jar"/>
	</jar>
	</target>

	<!-- Compile Java source files, and copy other files (properties,
		images, html, XSL stylesheets) that need to be part of the codebase. -->
	<target name="classes" depends="init">

		<!-- Compile Java source files. -->
		<echo level="info" message="compiling findbugs"/>
		<javac
						destdir="${classes.dir}"
						source="1.5"
						target="1.5"
                                                includeantruntime="false"
						encoding="ISO-8859-1"
						deprecation="off"
						debug="on">
					<compilerarg value="-Xlint:unchecked"/>
					<src path="${src.dir}"/>
					<src path="${src5.dir}"/>
					<classpath refid="findbugs.classpath"/>
				</javac>
        <native2ascii   encoding="Cp1252"
                dest = "${classes.dir}"
                src= "${src.dir}"
                includes = "${pkg.base}/**/*_de.properties"
			/>
		<!-- Copy codebase data files. -->
		<echo level="info" message="copying data files"/>
		<copy todir="${classes.dir}">
			<fileset dir="${src.dir}">
				<patternset refid="codebase.data.pats"/>
			</fileset>
			<fileset dir="${src5.dir}">
				<patternset refid="codebase.data.pats"/>
			</fileset>
			<fileset dir="${xslsrc.dir}">
				<include name="*.xsl"/>
			</fileset>
		</copy>
		<!-- Compile JUnit test cases. -->
		<echo level="info" message="compiling junit test cases"/>
		<javac srcdir="${junitsrc.dir}"
				destdir="${junitclasses.dir}"
				source="1.5"
				target="1.5"
                                includeantruntime="false"
                                encoding="ISO-8859-1"
				deprecation="off"
				debug="on">
			<classpath refid="tools.classpath"/>
		</javac>
		<!-- Compile tools. -->
		<echo level="info" message="compiling tools"/>
		<javac srcdir="${toolsrc.dir}"
				destdir="${classes.dir}"
				source="1.5"
				target="1.5"
                                includeantruntime="false"
                                encoding="ISO-8859-1"
				debug="on"
				deprecation="off"
				excludes="${pkg.base}/tools/patcomp/">
			<classpath refid="tools.classpath"/>
		</javac>
		<!-- Compile Ant task. -->
		<echo level="info" message="compiling ant task"/>
		<javac srcdir="${anttasksrc.dir}"
			destdir="${classes.dir}"
			source="1.5"
			target="1.5"
                        includeantruntime="false"
			encoding="ISO-8859-1"
			deprecation="off"
			debug="on">
			<classpath>
                            <path refid="tools.classpath"/>
                            <pathelement location="${ant.core.lib}"/>
                        </classpath>
		</javac>
	</target>

	<!-- Validate findbugs.xml and messagesXXX.xml files. -->
	<target name="validate">
		<xmlvalidate lenient="false" failonerror="yes">
			<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
			<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
			<fileset dir="${etc.dir}" includes="*.xml"/>
		</xmlvalidate>
	</target>

	<target name="validatesamplexmloutput" depends="runanttask">
		<schemavalidate failonerror="yes" noNamespaceFile="${etc.dir}/bugcollection.xsd">
			<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
			<fileset dir="${sampleoutput.dir}" includes="*.xml"/>
		</schemavalidate>
	</target>

	<target name="validatesamplehtmloutput" depends="applystylesheets">
		<xmlvalidate failonerror="no"><commit_msg>Re-add exclusion line for xmlvalidate task<commit_after><!--
	FindBugs Ant build script.
	Based on original FindBugs Ant Script by <NAME>.
	Rewritten 1/5/2005 by <NAME>.
-->

<project name="findbugs" default="build">

	<!--
	        The local.properties properties file contains the location of eclipsePlugin.dir

	        This value is likely to be different for each checkout of the plugin,
	        so the local.properties file is not managed by cvs

	-->
	<property file="local.properties" />

	<property file="build.properties" />

	<property name="jar.dir" value="lib"/>
	<property name="plugin.dir" value="plugin"/>
	<property name="build.dir" value="build"/>
	<property name="junit.dir" value="build/junit"/>
	<property name="classes.dir" value="build/classes"/>
	<property name="eclipseClasses.dir" value="classesEclipse"/>
	<property name="junitclasses.dir" value="build/junitclasses"/>
	<property name="scripts.dir" value="bin"/>
	<property name="src.dir" value="src/java"/>
	<property name="src5.dir" value="src/java5"/>
	<property name="toolsrc.dir" value="src/tools"/>
	<property name="anttasksrc.dir" value="src/antTask"/>
	<property name="scriptsrc.dir" value="src/scripts"/>
	<property name="patch.dir" value="src/patches"/>
	<property name="xslsrc.dir" value="src/xsl"/>
	<property name="junitsrc.dir" value="src/junit"/>
	<property name="docsrc.dir" value="src/doc"/>
	<property name="etc.dir" value="etc"/>
	<property name="test.dir" value="test"/>
	<property name="doc.dir" value="doc"/>
	<property name="web.dir" value="web"/>
	<property name="apiDoc.dir" value="apiJavaDoc"/>
	<property name="annotationDoc.dir" value="annotationJavaDoc"/>
	<property name="jnlp.dir" value="jnlp"/>
	<property name="jsr305.dir" value="../JSR305-ri"/>
	<property name="pkg.base" value="edu/umd/cs/findbugs"/>
	<property name="engine.jar" value="${jar.dir}/findbugs.jar"/>
	<property name="oneFourCompatibility.jar" value="${build.dir}/oneFourCompatibility.jar"/>
	<property name="annotations.jar" value="${jar.dir}/annotations.jar"/>
	<property name="test.jar" value="${test.dir}/dumb.jar"/>
	<property name="sampleoutput.dir" value="build/sampleoutput"/>
	<property name="junittests.jar" value="build/junittests.jar"/>
	<property name="anttask.jar" value="${jar.dir}/findbugs-ant.jar"/>
	<property name="scripts.props" value="etc/script.properties"/>
	<property name="scripts.stamp" value="${build.dir}/scripts.stamp"/>
	<property name="allClassFiles.jar" value="${build.dir}/allClassFiles.jar"/>
	<property name="doc.props.file" value="${etc.dir}/doc.properties"/>
	<property name="version.props.file" value="${build.dir}/classes/edu/umd/cs/findbugs/version.properties"/>

	<path id="findbugs.classpath">
		<pathelement location="${jar.dir}/bcel.jar"/>
		<pathelement location="${jar.dir}/dom4j-1.6.1.jar"/>
		<pathelement location="${jar.dir}/AppleJavaExtensions.jar"/>
		<pathelement location="${jar.dir}/junit.jar"/>
		<pathelement location="${jar.dir}/asm-3.3.jar"/>
		<pathelement location="${jar.dir}/asm-commons-3.3.jar"/>
		<pathelement location="${jar.dir}/asm-tree-3.3.jar"/>
		<pathelement location="${jar.dir}/jaxen-1.1.1.jar"/>
		<pathelement location="${jar.dir}/jsr305.jar"/>
		<pathelement location="${jar.dir}/jFormatString.jar"/>
		<pathelement location="${jar.dir}/commons-lang-2.4.jar"/>
	</path>

	<path id="tools.classpath">
		<pathelement location="${classes.dir}"/>
		<pathelement location="${jar.dir}/findbugs.jar"/>
		<pathelement location="${jar.dir}/jdepend-2.9.jar"/>
		<path refid="findbugs.classpath"/>
	</path>

	<!-- Need these jars for ant target 'srcdist', which uses
             subversion.  Grab them at:
             http://subclipse.tigris.org/files/documents/906/32898/svnant-1.0.0.zip -->
	<path id="svn.classpath">
	    <pathelement location="${svnant.home}/lib/svnant.jar"/>
	    <pathelement location="${svnant.home}/lib/svnClientAdapter.jar"/>
	</path>

	<patternset id="codebase.data.pats">
		<include name="**/*.properties"/>
		<include name="**/*.png"/>
		<include name="**/*.html"/>
		<include name="**/*.db"/>
	</patternset>

	<patternset id="doc.src.pats">
		<include name="**/*.html"/>
		<include name="**/*.txt"/>
		<include name="**/*.xml"/>
		<include name="**/*.xsl"/>
	</patternset>

	<patternset id="doc.img.pats">
		<include name="**/*.png"/>
		<include name="**/*.css"/>
		<include name="**/*.txt"/>
		<include name="**/*.pdf"/>
	</patternset>

        <fileset id="plugin.jars" dir="${plugin.dir}" includes="*.jar"/>
	<property name="prop.plugin.jars" refid="plugin.jars"/>


	<!-- Default target builds scripts and jars, allowing execution using
		the working directory as FINDBUGS_HOME.  Also build test case jarfile. -->
	<target name="build" depends="jars,scripts,anttask"/>

	<!-- Rebuild from scratch. -->
	<target name="rebuild" depends="clean,build"/>

	<target name="mondo" depends="jars">
	<jar destfile="build/mondo.jar"
		manifest="etc/MANIFEST-findbugs-mondo.MF">
		<zipfileset src="${jar.dir}/bcel.jar"/>
		<zipfileset src="${jar.dir}/dom4j-1.6.1.jar"/>
		<zipfileset src="${jar.dir}/AppleJavaExtensions.jar"/>
		<zipfileset src="${jar.dir}/junit.jar"/>
		<zipfileset src="${jar.dir}/asm-3.3.jar"/>
		<zipfileset src="${jar.dir}/asm-commons-3.3.jar"/>
		<zipfileset src="${jar.dir}/asm-tree-3.3.jar"/>
		<zipfileset src="${jar.dir}/jaxen-1.1.1.jar"/>
		<zipfileset src="${jar.dir}/jsr305.jar"/>
		<zipfileset src="${jar.dir}/jFormatString.jar"/>
		<zipfileset src="${jar.dir}/commons-lang-2.4.jar"/>
		<zipfileset src="${jar.dir}/findbugs.jar"/>
	</jar>
	</target>

	<!-- Compile Java source files, and copy other files (properties,
		images, html, XSL stylesheets) that need to be part of the codebase. -->
	<target name="classes" depends="init">

		<!-- Compile Java source files. -->
		<echo level="info" message="compiling findbugs"/>
		<javac
						destdir="${classes.dir}"
						source="1.5"
						target="1.5"
                                                includeantruntime="false"
						encoding="ISO-8859-1"
						deprecation="off"
						debug="on">
					<compilerarg value="-Xlint:unchecked"/>
					<src path="${src.dir}"/>
					<src path="${src5.dir}"/>
					<classpath refid="findbugs.classpath"/>
				</javac>
        <native2ascii   encoding="Cp1252"
                dest = "${classes.dir}"
                src= "${src.dir}"
                includes = "${pkg.base}/**/*_de.properties"
			/>
		<!-- Copy codebase data files. -->
		<echo level="info" message="copying data files"/>
		<copy todir="${classes.dir}">
			<fileset dir="${src.dir}">
				<patternset refid="codebase.data.pats"/>
			</fileset>
			<fileset dir="${src5.dir}">
				<patternset refid="codebase.data.pats"/>
			</fileset>
			<fileset dir="${xslsrc.dir}">
				<include name="*.xsl"/>
			</fileset>
		</copy>
		<!-- Compile JUnit test cases. -->
		<echo level="info" message="compiling junit test cases"/>
		<javac srcdir="${junitsrc.dir}"
				destdir="${junitclasses.dir}"
				source="1.5"
				target="1.5"
                                includeantruntime="false"
                                encoding="ISO-8859-1"
				deprecation="off"
				debug="on">
			<classpath refid="tools.classpath"/>
		</javac>
		<!-- Compile tools. -->
		<echo level="info" message="compiling tools"/>
		<javac srcdir="${toolsrc.dir}"
				destdir="${classes.dir}"
				source="1.5"
				target="1.5"
                                includeantruntime="false"
                                encoding="ISO-8859-1"
				debug="on"
				deprecation="off"
				excludes="${pkg.base}/tools/patcomp/">
			<classpath refid="tools.classpath"/>
		</javac>
		<!-- Compile Ant task. -->
		<echo level="info" message="compiling ant task"/>
		<javac srcdir="${anttasksrc.dir}"
			destdir="${classes.dir}"
			source="1.5"
			target="1.5"
                        includeantruntime="false"
			encoding="ISO-8859-1"
			deprecation="off"
			debug="on">
			<classpath>
                            <path refid="tools.classpath"/>
                            <pathelement location="${ant.core.lib}"/>
                        </classpath>
		</javac>
	</target>

	<!-- Validate findbugs.xml and messagesXXX.xml files. -->
	<target name="validate">
		<xmlvalidate lenient="false" failonerror="yes">
			<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
			<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
			<fileset dir="${etc.dir}" includes="*.xml" excludes="checkstyle.xml"/>
		</xmlvalidate>
	</target>

	<target name="validatesamplexmloutput" depends="runanttask">
		<schemavalidate failonerror="yes" noNamespaceFile="${etc.dir}/bugcollection.xsd">
			<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
			<fileset dir="${sampleoutput.dir}" includes="*.xml"/>
		</schemavalidate>
	</target>

	<target name="validatesamplehtmloutput" depends="applystylesheets">
		<xmlvalidate failonerror="no">
{'fraction_non_alphanumeric': 0.2048287922378293, 'fraction_numerical': 0.011959158346025836, 'mean_word_length': 3.615464722728456, 'pattern_counts': {'":': 0, '<': 339, '<?xml version=': 0, '>': 339, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 26}, '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': '762968', 'n_tokens_mistral': 6435, 'n_tokens_neox': 5814, 'n_words': 1037}