Chromium Code Reviews

Unified Diff: tools_webrtc/android/build_aar.py

Issue 3008973002: Add --build_dir arg to build_aar.py (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..61a47f7c84fbad25e13e0d6b706042af77f740bd 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', default='',
sakal 2017/08/31 08:07:49 I don't think it is necessary to specify default h
sakal 2017/08/31 08:09:00 Also, can we use build-dir for consistency wit the
korniltsev 2017/08/31 08:25:59 Done.
korniltsev 2017/08/31 08:25:59 Done.
+ 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 args.build_dir == '':
kjellander_webrtc 2017/08/31 08:03:06 I prefer: if not args.build_dir: args.build_dir
korniltsev 2017/08/31 08:25:59 "if not" is better. Done. But I'd like keep args.b
+ tmp_dir = tempfile.mkdtemp()
+ else:
+ tmp_dir = args.build_dir
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 args.build_dir == '':
+ shutil.rmtree(tmp_dir, True)
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine