1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Set up SDK and NDK env vars from python

No need to make the buildserver do it
This commit is contained in:
Daniel Martí 2014-07-01 21:03:50 +02:00
parent e8284225c9
commit 70d77a1cce
3 changed files with 14 additions and 14 deletions

View File

@ -8,12 +8,6 @@ execute "add-android-ndk-path" do
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"

View File

@ -23,12 +23,6 @@ execute "add-android-sdk-path" do
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

View File

@ -36,6 +36,7 @@ import metadata
config = None
options = None
env = None
def get_default_config():
@ -76,7 +77,7 @@ def read_config(opts, config_file='config.py'):
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
@ -124,6 +125,15 @@ def read_config(opts, config_file='config.py'):
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)
@ -1594,13 +1604,15 @@ def FDroidPopen(commands, cwd=None, shell=False, output=True):
: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()