<commit_before><project name="build-module">
	<property name="ti.module.root" location="${basedir}"/>

	<property file="${ti.module.root}/build.properties"/>
	<property name="ti.module.support.dir" location="${titanium.platform}/../module"/>
	
	<!-- the manifest format seems to be compatible w/ the properties format -->
	<property file="${ti.module.root}/manifest" prefix="manifest"/>
	
	<taskdef classname="org.appcelerator.titanium.ant.StringTask" name="ti.string" classpath="${ti.module.support.dir}/android/ant-tasks.jar"/>
	
	<property name="src" location="${ti.module.root}/src"/>
	<property name="build" location="${ti.module.root}/build"/>
	<property name="gen" location="${build}/.apt_generated"/>
	<property name="classes" location="${build}/classes"/>
	<property name="dist" location="${ti.module.root}/dist"/>
	<property name="lib" location="${ti.module.root}/lib"/>
	<property name="jni" location="${ti.module.root}/jni"/>
	<property name="libs" location="${ti.module.root}/libs"/>

	<path id="project.classpath">
		<fileset dir="${lib}">
			<include name="**/*.jar"/>
		</fileset>
		<fileset dir="${titanium.platform}">
			<include name="*.jar"/>
			<include name="modules/titanium-*.jar"/>
		</fileset>
		<pathelement path="${android.platform}/android.jar"/>
		<pathelement path="${google.apis}/libs/maps.jar"/>
	</path>

	<target name="init">
		<mkdir dir="${classes}"/>
		<mkdir dir="${gen}"/>
		<mkdir dir="${dist}"/>
	</target>
	
	<target name="process.annotations" depends="init"
		description="Processes @Kroll.proxy and @Kroll.module annotations">
		<javac 
			srcdir="${src}" 
			destdir="${classes}"
			debug="true"
			includeantruntime="false">
				<compilerarg value="-processor"/>
				<compilerarg value="org.appcelerator.kroll.annotations.generator.KrollBindingGenerator"/>
				<compilerarg value="-s"/>
				<compilerarg value="${gen}"/>
				<compilerarg line="-Akroll.jsonFile=${ant.project.name}.json"/>
				<compilerarg line="-Akroll.jsonPackage=org.appcelerator.titanium.bindings"/>
				<classpath refid="project.classpath"/>
		</javac>
	</target>

	<target name="compile" depends="process.annotations,ndk.build"
		description="Compile this module's source code">
		<javac 
			destdir="${classes}"
			debug="true"
			includeantruntime="false">
			<src path="${src}" />
			<src path="${gen}" />
			<include name="**/*.java" />
			
			<classpath refid="project.classpath" />
		</javac>
		<copy todir="${classes}">
			<fileset dir="${gen}" includes="**/*.json"/>
		</copy>
	</target>

	<macrodef name="check.ndk">
		<sequential>
			<fail message="The module.ndkbuild property is set, but the android.ndk property is not set to an existing Android NDK installation (check your module's build.properties)">
				<condition>
					<not>
						<available file="${android.ndk}" type="dir"/>
					</not>
				</condition>
			</fail>
		</sequential>
	</macrodef>

	<target name="ndk.build" if="module.ndkbuild">
		<check.ndk/>
		<property name="ndk.build" location="${android.ndk}/ndk-build"/>
		<exec executable="${ndk.build}" dir="${jni}">
			<arg line="V=1"/>
		</exec>
	</target>

	<target name="dist" depends="compile" description="Generate a distributable module JAR">
		<ti.string property="module.id" string="${manifest.moduleid}" tolowercase="true"/>
		<property name="module.jar" location="${dist}/${ant.project.name}.jar"/>
		<jar destfile="${module.jar}">
			<fileset dir="${classes}"/>
			<fileset dir="${ti.module.root}" includes="assets/**" excludes="assets/README"/>
		</jar>
		<property name="zip.prefix" value="modules/android/${module.id}/${manifest.version}"/>
		
		<zip destfile="${dist}/${module.id}-android-${manifest.version}.zip">
			<zipfileset file="${module.jar}" prefix="${zip.prefix}"/>
			<zipfileset file="manifest" prefix="${zip.prefix}"/>
			<zipfileset file="timodule.xml" prefix="${zip.prefix}"/>
			<zipfileset dir="${lib}" includes="**/*.jar" prefix="${zip.prefix}/lib"/>
			<zipfileset dir="${libs}" includes="**/*.so" prefix="${zip.prefix}/libs"/>
		</zip>
		<delete dir="${lib.expand.dir}" includeemptydirs="true" failonerror="false" deleteonexit="true"/>
	</target>

	<target name="clean" description="Cleans classes and dist files" depends="ndk.clean">
		<delete dir="${classes}"/>
		<delete dir="${dist}"/>
		<delete includeemptydirs="true" failonerror="false">
			<fileset dir="${gen}" includes="**/*"/>
		</delete>
	</target>

	<target name="ndk.clean" if="module.ndkbuild">
		<check.ndk/>
		<property name="ndk.build" location="${android.ndk}/ndk-build"/>
		<exec executable="${ndk.build}" dir="${jni}">
			<arg line="V=1"/>
			<arg line="clean"/>
		</exec>
	</target>
	
	<property name="titanium.py" location="${titanium.platform}/../titanium.py"/>
	<property name="titanium.bat" location="${titanium.platform}/../titanium.bat"/>

	<macrodef name="titanium">
		<attribute name="command"/><commit_msg>[#3014 state:fixed-in-qa] Only include the libs folder in module zip if it exists<commit_after><project name="build-module">
	<property name="ti.module.root" location="${basedir}"/>

	<property file="${ti.module.root}/build.properties"/>
	<property name="ti.module.support.dir" location="${titanium.platform}/../module"/>
	
	<!-- the manifest format seems to be compatible w/ the properties format -->
	<property file="${ti.module.root}/manifest" prefix="manifest"/>
	
	<taskdef classname="org.appcelerator.titanium.ant.StringTask" name="ti.string" classpath="${ti.module.support.dir}/android/ant-tasks.jar"/>
	
	<property name="src" location="${ti.module.root}/src"/>
	<property name="build" location="${ti.module.root}/build"/>
	<property name="gen" location="${build}/.apt_generated"/>
	<property name="classes" location="${build}/classes"/>
	<property name="dist" location="${ti.module.root}/dist"/>
	<property name="lib" location="${ti.module.root}/lib"/>
	<property name="jni" location="${ti.module.root}/jni"/>
	<property name="libs" location="${ti.module.root}/libs"/>

	<path id="project.classpath">
		<fileset dir="${lib}">
			<include name="**/*.jar"/>
		</fileset>
		<fileset dir="${titanium.platform}">
			<include name="*.jar"/>
			<include name="modules/titanium-*.jar"/>
		</fileset>
		<pathelement path="${android.platform}/android.jar"/>
		<pathelement path="${google.apis}/libs/maps.jar"/>
	</path>

	<target name="init">
		<mkdir dir="${classes}"/>
		<mkdir dir="${gen}"/>
		<mkdir dir="${dist}"/>
	</target>
	
	<target name="process.annotations" depends="init"
		description="Processes @Kroll.proxy and @Kroll.module annotations">
		<javac 
			srcdir="${src}" 
			destdir="${classes}"
			debug="true"
			includeantruntime="false">
				<compilerarg value="-processor"/>
				<compilerarg value="org.appcelerator.kroll.annotations.generator.KrollBindingGenerator"/>
				<compilerarg value="-s"/>
				<compilerarg value="${gen}"/>
				<compilerarg line="-Akroll.jsonFile=${ant.project.name}.json"/>
				<compilerarg line="-Akroll.jsonPackage=org.appcelerator.titanium.bindings"/>
				<classpath refid="project.classpath"/>
		</javac>
	</target>

	<target name="compile" depends="process.annotations,ndk.build"
		description="Compile this module's source code">
		<javac 
			destdir="${classes}"
			debug="true"
			includeantruntime="false">
			<src path="${src}" />
			<src path="${gen}" />
			<include name="**/*.java" />
			
			<classpath refid="project.classpath" />
		</javac>
		<copy todir="${classes}">
			<fileset dir="${gen}" includes="**/*.json"/>
		</copy>
	</target>

	<macrodef name="check.ndk">
		<sequential>
			<fail message="The module.ndkbuild property is set, but the android.ndk property is not set to an existing Android NDK installation (check your module's build.properties)">
				<condition>
					<not>
						<available file="${android.ndk}" type="dir"/>
					</not>
				</condition>
			</fail>
		</sequential>
	</macrodef>

	<target name="ndk.build" if="module.ndkbuild">
		<check.ndk/>
		<property name="ndk.build" location="${android.ndk}/ndk-build"/>
		<exec executable="${ndk.build}" dir="${jni}">
			<arg line="V=1"/>
		</exec>
	</target>

	<target name="libs.check">
		<condition property="libs.exists">
			<available file="${libs}" type="dir"/>
		</condition>
	</target>

	<target name="zip.libs" depends="libs.check" if="libs.exists">
		<zip destfile="${dist}/${module.id}-android-${manifest.version}.zip" update="true">
			<zipfileset dir="${libs}" includes="**/*.so" prefix="${zip.prefix}/libs"/>
		</zip>
	</target>

	<target name="dist" depends="compile" description="Generate a distributable module JAR">
		<ti.string property="module.id" string="${manifest.moduleid}" tolowercase="true"/>
		<property name="module.jar" location="${dist}/${ant.project.name}.jar"/>
		<jar destfile="${module.jar}">
			<fileset dir="${classes}"/>
			<fileset dir="${ti.module.root}" includes="assets/**" excludes="assets/README"/>
		</jar>
		<property name="zip.prefix" value="modules/android/${module.id}/${manifest.version}"/>
		
		<zip destfile="${dist}/${module.id}-android-${manifest.version}.zip">
			<zipfileset file="${module.jar}" prefix="${zip.prefix}"/>
			<zipfileset file="manifest" prefix="${zip.prefix}"/>
			<zipfileset file="timodule.xml" prefix="${zip.prefix}"/>
			<zipfileset dir="${lib}" includes="**/*.jar" prefix="${zip.prefix}/lib"/>
		</zip>
		<antcall target="zip.libs"/>
		<delete dir="${lib.expand.dir}" includeemptydirs="true" failonerror="false" deleteonexit="true"/>
	</target>

	<target name="clean" description="Cleans classes and dist files" depends="ndk.clean">
		<delete dir="${classes}"/>
		<delete dir="${dist}"/>
		<delete includeemptydirs="true" failonerror="false">
			<fileset dir="${gen}" includes="**/*"/>
		</delete>
	</target>

	<target name="ndk.clean" if="module.ndkbuild">
		<check.ndk/>
		<property name="ndk.build" location="${android.ndk}/ndk-build"/>
		<exec executable="${ndk.build}" dir="${jni}">
			<arg line="V=1"/>
			<arg line="clean"/>
		</exec>
	</target>
	
	<property name="titanium.py" location="${titanium.platform}/../titanium.py"/>
	<property name="titanium.bat" location="${titanium.platform}/../titanium.bat"/>

	<macrodef name="titanium">
		<attribute name="command"/>
{'fraction_non_alphanumeric': 0.22303293236048116, 'fraction_numerical': 0.0007887990534411359, 'mean_word_length': 4.863005780346821, 'pattern_counts': {'":': 0, '<': 227, '<?xml version=': 0, '>': 227, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7465321', 'n_tokens_mistral': 3675, 'n_tokens_neox': 3270, 'n_words': 603}