<commit_before><project name="blank" default="emulator">

	<!-- import user specific properties                          -->
	<property file="${basedir}/build.properties" />


	<!-- import global properties                                 -->
	<property file="${polish.home}/global.properties" />

	<!-- Definition of the J2ME Polish task:                      -->
	<taskdef name="j2mepolish" classname="de.enough.polish.ant.PolishTask" classpath="${polish.home}/lib/enough-j2mepolish-build.jar:${polish.home}/lib/jdom.jar:${polish.home}/lib/j2me-lib_1.1.jar:${polish.home}/lib/microewt_0.92.jar:${polish.home}/lib/microEWT-Examples.jar:${wtk.home}/lib/jsr082.jar" />
	
	<!-- Definition of the Test Suite Name:                      -->
	<property name="test.class.name" value="org.dimagi.ExampleTestCase" />

	<target name="init">
		<property name="test" value="false" />

		<!-- incriment build number 
		<propertyfile file="${basedir}/build.properties">
			<entry key="build.number" type="int" operation="+" value="1" pattern="00" />
		</propertyfile>
		<echo message="Build ${build.number}" />
		-->
	</target>

	<target name="j2mepolish" depends="init" description="This is the controller for the J2ME build process.">
		<j2mepolish>
			<info name="${app.name}" 
				version="${app.version}" 
				description="${app.description}" 
				vendorName="${app.vendor}" 
				infoUrl="${app.infoUrl}" 
				jarName="${app.jarName}" 
				jarUrl="${deploy-url}${app.jarName}" copyright="" />
			<!-- selection of supported devices -->
			<deviceRequirements>
				<requirement name="Identifier" value="${device.identifier}" />
			</deviceRequirements>

			<!-- build settings -->
			<build fullscreen="menu" 
				usePolishGui="true" 
				workDir="${dir.work}" 
				destDir="${dir.dist}"
				binaryLibraries="${dir.lib}">
				
				<!-- midlets definition -->
				<midlet class="${app.class}" name="${app.name}" />
				
				<sources>
					<source dir="${dir.src}"/>
					<!--Taking this out for now...-->
					<!--source dir="${dir.test}"/-->
				</sources>
				
				<variables includeAntProperties="true">
					<variable file="configuration/configuration.properties" />
					<variable name="polish.MenuBar.useExtendedMenuBar" value="true" />
				</variables>

				<resources
					dir="${dir.resources}"
					defaultexcludes="yes"
					excludes="readme.txt">
					<localization>
						<locale name="en" />
					</localization>
				</resources>

				<!-- obfuscator settings: do not obfuscate when the test-property is true -->
				<obfuscator name="ProGuard" unless="test">
					<parameter name="optimize" value="true" />
				</obfuscator>

				<!-- log settings: only use debug setting when the test-property is true -->
				<debug if="test" showLogOnError="true" verbose="true" level="error">
					<filter pattern="org.celllife.clforms.*" level="debug" />
				</debug>
				<compiler classpath="${polish.home}/import/fileconnection.jar:${polish.home}/import/j2me-lib_1.1.jar:${polish.home}/import/microewt_0.92.jar:${wtk.home}/lib/jsr082.jar"/>

			</build>

			<!-- execution of emulator(s) -->
			<emulator wait="true" securityDomain="trusted" enableProfiler="true" enableMemoryMonitor="true" enableNetworkMonitor="true" if="debug">
				<!-- this is an example for connecting to a debugger - use the ${polish.debug.port} Ant property
				     for getting to know the port of the debugger. In this example the 
				     "connect-debugger" target is also required.
				-->
				<!---->
				<debugger name="antcall" target="connect-debugger" port="6001" />
				<!---->
			</emulator>

			<emulator wait="true" trace="none" securityDomain="trusted" enableProfiler="false" enableMemoryMonitor="false" enableNetworkMonitor="false" if="test and not debug">
			</emulator>


		</j2mepolish>
	</target>

	<target name="setdeploy" description="Call this target first to set the OTA download-URL, e.g. ant setdeploy j2mepolish">
		<property name="deploy-url" value="http://www.company.com/download/" />
	</target>

	<target name="enableDebug">
		<property name="debug" value="true" />
	</target>


	<target name="enableEmulator">
		<property name="test" value="true" />
		<property name="dir.work" value="build/test" />
	</target>

	<target name="emulator" depends="enableEmulator,j2mepolish" description="invokes the emulator">
	</target>
	
	<property name="tst-dir" location="test/" />
	  <property name="TALK" value="true" />

	  <path id="classpath.base">
	  </path>
	  <path id="classpath.test">
	    <pathelement location="${tst-dir}/lib/junit.jar" />
	    <pathelement location="${tst-dir}" />
	    <path refid="classpath.base" />
	  </path>

	  <target name="compile-test">
	    <javac srcdir="${tst-dir}"
	           verbose="${TALK}"
	           >
	      <classpath refid="classpath.test"/>
	    </javac>
	  </target>
	  <target name="clean-compile-test">
	    <delete verbose="${TALK}">
	      <fileset dir="${tst-dir}" includes="**/*.class" />
	    </delete>
	  </target>

	  <target name="tests" depends="compile-test">
	    <junit failureProperty="test.failure">	
	      <classpath refid="classpath.test" />
	      <formatter type="xml" />
	      <test name="org.dimagi.ExampleTestCase" outfile="junit-test-example"/>
	      <test name="org.dimagi.ExampleTestCaseTwo" outfile="junit-test-example-two"/>	
	    </junit><commit_msg>[r110] [trunk/MobileMRSNoPolish] Ant should now fail if junit does<commit_after><project name="blank" default="emulator">

	<!-- import user specific properties                          -->
	<property file="${basedir}/build.properties" />


	<!-- import global properties                                 -->
	<property file="${polish.home}/global.properties" />

	<!-- Definition of the J2ME Polish task:                      -->
	<taskdef name="j2mepolish" classname="de.enough.polish.ant.PolishTask" classpath="${polish.home}/lib/enough-j2mepolish-build.jar:${polish.home}/lib/jdom.jar:${polish.home}/lib/j2me-lib_1.1.jar:${polish.home}/lib/microewt_0.92.jar:${polish.home}/lib/microEWT-Examples.jar:${wtk.home}/lib/jsr082.jar" />
	
	<!-- Definition of the Test Suite Name:                      -->
	<property name="test.class.name" value="org.dimagi.ExampleTestCase" />

	<target name="init">
		<property name="test" value="false" />

		<!-- incriment build number 
		<propertyfile file="${basedir}/build.properties">
			<entry key="build.number" type="int" operation="+" value="1" pattern="00" />
		</propertyfile>
		<echo message="Build ${build.number}" />
		-->
	</target>

	<target name="j2mepolish" depends="init" description="This is the controller for the J2ME build process.">
		<j2mepolish>
			<info name="${app.name}" 
				version="${app.version}" 
				description="${app.description}" 
				vendorName="${app.vendor}" 
				infoUrl="${app.infoUrl}" 
				jarName="${app.jarName}" 
				jarUrl="${deploy-url}${app.jarName}" copyright="" />
			<!-- selection of supported devices -->
			<deviceRequirements>
				<requirement name="Identifier" value="${device.identifier}" />
			</deviceRequirements>

			<!-- build settings -->
			<build fullscreen="menu" 
				usePolishGui="true" 
				workDir="${dir.work}" 
				destDir="${dir.dist}"
				binaryLibraries="${dir.lib}">
				
				<!-- midlets definition -->
				<midlet class="${app.class}" name="${app.name}" />
				
				<sources>
					<source dir="${dir.src}"/>
					<!--Taking this out for now...-->
					<!--source dir="${dir.test}"/-->
				</sources>
				
				<variables includeAntProperties="true">
					<variable file="configuration/configuration.properties" />
					<variable name="polish.MenuBar.useExtendedMenuBar" value="true" />
				</variables>

				<resources
					dir="${dir.resources}"
					defaultexcludes="yes"
					excludes="readme.txt">
					<localization>
						<locale name="en" />
					</localization>
				</resources>

				<!-- obfuscator settings: do not obfuscate when the test-property is true -->
				<obfuscator name="ProGuard" unless="test">
					<parameter name="optimize" value="true" />
				</obfuscator>

				<!-- log settings: only use debug setting when the test-property is true -->
				<debug if="test" showLogOnError="true" verbose="true" level="error">
					<filter pattern="org.celllife.clforms.*" level="debug" />
				</debug>
				<compiler classpath="${polish.home}/import/fileconnection.jar:${polish.home}/import/j2me-lib_1.1.jar:${polish.home}/import/microewt_0.92.jar:${wtk.home}/lib/jsr082.jar"/>

			</build>

			<!-- execution of emulator(s) -->
			<emulator wait="true" securityDomain="trusted" enableProfiler="true" enableMemoryMonitor="true" enableNetworkMonitor="true" if="debug">
				<!-- this is an example for connecting to a debugger - use the ${polish.debug.port} Ant property
				     for getting to know the port of the debugger. In this example the 
				     "connect-debugger" target is also required.
				-->
				<!---->
				<debugger name="antcall" target="connect-debugger" port="6001" />
				<!---->
			</emulator>

			<emulator wait="true" trace="none" securityDomain="trusted" enableProfiler="false" enableMemoryMonitor="false" enableNetworkMonitor="false" if="test and not debug">
			</emulator>


		</j2mepolish>
	</target>

	<target name="setdeploy" description="Call this target first to set the OTA download-URL, e.g. ant setdeploy j2mepolish">
		<property name="deploy-url" value="http://www.company.com/download/" />
	</target>

	<target name="enableDebug">
		<property name="debug" value="true" />
	</target>


	<target name="enableEmulator">
		<property name="test" value="true" />
		<property name="dir.work" value="build/test" />
	</target>

	<target name="emulator" depends="enableEmulator,j2mepolish" description="invokes the emulator">
	</target>
	
	<property name="tst-dir" location="test/" />
	  <property name="TALK" value="true" />

	  <path id="classpath.base">
	  </path>
	  <path id="classpath.test">
	    <pathelement location="${tst-dir}/lib/junit.jar" />
	    <pathelement location="${tst-dir}" />
	    <path refid="classpath.base" />
	  </path>

	  <target name="compile-test">
	    <javac srcdir="${tst-dir}"
	           verbose="${TALK}"
	           >
	      <classpath refid="classpath.test"/>
	    </javac>
	  </target>
	  <target name="clean-compile-test">
	    <delete verbose="${TALK}">
	      <fileset dir="${tst-dir}" includes="**/*.class" />
	    </delete>
	  </target>

	  <target name="tests" depends="compile-test">
	    <junit failureProperty="test.failure">	
	      <classpath refid="classpath.test" />
	      <formatter type="xml" />
	      <test name="org.dimagi.ExampleTestCase" outfile="junit-test-example"/>
	      <test name="org.dimagi.ExampleTestCaseTwo" outfile="junit-test-example-two"/>	
	    </junit>
	  	<fail message="test failed" if="test.failure" />
{'fraction_non_alphanumeric': 0.18350074404761904, 'fraction_numerical': 0.006603422619047619, 'mean_word_length': 3.327162977867203, 'pattern_counts': {'":': 0, '<': 206, '<?xml version=': 0, '>': 206, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '1906723', 'n_tokens_mistral': 3930, 'n_tokens_neox': 3345, 'n_words': 651}