<?xml version="1.0" encoding="UTF-8"?>
<project name="play-native" default="help">
    <property environment="env" />
    <condition property="ndkbuildopt" value="-j${env.NUMBER_OF_PROCESSORS}" else="-j4">
        <isset property="env.NUMBER_OF_PROCESSORS" />
    </condition>
    <condition property="ndkbuildopt" value="${env.NDKBUILDOPT}">
        <isset property="env.NDKBUILDOPT" />
    </condition>
    <target name="-pre-build">
        <exec executable="${ndk.dir}/ndk-build.cmd" failonerror="true" osfamily="windows">
            <arg line="${ndkbuildopt}"/>
        </exec>
        <exec executable="${ndk.dir}/ndk-build" failonerror="true" osfamily="unix">
            <arg line="${ndkbuildopt}"/>
        </exec>
    </target>
    <target name="clean" depends="android_rules.clean">
        <exec executable="${ndk.dir}/ndk-build.cmd" failonerror="true" osfamily="windows">
            <arg value="clean"/>
        </exec>
        <exec executable="${ndk.dir}/ndk-build" failonerror="true" osfamily="unix">
            <arg value="clean"/>
        </exec>
    </target>
</project>

<?xml version="1.0" encoding="UTF-8"?>
<project name="play-native" default="help">
    <property environment="env" />
	<condition property="ndk.debug" value="${env.NDK_DEBUG}" else="1">
		<isset property="env.NDK_DEBUG" />
	</condition>
    <condition property="ndkbuildopt" value="-j${env.NUMBER_OF_PROCESSORS}" else="-j4">
        <isset property="env.NUMBER_OF_PROCESSORS" />
    </condition>
    <condition property="ndkbuildopt" value="${env.NDKBUILDOPT}">
        <isset property="env.NDKBUILDOPT" />
    </condition>
    <target name="-pre-build">
        <exec executable="${ndk.dir}/ndk-build.cmd" failonerror="true" osfamily="windows">
			<env key="NDK_DEBUG" value="${ndk.debug}"/>
            <arg line="${ndkbuildopt}"/>
        </exec>
        <exec executable="${ndk.dir}/ndk-build" failonerror="true" osfamily="unix">
			<env key="NDK_DEBUG" value="${ndk.debug}"/>
            <arg line="${ndkbuildopt}"/>
        </exec>
    </target>
    <target name="clean" depends="android_rules.clean">
        <exec executable="${ndk.dir}/ndk-build.cmd" failonerror="true" osfamily="windows">
			<env key="NDK_DEBUG" value="${ndk.debug}"/>
            <arg value="clean"/>
        </exec>
        <exec executable="${ndk.dir}/ndk-build" failonerror="true" osfamily="unix">
			<env key="NDK_DEBUG" value="${ndk.debug}"/>
            <arg value="clean"/>
        </exec>
    </target>
</project>

Support an NDK_DEBUG flag in build
Support an NDK_DEBUG flag in build

This can be configured using 1 of 2 methods:

Add the value to the local.properties file
ndk.debug=0 or ndk.debug=1

Exporting the environment variable from commandline or by adding it to
the global environment variables
export NDK_DEBUG=0 or export NDK_DEBUG=0
