Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: tools/grit/grit/format/resource_map.py

Issue 2727483004: grit: In generated _map.cc files, use relative includes. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« 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/grit/grit/format/resource_map.py
diff --git a/tools/grit/grit/format/resource_map.py b/tools/grit/grit/format/resource_map.py
index aca302b79f04fe8f6a0a1f48645003dbbdfa5c8e..f1e3132bb5b3a31f8651bf232eb4098856220eec 100755
--- a/tools/grit/grit/format/resource_map.py
+++ b/tools/grit/grit/format/resource_map.py
@@ -66,15 +66,17 @@ extern const size_t %(map_name)sSize;
''' % { 'map_name': GetMapName(root) }
-def _FormatSourceHeader(root):
+def _FormatSourceHeader(root, output_dir):
'''Create the header of the C++ source file for the resource mapping.'''
rc_header_file = None
map_header_file = None
for output in root.GetOutputFiles():
if 'rc_header' == output.GetType():
- rc_header_file = output.GetFilename()
+ rc_header_file = util.MakeRelativePath(output_dir,
+ output.GetOutputFilename())
elif 'resource_map_header' == output.GetType():
- map_header_file = output.GetFilename()
+ map_header_file = util.MakeRelativePath(output_dir,
+ output.GetOutputFilename())
scottmg 2017/03/03 19:29:57 The change from GetFilename to GetOutputFilename w
Nico 2017/03/03 19:35:08 Yes, it's intentional. If the grd file looks like
if not rc_header_file or not map_header_file:
raise Exception('resource_map_source output type requires '
'resource_map_header and rc_header outputs')
@@ -108,7 +110,7 @@ const size_t %(map_name)sSize = arraysize(%(map_name)s);
def _FormatSource(get_key, root, lang, output_dir):
from grit.format import rc_header
from grit.node import include, structure, message
- yield _FormatSourceHeader(root)
+ yield _FormatSourceHeader(root, output_dir)
tids = rc_header.GetIds(root)
seen = set()
active_descendants = [item for item in root.ActiveDescendants()]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698