Merge "Include command-line arguments in comment." am: f7bf9abb58

Original change: https://android-review.googlesource.com/c/platform/development/+/1327013

Change-Id: I59d02affa699aa402c781fdbc2c58ffc3801c920
This commit is contained in:
Chih-hung Hsieh
2020-06-09 21:35:13 +00:00
committed by Automerger Merge Worker

View File

@@ -59,6 +59,7 @@ import argparse
import os
import os.path
import re
import sys
RENAME_MAP = {
# This map includes all changes to the default rust library module
@@ -71,7 +72,7 @@ RENAME_MAP = {
}
# Header added to all generated Android.bp files.
ANDROID_BP_HEADER = '// This file is generated by cargo2android.py.\n'
ANDROID_BP_HEADER = '// This file is generated by cargo2android.py {args}.\n'
CARGO_OUT = 'cargo.out' # Name of file to keep cargo build -v output.
@@ -882,7 +883,7 @@ class Runner(object):
if name not in self.bp_files:
self.bp_files.add(name)
with open(name, 'w') as outf:
outf.write(ANDROID_BP_HEADER)
outf.write(ANDROID_BP_HEADER.format(args=' '.join(sys.argv[1:])))
def claim_module_name(self, prefix, owner, counter):
"""Return prefix if not owned yet, otherwise, prefix+str(counter)."""