Commit 25f2e1a5 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Handle filenames with dashes in generate_grd.py.

Bug: 1132403
Change-Id: Ibe0f9bd3f481b716702caa92a325533372a0f3ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2469375
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817014}
parent 68e6b656
......@@ -74,7 +74,8 @@ GRD_END_TEMPLATE = ' </includes>\n'\
# Generates an <include .... /> row for the given file.
def _generate_include_row(grd_prefix, filename, pathname):
name_suffix = filename.upper().replace('/', '_').replace('.', '_')
name_suffix = filename.upper().replace('/', '_').replace('.', '_'). \
replace('-', '_')
name = 'IDR_%s_%s' % (grd_prefix.upper(), name_suffix)
extension = os.path.splitext(filename)[1]
type = 'chrome_html' if extension == '.html' or extension == '.js' \
......
......@@ -14,10 +14,12 @@
<includes>
<include name="IDR_TEST_TEST_HTML" file="${root_gen_dir}/preprocessed/test.html" resource_path="test.html" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_TEST_ROLLUP_JS" file="${root_gen_dir}/preprocessed/test.rollup.js" resource_path="test.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_SHARED_ROLLUP_JS" file="${root_gen_dir}/preprocessed/shared.rollup.js" resource_path="shared.rollup.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_ELEMENT_IN_DIR_JS" file="${root_gen_dir}/preprocessed/dir/element_in_dir.js" resource_path="dir/element_in_dir.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_TEST_SVG_SVG" file="${root_gen_dir}/preprocessed/dir/test_svg.svg" resource_path="dir/test_svg.svg" use_base_dir="false" type="BINDATA" />
<include name="IDR_TEST_TEST_UI_JS" file="${root_gen_dir}/preprocessed/test_ui.js" resource_path="test_ui.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_TEST_PROXY_JS" file="${root_gen_dir}/preprocessed/test_proxy.js" resource_path="test_proxy.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_FILE_WITH_DASHES_JS" file="${root_gen_dir}/preprocessed/file-with-dashes.js" resource_path="file-with-dashes.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_ANOTHER_ELEMENT_IN_DIR_JS" file="${root_gen_dir}/preprocessed/dir/another_element_in_dir.js" resource_path="dir/another_element_in_dir.js" use_base_dir="false" type="chrome_html" />
</includes>
</release>
......
......@@ -16,10 +16,12 @@
<include name="IDR_TEST_TEST_HTML_IN_SRC_HTML" file="${root_src_dir}/test_src_dir/test_html_in_src.html" resource_path="test_html_in_src.html" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_TEST_HTML" file="${root_gen_dir}/preprocessed/test.html" resource_path="test.html" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_TEST_ROLLUP_JS" file="${root_gen_dir}/preprocessed/test.rollup.js" resource_path="test.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_SHARED_ROLLUP_JS" file="${root_gen_dir}/preprocessed/shared.rollup.js" resource_path="shared.rollup.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_ELEMENT_IN_DIR_JS" file="${root_gen_dir}/preprocessed/dir/element_in_dir.js" resource_path="dir/element_in_dir.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_TEST_SVG_SVG" file="${root_gen_dir}/preprocessed/dir/test_svg.svg" resource_path="dir/test_svg.svg" use_base_dir="false" type="BINDATA" />
<include name="IDR_TEST_TEST_UI_JS" file="${root_gen_dir}/preprocessed/test_ui.js" resource_path="test_ui.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_TEST_PROXY_JS" file="${root_gen_dir}/preprocessed/test_proxy.js" resource_path="test_proxy.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_FILE_WITH_DASHES_JS" file="${root_gen_dir}/preprocessed/file-with-dashes.js" resource_path="file-with-dashes.js" use_base_dir="false" type="chrome_html" />
<include name="IDR_TEST_DIR_ANOTHER_ELEMENT_IN_DIR_JS" file="${root_gen_dir}/preprocessed/dir/another_element_in_dir.js" resource_path="dir/another_element_in_dir.js" use_base_dir="false" type="chrome_html" />
</includes>
</release>
......
{"files": ["test.html", "test.rollup.js", "dir/element_in_dir.js", "dir/test_svg.svg"], "base_dir": "tools/tests/preprocessed" }
{"files": ["test.html", "test.rollup.js", "shared.rollup.js", "dir/element_in_dir.js", "dir/test_svg.svg"], "base_dir": "tools/tests/preprocessed" }
{"files": ["test_ui.js", "test_proxy.js", "dir/another_element_in_dir.js"], "base_dir": "tools/tests/preprocessed" }
{"files": ["test_ui.js", "test_proxy.js", "file-with-dashes.js", "dir/another_element_in_dir.js"], "base_dir": "tools/tests/preprocessed" }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment