<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="build.android.app" >
    
    <fail unless="builder.imported" 
          message="Import build.xml in order to use ${ant.file.build.android.app} build file." />

    <!-- 
    ############################################ 
    ##                 properties             ## 
    ############################################
    -->
    
    <property name="global.configs.dir" location="${root.dir}/src/config" />
    <property name="local.configs.dir"  location="${project.dir}/config" />
    
    <property name="res.dir"            location="${project.dir}/res" />    
    <property name="common.bin.dir"     location="${project.dir}/bin" />
    
    <property name="file.build-properties" value="${res.dir}/values/build-properties.xml" />
    
    <property name="enable.config" value="false" />
    <property name="default.config.debug" value="dev" />
    <property name="default.config.release" value="production" />
    
    <property name="embed.build.properties" value="false" />
    
    <property name="instr.metadata.file.name" value="coverage.em" />

    <!-- 
    ############################################
    ##                  imports               ##
    ############################################
    -->

    <import file="common.xml" />
    <import file="android.quality.xml" as="android.quality" />
    <import file="android.sdk.xml" />

    <!--
    ############################################
    ##     build-config.xml    generation     ##
    ############################################
    -->
    <target name="embed-build-properties" 
            description="Generates build-vars.xml file to be consumed as resource by android application."
            if="${embed.build.properties}" >

    <!-- DO NOT CHANGE FORMATTING/INDENTATION IN THIS TARGET! THIS MAY BREAK THE BUILD! -->
            <echo file="${file.build-properties}" append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<!-- THIS IS AUTO GENERATED FILE, DO NOT MODIFY IT -->
