<project name="android-natives" basedir="." default="postcompile"> <property environment="env" /> <!-- the suffix ndk-build executable --> <property name="ndkSuffix" value="" /> <target name="clean" depends="check-for-ndk" if="has-ndk-build"> <exec executable="${env.NDK_HOME}/ndk-build${ndkSuffix}" failonerror="true"> <arg value="clean"/> </exec> </target> <target name="precompile" depends="check-for-ndk"> </target> <target name="compile-natives" depends="precompile" if="has-ndk-build"> <echo>ndk_home: ${env.NDK_HOME}</echo> <exec executable="${env.NDK_HOME}/ndk-build${ndkSuffix}" failonerror="true"/> </target> <target name="postcompile" depends="compile-natives"> </target> <target name="check-for-ndk"> <condition property="ndk-build-found"> <available file="ndk-build${ndkSuffix}" filepath="${env.NDK_HOME}"/> </condition> <condition property="has-ndk-build"> <equals arg1="${ndk-build-found}" arg2="true"/> </condition> </target> </project>