I have created a project based off an official Cocos2dx sample. In the script, it tries to read the local properties in using the following:
_LOCALPROPERTIES_FILE=$(dirname "$0")"/local.properties"
if [ -f "$_LOCALPROPERTIES_FILE" ]
then
[ -r "$_LOCALPROPERTIES_FILE" ] || die "Fatal Error: $_LOCALPROPERTIES_FILE exists but is unreadable"
# strip out entries with a "." because Bash cannot process variables with a "."
_PROPERTIES=`sed '/\./d' "$_LOCALPROPERTIES_FILE"`
for line in "$_PROPERTIES"; do
declare "$line";
echo "$line";
done
fi
It then tries to get the NDK_ROOT:
if [ -z "${NDK_ROOT+aaa}" ];then
echo "NDK_ROOT not defined. Please define NDK_ROOT in your environment or in local.properties"
exit 1
fi
If I define the NDK root in my local.properties like the following:
NDK_ROOT=/Users/myuser/Documents/android-ndk-r9d
It fails to recognize the property, although I do see this line echoed in the console. Why is it that this script is failing to read the local.properties in to variables? Is this an error in the script or with how I have defined my property? I suspect that the script is incorrect. I am aware that I could define environmental variables, but I really would like to keep these variables in my local.properties and not muddy up peoples bash profiles.