<?xml version="1.0" encoding="UTF-8"?>

<project name="JuceDemo" default="debug">
  <loadproperties srcFile="local.properties"/>
  <loadproperties srcFile="project.properties"/>
  <target name="clean" depends="android_rules.clean">
    <delete dir="libs"/>
    <delete dir="obj"/>
    <exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
      <arg value="clean"/>
    </exec>
  </target>
  <target name="-pre-build">
    <condition property="makefileConfig" value="Debug" else="Release">
      <equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
    </condition>
    <condition property="ndkDebugValue" value="NDK_DEBUG=1" else="NDK_DEBUG=0">
      <equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
    </condition>
    <condition property="app_abis" value="armeabi x86" else="armeabi armeabi-v7a x86">
      <equals arg1="${ant.project.invoked-targets}" arg2="debug"/>
    </condition>
    <exec executable="${ndk.dir}/ndk-build" dir="${basedir}" failonerror="true">
      <arg value="--jobs=4"/>
      <arg value="CONFIG=${makefileConfig}"/>
      <arg value="${ndkDebugValue}"/>
      <arg value="APP_ABI=${app_abis}"/>
    </exec>
    <delete file="${out.final.file}"/>
    <delete file="${out.packaged.file}"/>
  </target>
  <import file="${sdk.dir}/tools/ant/build.xml"/>
</project>
