Merge pull request #5670 from minggo/develop

ask to set ANT_ROOT, and add more redeable information
This commit is contained in:
minggo 2014-03-11 12:00:46 +08:00
commit 4f621e71ca
1 changed files with 7 additions and 22 deletions

View File

@ -277,26 +277,6 @@ class SetEnvVar(object):
else: else:
return False return False
def _is_ant_exists(self):
try:
os.environ[ANT_ROOT]
return True
except Exception:
pass
ant_found = False
commands = ['ant', '-version']
child = subprocess.Popen(commands, stdout=subprocess.PIPE)
for line in child.stdout:
if 'Ant' in line:
ant_found = True
break
child.wait()
return ant_found
def _is_ant_root_valid(self, ant_root): def _is_ant_root_valid(self, ant_root):
ant_path = '' ant_path = ''
@ -391,7 +371,7 @@ class SetEnvVar(object):
print "" print ""
print '-> Looking for ANT_ROOT envrironment variable...', print '-> Looking for ANT_ROOT envrironment variable...',
ant_root_added = False ant_root_added = False
ant_found = self._is_ant_exists() ant_found = self._find_environment_variable(ANT_ROOT)
if not ant_root and not ant_found: if not ant_root and not ant_found:
print 'NOT FOUND' print 'NOT FOUND'
@ -429,6 +409,11 @@ class SetEnvVar(object):
else: else:
print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target
if self._isWindows():
print '\nPlease restart the terminal to make added system variables take effect'
else:
print '\nPlease execute command: "source %s" to make added system variables take effect' % target
if __name__ == '__main__': if __name__ == '__main__':
parser = OptionParser() parser = OptionParser()
parser.add_option('-n', '--ndkroot', dest='ndk_root', help='directory of ndk root') parser.add_option('-n', '--ndkroot', dest='ndk_root', help='directory of ndk root')