<commit_before><project name="build.all" 
         xmlns:ivy="antlib:org.apache.ivy.ant" 
         default="build" >
  
  <property name="project.name" value="builder" />
  <import file="builder/builder.properties.xml" />
  <import file="builder/ant-tasks.xml" />

  <!-- defaults --> 
  <property name="test.targets" value="android-8,android-10,android-11,android-12,android-13,android-14,android-15" />
  <property name="test.target" value="android-8" />
  <property name="tester.filter" value="s+m+l" />
  
  
  <!-- build mode -->	
	
  <target name="pre-build-mode">
  </target>
	
  <target name="debug" depends="pre-build-mode" unless="build.mode">
    <property name="build.mode" value="debug" />    
  </target>

  <target name="instrument" depends="pre-build-mode" unless="build.mode" >
    <property name="build.mode" value="instrument" />
    <property name="tester.coverage" value="true" />
  </target>

  <target name="release" depends="pre-build-mode" unless="build.mode" >
    <property name="build.mode" value="release" />
  </target>
  
  <target name="post-build-mode" >
  	 <property name="bin.dir" location="${drop.dir}/${build.mode}" />
  	 <property name="package.dir" location="${bin.dir}/packaged" />
  </target>
	
  <target name="set-build-mode" depends="pre-build-mode, debug, post-build-mode" />
	
  <!-- build -->
	  
  <target name="buildlist" > 
    <ivy:buildlist reference="all-projects">
      <fileset dir="src" includes="**/build.xml" />
    </ivy:buildlist>
    <propertyregex property="formatted-projects" 
                   input="${toString:all-projects}" 
                   regexp="[;:]" 
                   replace="${line.separator}" 
                   global="true" />
    <echo>${formatted-projects}</echo>
  </target>

  <target name="build" depends="set-build-mode, buildlist" >
  	<mkdir dir="${drop.dir}"/>
    <subant target="${build.mode}" buildpathref="all-projects" />
  </target>
	
  <target name="subclean" depends="buildlist" >
    <subant target="clean" buildpathref="all-projects" />       
  </target>

  <target name="clean" depends="buildlist, subclean">    
    <delete dir="${drop.dir}" />
  </target>
	
  <!-- package & deploy -->
  
  <target name="package" depends="set-build-mode" >
    
  	<delete dir="${package.dir}" />
    <mkdir dir="${package.dir}" />
    
  	<copy file="src/host-testrunner-ant-lib/ant/rbm-testrunner.xml" todir="${package.dir}"/>
  		
    <zip destfile="${package.dir}/rbm.testrunner.device.jar" duplicate="preserve" >
      <archives>
        <zips>
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.device.jar" />
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.common.jar" />
        </zips>
      </archives>
    </zip>
    <zip destfile="${package.dir}/rbm.testrunner.host.jar" duplicate="preserve" >
      <archives>
        <zips>
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.host.jar" />
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.common.jar" />
        </zips>
      </archives>
    </zip>
    <zip destfile="${package.dir}/rbm.testrunner.host.ant.jar" duplicate="preserve" >
	  <archives>
        <zips>
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.host.ant.jar" />
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.host.jar" />
          <fileset dir="${bin.dir}" includes="com.robomorphine.testrunner.common.jar" />
        </zips>
      </archives>
    </zip>
  	<zip destfile="${package.dir}/rbm-testrunner-host-ant.zip" duplicate="fail" >
  		<fileset dir="${package.dir}" >
  			<include name="rbm.host.testrunner.ant.jar"/>
  			<include name="rbm-testrunner.xml"/>
  		</fileset>
  	</zip>
  	<zip destfile="${package.dir}/rbm-testrunner.zip" duplicate="fail" >
        <fileset dir="${package.dir}" >
        	<include name="rbm.testrunner.device.jar"/>
            <include name="rbm.testrunner.host.ant.jar"/>
        	<include name="rbm.testrunner.host.jar"/>
            <include name="rbm-testrunner.xml"/>
        </fileset>
    </zip>
  </target>
	
  <target name="deploy" depends="set-build-mode, package" >
  	<copy file="${package.dir}/rbm.testrunner.host.ant.jar" todir="libs" />
  	<copy file="${package.dir}/rbm-testrunner.xml" todir="builder" />
  </target>
	
  <!-- test -->
  <target name="kill-all" >
    <rbm-stop-all-emulators />	
  </target>
	
  <target name="test" depends="set-build-mode" >
    <ant antfile="${builder.dir}/test.manager.xml" 
         target="create-test-report" inheritall="true" inheritrefs="true">
      <property name="build.mode" value="${build.mode}" />
    </ant>
  </target>

  <target name="test-on-emulator" depends="set-build-mode">

    <ant antfile="${builder.dir}/test.manager.emulator.xml" 
         target="test-on-emulator" inheritall="true" inheritrefs="true">
       <property name="build.mode"  value="${build.mode}" />
       <property name="test.target" value="${test.target}" />
    </ant>
  </target>

  <target name="test-on-all-emulators" depends="set-build-mode" >
  
      <ant antfile="${builder.dir}/test.manager.emulator.xml" 
               target="test-on-all-emulators" inheritall="true" inheritrefs="true" ><commit_msg>Removed package & deploy targets.<commit_after><project name="build.all" 
         xmlns:ivy="antlib:org.apache.ivy.ant" 
         default="build" >
  
  <property name="project.name" value="builder" />
  <import file="builder/builder.properties.xml" />
  <import file="builder/ant-tasks.xml" />

  <!-- defaults --> 
  <property name="test.targets" value="android-8,android-10,android-11,android-12,android-13,android-14,android-15" />
  <property name="test.target" value="android-8" />
  <property name="tester.filter" value="s+m+l" />
  
  
  <!-- build mode -->	
	
  <target name="pre-build-mode">
  </target>
	
  <target name="debug" depends="pre-build-mode" unless="build.mode">
    <property name="build.mode" value="debug" />    
  </target>

  <target name="instrument" depends="pre-build-mode" unless="build.mode" >
    <property name="build.mode" value="instrument" />
    <property name="tester.coverage" value="true" />
  </target>

  <target name="release" depends="pre-build-mode" unless="build.mode" >
    <property name="build.mode" value="release" />
  </target>
  
  <target name="post-build-mode" >
  	 <property name="bin.dir" location="${drop.dir}/${build.mode}" />
  	 <property name="package.dir" location="${bin.dir}/packaged" />
  </target>
	
  <target name="set-build-mode" depends="pre-build-mode, debug, post-build-mode" />
	
  <!-- build -->
	  
  <target name="buildlist" > 
    <ivy:buildlist reference="all-projects">
      <fileset dir="src" includes="**/build.xml" />
    </ivy:buildlist>
    <propertyregex property="formatted-projects" 
                   input="${toString:all-projects}" 
                   regexp="[;:]" 
                   replace="${line.separator}" 
                   global="true" />
    <echo>${formatted-projects}</echo>
  </target>

  <target name="build" depends="set-build-mode, buildlist" >
  	<mkdir dir="${drop.dir}"/>
    <subant target="${build.mode}" buildpathref="all-projects" />
  </target>
	
  <target name="subclean" depends="buildlist" >
    <subant target="clean" buildpathref="all-projects" />       
  </target>

  <target name="clean" depends="buildlist, subclean">    
    <delete dir="${drop.dir}" />
  </target>
	
  <!-- test -->
  <target name="kill-all" >
    <rbm-stop-all-emulators />	
  </target>
	
  <target name="test" depends="set-build-mode" >
    <ant antfile="${builder.dir}/test.manager.xml" 
         target="create-test-report" inheritall="true" inheritrefs="true">
      <property name="build.mode" value="${build.mode}" />
    </ant>
  </target>

  <target name="test-on-emulator" depends="set-build-mode">

    <ant antfile="${builder.dir}/test.manager.emulator.xml" 
         target="test-on-emulator" inheritall="true" inheritrefs="true">
       <property name="build.mode"  value="${build.mode}" />
       <property name="test.target" value="${test.target}" />
    </ant>
  </target>

  <target name="test-on-all-emulators" depends="set-build-mode" >
  
      <ant antfile="${builder.dir}/test.manager.emulator.xml" 
               target="test-on-all-emulators" inheritall="true" inheritrefs="true" >
{'fraction_non_alphanumeric': 0.1986865671641791, 'fraction_numerical': 0.003343283582089552, 'mean_word_length': 3.1099116781158, 'pattern_counts': {'":': 0, '<': 176, '<?xml version=': 0, '>': 176, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, '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': '1934634', 'n_tokens_mistral': 2836, 'n_tokens_neox': 2715, 'n_words': 398}