diff --git a/java/hiddenapi.go b/java/hiddenapi.go index e9693c68e..f901434a0 100644 --- a/java/hiddenapi.go +++ b/java/hiddenapi.go @@ -219,7 +219,6 @@ func buildRuleToGenerateIndex(ctx android.ModuleContext, desc string, classesJar BuiltTool("merge_csv"). Flag("--zip_input"). Flag("--key_field signature"). - FlagWithArg("--header=", "signature,file,startline,startcol,endline,endcol,properties"). FlagWithOutput("--output=", indexCSV). Inputs(classesJars) rule.Build(desc, desc) diff --git a/scripts/hiddenapi/merge_csv.py b/scripts/hiddenapi/merge_csv.py index b047aab71..a65326c51 100755 --- a/scripts/hiddenapi/merge_csv.py +++ b/scripts/hiddenapi/merge_csv.py @@ -55,14 +55,15 @@ else: if entry.endswith('.uau'): csv_readers.append(dict_reader(io.TextIOWrapper(zip.open(entry, 'r')))) -headers = set() if args.header: fieldnames = args.header.split(',') else: + headers = {} # Build union of all columns from source files: for reader in csv_readers: - headers = headers.union(reader.fieldnames) - fieldnames = sorted(headers) + for fieldname in reader.fieldnames: + headers[fieldname] = "" + fieldnames = list(headers.keys()) # By default chain the csv readers together so that the resulting output is # the concatenation of the rows from each of them: