<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="mmseg4j" default="dist">

	<property file="build.properties" />
	<property name="project.name" value="${ant.project.name}" />

	<property name="src.java.dir" value="src" />
	<property name="src.test.dir" value="test" />
	<property name="build.dir" value="build" />
	<property name="build.java.dir" value="build/classes/java" />
	<property name="build.test.dir" value="build/classes/test" />
	<property name="build.classes.dir" value="build/classes" />
	<property name="extlib.dir" value="lib" />
	
	<property name="ivy.jar.dir" value="${basedir}/ivy" />
	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

	<property name="lib.dir" location="lib" />
	
	<!-- 定义类路径 -->
	<path id="compile.class.path">
		<fileset dir="${lib.dir}/compile">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="java.class.path">
		<dirset dir="${build.java}">
			<include name="**" />
		</dirset>
	</path>
	
	<target name="resolve" description="--> retrieve dependencies with ivy" depends="install-ivy">
		<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" />
	</target>

	<target name="download-ivy" unless="skip.download">
		<mkdir dir="${ivy.jar.dir}" />
		<echo message="installing ivy..." />
		<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
	</target>

	<target name="install-ivy" depends="download-ivy" description="--> install ivy">
		<path id="ivy.lib.path">
			<fileset dir="${ivy.jar.dir}" includes="*.jar" />
		</path>
		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
	</target>
	
	<target name="init" depends="resolve">
		<mkdir dir="${build.java.dir}" />
	</target>

	<target name="compile.java" depends="init">
		<javac destdir="${build.java.dir}" 
			debug="true" debuglevel="lines,source"
			encoding="UTF-8" source="1.5" target="1.5">
			<src path="${src.java.dir}" />
			<classpath refid="compile.class.path" />
		</javac>
	</target>

	<target name="compile" depends="compile.java">
	</target>

	<target name="build.java" depends="compile.java">
		<copy todir="${build.java.dir}" preservelastmodified="true">
			<fileset dir="${src.java.dir}">
				<include name="**/*.*" />
				<exclude name="**/*.java" />
			</fileset>
		</copy>
		<copy file="data/chars.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<copy file="data/units.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
	</target>

	<target name="dist" depends="build.java,jar,jar-with-dic,jar.core,jar.core-with-dic,jar.analysis,jar.solr" />

	<target name="jar" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-all-${version}.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
		</jar>
	</target>
	<target name="jar-with-dic" depends="build.java">
		<copy file="data/words.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<jar destfile="${build.dir}/${project.name}-all-${version}-with-dic.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
		</jar>
		<delete file="${build.java.dir}/data/words.dic" />
	</target>
	<target name="jar.core" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-core-${version}.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
			<exclude name="**/analysis/**"/>
			<exclude name="**/solr/**"/>
		</jar>
	</target>
	<target name="jar.core-with-dic" depends="build.java">
		<copy file="data/words.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<jar destfile="${build.dir}/${project.name}-core-${version}-with-dic.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
			<exclude name="**/analysis/**"/>
			<exclude name="**/solr/**"/>
		</jar>
		<delete file="${build.java.dir}/data/words.dic" />
	</target>
	<target name="jar.analysis" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-analysis-${version}.jar" basedir="${build.java.dir}" >
			<include name="**/analysis/**"/>
		</jar>
	</target>
	<target name="jar.solr" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-solr-${version}.jar" basedir="${build.java.dir}" >
			<include name="**/solr/**"/>
		</jar>
	</target>
	<target name="zip" depends="dist">
		<delete file="${build.dir}/${project.name}-${version}.zip"></delete>
		<!--mkdir dir="temp-zip/lib"/-->
		<copy todir="temp-zip/dist" preservelastmodified="true">
			<fileset dir="${build.dir}">
				<include name="${project.name}-*-${version}.jar"/>
				<include name="${project.name}-core-${version}-with-dic.jar"/>
				<exclude name="${project.name}-all-${version}.jar"/>
			</fileset>
		<!--
			<fileset dir="lib">
				<include name="*.jar"/>
			</fileset>
		-->
		</copy>
		
		<copy todir="temp-zip" preservelastmodified="true">
			<fileset dir="${build.dir}">
				<include name="${project.name}-all-${version}.jar"/>
				<include name="${project.name}-all-${version}-with-dic.jar"/>
			</fileset>
			<fileset dir="">
				<include name="*.txt"/>
				<include name="src/**"/>
				<include name="lib/**"/>
				<include name="data/*.dic"/>
				<include name="build.properties"/>
				<include name="build.xml"/>
			</fileset>
		</copy>
		<zip destfile="${build.dir}/${project.name}-${version}.zip" basedir="temp-zip">
		</zip>
		<delete dir="temp-zip"></delete>
	</target>
	<target name="clean">
		<delete includeEmptyDirs="true">
			<fileset dir="${build.classes.dir}">
				<include name="**/*.class" />
			</fileset>
		</delete>
	</target>
	<target name="clean-all">
		<delete includeEmptyDirs="true" failonerror="off">
			<fileset dir="${build.dir}">
				<include name="**/*.*"/>
			</fileset>
			<fileset dir="${build.classes.dir}"></fileset>
		</delete>
	</target>
</project><commit_msg>ivy build zip<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="mmseg4j" default="dist">

	<property file="build.properties" />
	<property name="project.name" value="${ant.project.name}" />

	<property name="src.java.dir" value="src" />
	<property name="src.test.dir" value="test" />
	<property name="build.dir" value="build" />
	<property name="build.java.dir" value="build/classes/java" />
	<property name="build.test.dir" value="build/classes/test" />
	<property name="build.classes.dir" value="build/classes" />
	<property name="extlib.dir" value="lib" />
	
	<property name="ivy.jar.dir" value="${basedir}/ivy" />
	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

	<property name="lib.dir" location="lib" />
	
	<!-- 定义类路径 -->
	<path id="compile.class.path">
		<fileset dir="${lib.dir}/compile">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="java.class.path">
		<dirset dir="${build.java}">
			<include name="**" />
		</dirset>
	</path>
	
	<target name="resolve" description="--> retrieve dependencies with ivy" depends="install-ivy">
		<ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-[revision].[ext]" />
	</target>

	<target name="download-ivy" unless="skip.download">
		<mkdir dir="${ivy.jar.dir}" />
		<echo message="installing ivy..." />
		<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true" />
	</target>

	<target name="install-ivy" depends="download-ivy" description="--> install ivy">
		<path id="ivy.lib.path">
			<fileset dir="${ivy.jar.dir}" includes="*.jar" />
		</path>
		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
	</target>
	
	<target name="init" depends="resolve">
		<mkdir dir="${build.java.dir}" />
	</target>

	<target name="compile.java" depends="init">
		<javac destdir="${build.java.dir}" 
			debug="true" debuglevel="lines,source"
			encoding="UTF-8" source="1.5" target="1.5">
			<src path="${src.java.dir}" />
			<classpath refid="compile.class.path" />
		</javac>
	</target>

	<target name="compile" depends="compile.java">
	</target>

	<target name="build.java" depends="compile.java">
		<copy todir="${build.java.dir}" preservelastmodified="true">
			<fileset dir="${src.java.dir}">
				<include name="**/*.*" />
				<exclude name="**/*.java" />
			</fileset>
		</copy>
		<copy file="data/chars.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<copy file="data/units.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
	</target>

	<target name="dist" depends="build.java,jar,jar-with-dic,jar.core,jar.core-with-dic,jar.analysis,jar.solr" />

	<target name="jar" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-all-${version}.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
		</jar>
	</target>
	<target name="jar-with-dic" depends="build.java">
		<copy file="data/words.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<jar destfile="${build.dir}/${project.name}-all-${version}-with-dic.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
		</jar>
		<delete file="${build.java.dir}/data/words.dic" />
	</target>
	<target name="jar.core" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-core-${version}.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
			<exclude name="**/analysis/**"/>
			<exclude name="**/solr/**"/>
		</jar>
	</target>
	<target name="jar.core-with-dic" depends="build.java">
		<copy file="data/words.dic" todir="${build.java.dir}/data" preservelastmodified="true" />
		<jar destfile="${build.dir}/${project.name}-core-${version}-with-dic.jar" basedir="${build.java.dir}" >
			<manifest>
				<attribute name="Main-Class" value="com.chenlb.mmseg4j.example.Complex"/>
			</manifest>
			<exclude name="**/analysis/**"/>
			<exclude name="**/solr/**"/>
		</jar>
		<delete file="${build.java.dir}/data/words.dic" />
	</target>
	<target name="jar.analysis" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-analysis-${version}.jar" basedir="${build.java.dir}" >
			<include name="**/analysis/**"/>
		</jar>
	</target>
	<target name="jar.solr" depends="build.java">
		<jar destfile="${build.dir}/${project.name}-solr-${version}.jar" basedir="${build.java.dir}" >
			<include name="**/solr/**"/>
		</jar>
	</target>
	<target name="zip" depends="dist">
		<delete file="${build.dir}/${project.name}-${version}.zip"></delete>
		<!--mkdir dir="temp-zip/lib"/-->
		<copy todir="temp-zip/dist" preservelastmodified="true">
			<fileset dir="${build.dir}">
				<include name="${project.name}-*-${version}.jar"/>
				<include name="${project.name}-core-${version}-with-dic.jar"/>
				<exclude name="${project.name}-all-${version}.jar"/>
			</fileset>
		<!--
			<fileset dir="lib">
				<include name="*.jar"/>
			</fileset>
		-->
		</copy>
		
		<copy todir="temp-zip" preservelastmodified="true">
			<fileset dir="${build.dir}">
				<include name="${project.name}-all-${version}.jar"/>
				<include name="${project.name}-all-${version}-with-dic.jar"/>
			</fileset>
			<fileset dir="">
				<include name="*.txt"/>
				<include name="src/**"/>
				<!--include name="lib/**"/-->
				<include name="data/*.dic"/>
				<include name="build.properties"/>
				<include name="build.xml"/>
				<include name="ivy.xml"/>
			</fileset>
		</copy>
		<zip destfile="${build.dir}/${project.name}-${version}.zip" basedir="temp-zip">
		</zip>
		<delete dir="temp-zip"></delete>
	</target>
	<target name="clean">
		<delete includeEmptyDirs="true">
			<fileset dir="${build.classes.dir}">
				<include name="**/*.class" />
			</fileset>
		</delete>
	</target>
	<target name="clean-all">
		<delete includeEmptyDirs="true" failonerror="off">
			<fileset dir="${build.dir}">
				<include name="**/*.*"/>
			</fileset>
			<fileset dir="${build.classes.dir}"></fileset>
		</delete>
	</target>
</project>
{'fraction_non_alphanumeric': 0.24642200367794034, 'fraction_numerical': 0.0023986567522187576, 'mean_word_length': 4.329356625479336, 'pattern_counts': {'":': 0, '<': 320, '<?xml version=': 2, '>': 324, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '848391', 'n_tokens_mistral': 4911, 'n_tokens_neox': 4480, 'n_words': 659}