Index: tools_webrtc/android/build_aar.py |
diff --git a/tools_webrtc/android/build_aar.py b/tools_webrtc/android/build_aar.py |
index 54272e979e446c25de831aa36f24624ed335976f..3fdd4dd1c97b34cfd03835c32d14164a6755f28e 100755 |
--- a/tools_webrtc/android/build_aar.py |
+++ b/tools_webrtc/android/build_aar.py |
@@ -46,6 +46,8 @@ TARGETS = [ |
def _ParseArgs(): |
parser = argparse.ArgumentParser(description='libwebrtc.aar generator.') |
+ parser.add_argument('--build-dir', |
+ help='Build dir. By default will create and use temporary dir.') |
parser.add_argument('--output', default='libwebrtc.aar', |
help='Output file of the script.') |
parser.add_argument('--arch', default=DEFAULT_ARCHS, nargs='*', |
@@ -162,7 +164,10 @@ def main(): |
args = _ParseArgs() |
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO) |
- tmp_dir = tempfile.mkdtemp() |
+ if not args.build_dir: |
+ tmp_dir = tempfile.mkdtemp() |
+ else: |
+ tmp_dir = args.build_dir |
sakal
2017/08/31 08:42:07
nit: I would to call this build_dir because it is
kjellander_webrtc
2017/08/31 08:48:11
+1 to that.
korniltsev
2017/08/31 09:49:46
Done.
|
for arch in args.arch: |
Build(tmp_dir, arch, args.use_goma, args.extra_gn_args) |
@@ -173,7 +178,8 @@ def main(): |
for arch in args.arch: |
Collect(aar_file, tmp_dir, arch) |
- shutil.rmtree(tmp_dir, True) |
+ if not args.build_dir: |
+ shutil.rmtree(tmp_dir, True) |
if __name__ == '__main__': |