not_if "grep PATH-NDK /home/#{user}/.bsenv"
end
-execute "add-android-ndk-var" do
- user user
- command "echo \"export ANDROID_NDK=#{ndk_loc}\" >> /home/#{user}/.bsenv"
- not_if "grep ANDROID_NDK /home/#{user}/.bsenv"
-end
-
script "setup-android-ndk" do
timeout 14400
interpreter "bash"
not_if "grep PATH-SDK /home/#{user}/.bsenv"
end
-execute "add-android-home" do
- user user
- command "echo \"export ANDROID_HOME=#{sdk_loc}\" >> /home/#{user}/.bsenv"
- not_if "grep ANDROID_HOME /home/#{user}/.bsenv"
-end
-
script "add_build_tools" do
interpreter "bash"
user user
config = None
options = None
+env = None
def get_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
+ global config, options, env
if config is not None:
return config
if not test_build_tools_exists(config):
sys.exit(3)
+ env = os.environ
+
+ # There is no standard, so just set up the most common environment
+ # variables
+ for n in ['ANDROID_HOME', 'ANDROID_SDK', 'SDK']:
+ env[n] = config['sdk_path']
+ for n in ['ANDROID_NDK', 'NDK']:
+ env[n] = config['ndk_path']
+
for k in ["keystorepass", "keypass"]:
if k in config:
write_password_file(k)
:returns: A PopenResult.
"""
+ global env
+
if cwd:
cwd = os.path.normpath(cwd)
logging.debug("Directory: %s" % cwd)
logging.debug("> %s" % ' '.join(commands))
result = PopenResult()
- p = subprocess.Popen(commands, cwd=cwd, shell=shell,
+ p = subprocess.Popen(commands, cwd=cwd, shell=shell, env=env,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout_queue = Queue.Queue()