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:
Paul Sokolovsky 2012-03-07 08:46:56 +02:00
parent 22f9895927
commit d26f2d1ffa
2 changed files with 21 additions and 8 deletions

View file

@ -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()