Add missing .h files to .gn files that have a .cc file next to it in the gn file already.
I downloaded https://docs.google.com/spreadsheets/d/15az3FMl-jAS0mx4E9XVSBVHVpmEzo-9EAGY0ywe7bZs/edit#gid=0
as a csv file, and removed the header line and all columns except the filename.
Then i ran this script to create this CL:
import os, re, subprocess
edits = {}
for filename in open('/Users/thakis/Downloads/files.txt'):
filename = filename.strip()
if not filename.endswith('.h'):
continue
basename = os.path.basename(filename)
cc = r'\b' + os.path.splitext(basename)[0] + r'\.(cc|cpp|mm)\b'
p = subprocess.Popen(['git', 'grep', '-En', cc, '--', '*.gn', '*.gni'],
stdout = subprocess.PIPE)
out, _ = p.communicate()
if p.returncode != 0 or not out:
continue
for gnline in out.splitlines():
gnfile, linenr, contents = gnline.split(':')
linenr = int(linenr)
new = re.sub(cc, basename, contents)
print gnfile, linenr, new
edits.setdefault(gnfile, {})[linenr] = new
for gnfile in edits:
lines = open(gnfile).read().splitlines()
for l in reversed(edits[gnfile].keys()):
lines.insert(l, edits[gnfile][l])
open(gnfile, 'w').write('\n'.join(lines))
(It has off-by-a-few errors in the insertion code, so I manually cleaned up
the output a little bit. Since it was only needed in two files, I didn't
debug the script.)
I then removed the editing part of the script and made it just do `if out: print filename` at the end of the
first loop, and used this Apps Script to updated the spreadsheet:
var covered = [ /* filenames printed by script */ ];
function thakisAutoScript() {
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getActiveSheet();
var dataRange = sheet.getRange("A2:E898");
var data = dataRange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var file = row[0];
if (covered.indexOf(file) == -1)
continue;
row[1] = '.h';
row[2] = 'FALSE';
row[3] = 'thakis';
row[4] = 'https://codereview.chromium.org/2770693003/';
sheet.getRange(2 + i, 1, 1, 5).setValues([row]);
}
}
No intended behavior change, see "[chromium-dev] Unlisted source files in BUILD.gn"
BUG=none
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win10_chromium_x64_rel_ng;master.tryserver.chromium.win:win_optional_gpu_tests_rel
NOTRY=true
Review-Url: https://codereview.chromium.org/2770693003
Cr-Commit-Position: refs/heads/master@{#459147}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 9ab4837d..eb8f466 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -2125,7 +2125,9 @@
"safe_browsing/incident_reporting/binary_integrity_analyzer.cc",
"safe_browsing/incident_reporting/binary_integrity_analyzer.h",
"safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc",
+ "safe_browsing/incident_reporting/binary_integrity_analyzer_mac.h",
"safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc",
+ "safe_browsing/incident_reporting/binary_integrity_analyzer_win.h",
"safe_browsing/incident_reporting/binary_integrity_incident.cc",
"safe_browsing/incident_reporting/binary_integrity_incident.h",
"safe_browsing/incident_reporting/blacklist_load_analyzer.cc",
@@ -2597,6 +2599,7 @@
"android/chrome_backup_agent.cc",
"android/chrome_backup_agent.h",
"android/chrome_backup_watcher.cc",
+ "android/chrome_backup_watcher.h",
"android/chrome_context_util.cc",
"android/chrome_context_util.h",
"android/chrome_feature_list.cc",
@@ -2691,6 +2694,7 @@
"android/devtools_server.cc",
"android/devtools_server.h",
"android/document/document_web_contents_delegate.cc",
+ "android/document/document_web_contents_delegate.h",
"android/dom_distiller/distiller_ui_handle_android.cc",
"android/dom_distiller/distiller_ui_handle_android.h",
"android/download/android_download_manager_duplicate_infobar_delegate.cc",