<resources>]]>
            </echo>

            <echo file="${file.build-properties}" append="true">
    <![CDATA[
    <string name="build_mode">${build.mode}</string>
</resources>]]>
            </echo>
    </target>
    
    <target name="clean-build-properties" >
        <delete file="${file.build-properties}" failonerror="no" />
    </target>

    <!--
    ############################################
    ##          android target overrides      ##
    ############################################
    -->
    <target name="-set-defaults" >
    </target>

    <target name="-set-defaults-debug" depends="-set-defaults" >
        <property name="build.mode" value="debug" />
    </target>
    
    <target name="-set-defaults-instrument" depends="-set-defaults" >
      <property name="build.mode" value="instrument" />
    </target>
        
    <target name="-set-defaults-release" depends="-set-defaults" >
        <property name="build.mode" value="release" />
    </target>

    <target name="-pre-build" >
        <property name="bin.dir" location="${common.bin.dir}/${build.mode}" />
        <property name="instr.metadata.file" location="${bin.dir}/coverage.em" />
        <property name="jar.file" location="${bin.dir}/${project.name}.jar" />
        <property name="jar.dir"  location="${bin.dir}/jar" />
    </target>

    <target name="-pre-build-debug" depends="-set-defaults-debug, -pre-build" />

    <target name="-pre-build-instrument" depends="-set-defaults-instrument, -pre-build" />

    <target name="-pre-build-release" depends="-set-defaults-release, -pre-build" />

    <target name="-post-build" >

        <!--Set filename as '${ant.project.name}-${config}.apk', 
            omit config if it is not enabled. -->

        <var name="file.name" value="${project.alias}" />

        <if condition="${enable.configs}" >
          <then>
            <var name="file.name" value="${file.name}-${config}" />
          </then>
        </if>

        <!--var name="file.name" value="${file.name}-${build.mode}" /-->
        <property name="out.file.name" value="${file.name}.apk" />
        <property name="out.file" location="${bin.dir}/${out.file.name}" />
        
        <property name="drop.properties.file.name" value="${file.name}.properties" />
        <property name="drop.properties.file" 
                  location="${drop.dir}/${build.mode}/${drop.properties.file.name}" />
                            
        <property name="drop.coverage.file.name" value="${file.name}.em" />
    </target>
    
    <target name="-post-build-debug" depends="-post-build" >
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
    
    <target name="-post-build-instrument" depends="-post-build" >
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
        
    <target name="-post-build-release" depends="-post-build">
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
    
    <!-- creates empty jar file for dependency management purposes -->
    <target name="make-jar" >
         <delete dir="${jar.dir}" />
         <mkdir dir="${jar.dir}" />
         <jar destfile="${jar.file}" 
              includes="**/*.class" basedir="${jar.dir}" >        

              <manifest>
                  <!-- Who is building this jar? -->
                  <attribute name="Built-By" value="${user.name}"/>
        
                  <!-- Information about the program itself -->
                  <attribute name="Implementation-Vendor" value="${vendor}"/>
                  <attribute name="Implementation-Title" value="${project.name}"/>
                  <attribute name="Implementation-Version" value="${version.name}"/>
                  <attribute name="Description" value="Empty stub jar for dependcy management." />
              </manifest>
        </jar>    
        <delete dir="${jar.dir}" />
    </target>
            
    <target name="drop" depends="make-jar" >
            <mkdir dir="${drop.dir}" />
            <copy file="${jar.file}" todir="${drop.dir}/${build.mode}" />
            <copy file="${out.file}" todir="${drop.dir}/${build.mode}" />          
    </target>
    
    <target name="drop.instrument" depends="drop" >        
        <fail  message="Sorry, instrumnetation is not yet supported!" unless="instrumentation.ignore"/>
        <!--copy file="${instr.metadata.file}" 
              tofile="${drop.dir}/${build.mode}/${drop.coverage.file.name}" /-->
    </target>
    
        
    <target name="debug" 
            depends="-pre-build-debug, prepare-project, 
                  embed-build-properties, update-manifest, 
                    android.debug, -post-build-debug, drop" />
        
    <target name="instrument" 
            depends="-pre-build-instrument, prepare-project, 
                     embed-build-properties, update-manifest,
                   android.instrument, -post-build-instrument, drop.instrument" />
            
    <target name="release" 
            depends="-pre-build-release, prepare-project, 
                   embed-build-properties, update-manifest,
                         android.release, -post-build-release, drop" />
        <commit_msg>Removed make-jar for .apk projects<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="build.android.app" >
    
    <fail unless="builder.imported" 
          message="Import build.xml in order to use ${ant.file.build.android.app} build file." />

    <!-- 
    ############################################ 
    ##                 properties             ## 
    ############################################
    -->
    
    <property name="global.configs.dir" location="${root.dir}/src/config" />
    <property name="local.configs.dir"  location="${project.dir}/config" />
    
    <property name="res.dir"            location="${project.dir}/res" />    
    <property name="common.bin.dir"     location="${project.dir}/bin" />
    
    <property name="file.build-properties" value="${res.dir}/values/build-properties.xml" />
    
    <property name="enable.config" value="false" />
    <property name="default.config.debug" value="dev" />
    <property name="default.config.release" value="production" />
    
    <property name="embed.build.properties" value="false" />
    
    <property name="instr.metadata.file.name" value="coverage.em" />

    <!-- 
    ############################################
    ##                  imports               ##
    ############################################
    -->

    <import file="common.xml" />
    <import file="android.quality.xml" as="android.quality" />
    <import file="android.sdk.xml" />

    <!--
    ############################################
    ##     build-config.xml    generation     ##
    ############################################
    -->
    <target name="embed-build-properties" 
            description="Generates build-vars.xml file to be consumed as resource by android application."
            if="${embed.build.properties}" >

    <!-- DO NOT CHANGE FORMATTING/INDENTATION IN THIS TARGET! THIS MAY BREAK THE BUILD! -->
            <echo file="${file.build-properties}" append="false"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<!-- THIS IS AUTO GENERATED FILE, DO NOT MODIFY IT -->
