16 """@file build.py Android example build script.
18 Copies an NDK sample to the current directory and builds it.
20 Run 'build.py --help' for options.
27 sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
29 import buildutil.android
30 import buildutil.common
35 parser = argparse.ArgumentParser()
36 buildutil.android.BuildEnvironment.add_arguments(parser)
37 args = parser.parse_args()
38 env = buildutil.android.BuildEnvironment(args)
44 samplename =
'native-plasma'
45 samplepath = os.path.join(env.ndk_home,
'samples', samplename)
46 shutil.rmtree(samplename,
True)
47 shutil.copytree(samplepath, samplename)
50 (rc, errmsg) = env.build_all()
53 env.make_archive([
'apks'],
'output.zip', exclude=[
'objs',
'objs-debug'])
55 print >> sys.stderr, errmsg
59 if __name__ ==
'__main__':