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

build.py corrected

This commit is contained in:
lb@lb520 2017-06-20 15:56:15 +02:00
parent 230286786f
commit 0672a6f1ec

View File

@ -657,7 +657,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
raise BuildException("Expected to find buildozer-compatible spec at {0}" raise BuildException("Expected to find buildozer-compatible spec at {0}"
.format(spec)) .format(spec))
defaults = {'orientation': 'landscape', 'icon': '', defaults = {'orientation': 'landscape', 'icon': '',
'permissions': '', 'android.api': "19" } 'permissions': '', 'android.api': "19"}
bconfig = ConfigParser(defaults, allow_no_value=True) bconfig = ConfigParser(defaults, allow_no_value=True)
bconfig.read(spec) bconfig.read(spec)
@ -666,25 +666,25 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
loc_ndk = common.env['ANDROID_NDK'] loc_ndk = common.env['ANDROID_NDK']
loc_sdk = common.env['ANDROID_SDK'] loc_sdk = common.env['ANDROID_SDK']
if loc_ndk == '$ANDROID_NDK': if loc_ndk == '$ANDROID_NDK':
loc_ndk = loc_sdk+'/ndk-bundle' loc_ndk = loc_sdk + '/ndk-bundle'
bc_ndk = None bc_ndk = None
bc_sdk = None bc_sdk = None
try: try:
bc_ndk = bconfig.get('app','android.sdk_path') bc_ndk = bconfig.get('app', 'android.sdk_path')
except: except Exception:
pass pass
try: try:
bc_sdk = bconfig.get('app','android.ndk_path') bc_sdk = bconfig.get('app', 'android.ndk_path')
except: except Exception:
pass pass
if bc_sdk is None: if bc_sdk is None:
bconfig.set('app','android.sdk_path',loc_sdk) bconfig.set('app', 'android.sdk_path', loc_sdk)
if bc_ndk is None: if bc_ndk is None:
bconfig.set('app','android.ndk_path',loc_ndk) bconfig.set('app', 'android.ndk_path', loc_ndk)
fspec = open(spec,'w') fspec = open(spec, 'w')
bconfig.write(fspec) bconfig.write(fspec)
fspec.close() fspec.close()
@ -693,21 +693,21 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
p = None p = None
# execute buildozer # execute buildozer
cmd = ['buildozer','android','release'] cmd = ['buildozer', 'android', 'release']
try: try:
p = FDroidPopen(cmd, cwd=root_dir) p = FDroidPopen(cmd, cwd=root_dir)
except: except Exception:
pass pass
# buidozer not installed ? clone repo and run # buidozer not installed ? clone repo and run
if (p is None or p.returncode!=0): if (p is None or p.returncode != 0):
cmd = ['git','clone','https://github.com/kivy/buildozer.git'] cmd = ['git', 'clone', 'https://github.com/kivy/buildozer.git']
p = subprocess.Popen(cmd, cwd=root_dir, shell=False) p = subprocess.Popen(cmd, cwd=root_dir, shell=False)
p.wait() p.wait()
if p.returncode != 0: if p.returncode != 0:
raise BuildException("Distribute build failed") raise BuildException("Distribute build failed")
cmd = ['python','buildozer/buildozer/scripts/client.py','android','release'] cmd = ['python', 'buildozer/buildozer/scripts/client.py', 'android', 'release']
p = FDroidPopen(cmd, cwd=root_dir) p = FDroidPopen(cmd, cwd=root_dir)
# expected to fail. # expected to fail.