<resources>]]>
            </echo>

            <echo file="${file.build-properties}" append="true">
    <![CDATA[
    <string name="build_mode">${build.mode}</string>
</resources>]]>
            </echo>
    </target>
    
    <target name="clean-build-properties" >
        <delete file="${file.build-properties}" failonerror="no" />
    </target>

    <!--
    ############################################
    ##          android target overrides      ##
    ############################################
    -->
    <target name="-set-defaults" >
    </target>

    <target name="-set-defaults-debug" depends="-set-defaults" >
        <property name="build.mode" value="debug" />
    </target>
    
    <target name="-set-defaults-instrument" depends="-set-defaults" >
      <property name="build.mode" value="instrument" />
    </target>
        
    <target name="-set-defaults-release" depends="-set-defaults" >
        <property name="build.mode" value="release" />
    </target>

    <target name="-pre-build" >
        <property name="bin.dir" location="${common.bin.dir}/${build.mode}" />
        <property name="instr.metadata.file" location="${bin.dir}/coverage.em" />
        <property name="jar.file" location="${bin.dir}/${project.name}.jar" />
        <property name="jar.dir"  location="${bin.dir}/jar" />
    </target>

    <target name="-pre-build-debug" depends="-set-defaults-debug, -pre-build" />

    <target name="-pre-build-instrument" depends="-set-defaults-instrument, -pre-build" />

    <target name="-pre-build-release" depends="-set-defaults-release, -pre-build" />

    <target name="-post-build" >

        <!--Set filename as '${ant.project.name}-${config}.apk', 
            omit config if it is not enabled. -->

        <var name="file.name" value="${project.alias}" />

        <if condition="${enable.configs}" >
          <then>
            <var name="file.name" value="${file.name}-${config}" />
          </then>
        </if>

        <!--var name="file.name" value="${file.name}-${build.mode}" /-->
        <property name="out.file.name" value="${file.name}.apk" />
        <property name="out.file" location="${bin.dir}/${out.file.name}" />
        
        <property name="drop.properties.file.name" value="${file.name}.properties" />
        <property name="drop.properties.file" 
                  location="${drop.dir}/${build.mode}/${drop.properties.file.name}" />
                            
        <property name="drop.coverage.file.name" value="${file.name}.em" />
    </target>
    
    <target name="-post-build-debug" depends="-post-build" >
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
    
    <target name="-post-build-instrument" depends="-post-build" >
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
        
    <target name="-post-build-release" depends="-post-build">
        <copy overwrite="yes" file="${out.final.file}" tofile="${out.file}" />
    </target>
    
    <target name="drop" >
            <mkdir dir="${drop.dir}" />
            <copy file="${out.file}" todir="${drop.dir}/${build.mode}" />          
    </target>
    
    <target name="drop.instrument" depends="drop" >        
        <fail  message="Sorry, instrumnetation is not yet supported!" unless="instrumentation.ignore"/>
        <!--copy file="${instr.metadata.file}" 
              tofile="${drop.dir}/${build.mode}/${drop.coverage.file.name}" /-->
    </target>
    
        
    <target name="debug" 
            depends="-pre-build-debug, prepare-project, 
                  embed-build-properties, update-manifest, 
                    android.debug, -post-build-debug, drop" />
        
    <target name="instrument" 
            depends="-pre-build-instrument, prepare-project, 
                     embed-build-properties, update-manifest,
                   android.instrument, -post-build-instrument, drop.instrument" />
            
    <target name="release" 
            depends="-pre-build-release, prepare-project, 
                   embed-build-properties, update-manifest,
                         android.release, -post-build-release, drop" />
        
{'fraction_non_alphanumeric': 0.22824808935920046, 'fraction_numerical': 0.0008818342151675485, 'mean_word_length': 2.3355392156862744, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 4, '>': 207, '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': '6503293', 'n_tokens_mistral': 3835, 'n_tokens_neox': 3675, 'n_words': 632}