зеркало из https://github.com/microsoft/cocos2d-x.git
added detection of android tools path
This commit is contained in:
Родитель
a0fbe9e737
Коммит
06de5d7991
34
setup.py
34
setup.py
|
@ -536,9 +536,43 @@ class SetEnvVar(object):
|
|||
print(" ->Command ant not found\n")
|
||||
return ret
|
||||
|
||||
def _get_android_path(self):
|
||||
print(" ->Find command android in system...")
|
||||
ret = None
|
||||
if not self._isWindows():
|
||||
import commands
|
||||
state, result = commands.getstatusoutput("which android")
|
||||
if state == 0:
|
||||
ret = os.path.dirname(result)
|
||||
|
||||
if ret is not None:
|
||||
print(" ->Path \"%s\" was found\n" % ret)
|
||||
else:
|
||||
print(" ->Command android not found\n")
|
||||
return ret
|
||||
|
||||
def _get_ndkbuild_path(self):
|
||||
print(" ->Find command ndk-build in system...")
|
||||
ret = None
|
||||
if not self._isWindows():
|
||||
import commands
|
||||
state, result = commands.getstatusoutput("which ndk-build")
|
||||
if state == 0:
|
||||
ret = os.path.dirname(result)
|
||||
|
||||
if ret is not None:
|
||||
print(" ->Path \"%s\" was found\n" % ret)
|
||||
else:
|
||||
print(" ->Command ndk-build not found\n")
|
||||
return ret
|
||||
|
||||
def _find_value_from_sys(self, var_name):
|
||||
if var_name == ANT_ROOT:
|
||||
return self._get_ant_path()
|
||||
elif var_name == NDK_ROOT:
|
||||
return os.path.abspath(os.path.join(self._get_ndkbuild_path(),os.pardir))
|
||||
elif var_name == ANDROID_SDK_ROOT:
|
||||
return os.path.abspath(os.path.join(self._get_android_path(),os.pardir))
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче