for n in ['ANDROID_NDK', 'NDK']:
common.env[n] = thisbuild['ndk_path']
+ common.reset_env_path()
+ # Set up the current NDK to the PATH
+ common.add_to_env_path(thisbuild['ndk_path'])
+
# Prepare the source code...
root_dir, srclibpaths = common.prepare_source(vcs, app, thisbuild,
build_dir, srclib_dir,
config = None
options = None
env = None
+orig_path = None
default_config = {
The config is read from config_file, which is in the current directory when
any of the repo management commands are used.
"""
- global config, options, env
+ global config, options, env, orig_path
if config is not None:
return config
# There is no standard, so just set up the most common environment
# variables
env = os.environ
+ orig_path = env['PATH']
for n in ['ANDROID_HOME', 'ANDROID_SDK']:
env[n] = config['sdk_path']
logging.info("Cleaned %s of keysigning configs at %s" % (propfile, path))
+def reset_env_path():
+ global env, orig_path
+ env['PATH'] = orig_path
+
+
+def add_to_env_path(path):
+ global env
+ paths = env['PATH'].split(os.pathsep)
+ if path in paths:
+ return
+ paths += path
+ env['PATH'] = os.pathsep.join(paths)
+
+
def replace_config_vars(cmd):
global env
cmd = cmd.replace('$$SDK$$', config['sdk_path'])