mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
Allow 'update' and 'buildjni' to accept list of subdir paths to run tools within.
This is useful for multi-component projects (main app + libraries in separate dirs). Older adhoc values (update=no, buildjni=yes) for both options are retained, except that to ignore jni/ directory, buildjni=no instead of buildjni=manual should be used now. Also, if --verbose is given, print message about runnibg ndk-build - native libraries can be quite big and process long, so this is useful to keep user in loop. To achieve this, had to global'ize options.
This commit is contained in:
parent
22f9895927
commit
d26f2d1ffa
2 changed files with 21 additions and 8 deletions
16
build.py
16
build.py
|
@ -149,10 +149,18 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
|
|||
tarball.close()
|
||||
|
||||
# Build native stuff if required...
|
||||
if thisbuild.get('buildjni', 'no') == 'yes':
|
||||
if thisbuild.get('buildjni') not in (None, 'no'):
|
||||
jni_components = thisbuild.get('buildjni')
|
||||
if jni_components == 'yes':
|
||||
jni_components = ['']
|
||||
else:
|
||||
jni_components = jni_components.split(';')
|
||||
ndkbuild = os.path.join(ndk_path, "ndk-build")
|
||||
p = subprocess.Popen([ndkbuild], cwd=root_dir,
|
||||
stdout=subprocess.PIPE)
|
||||
for d in jni_components:
|
||||
if options.verbose:
|
||||
print "Running ndk-build in " + root_dir + '/' + d
|
||||
p = subprocess.Popen([ndkbuild], cwd=root_dir + '/' + d,
|
||||
stdout=subprocess.PIPE)
|
||||
output = p.communicate()[0]
|
||||
if p.returncode != 0:
|
||||
print output
|
||||
|
@ -327,9 +335,11 @@ def parse_commandline():
|
|||
|
||||
return options, args
|
||||
|
||||
options = None
|
||||
|
||||
def main():
|
||||
|
||||
global options
|
||||
# Read configuration...
|
||||
execfile('config.py', globals())
|
||||
options, args = parse_commandline()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue