From a34134678d6b2b048da627ef3105af312404a808 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Fri, 12 Dec 2008 22:17:35 +0000 Subject: Have GRIT generate files into a common directory. Joi has convinced me that GRIT should generate platform specific resources files. This is easier than parsing .rc files because GRIT effectively has an .rc parser. To that end, we need to convert some existing .rc files to .grd files (e.g., net_resources.rc and webkit_resources.rc). Rather than having every grd file output to a different place and -I all the different paths, have GRIT generate all files into one directory. This directory is grit_derived_sources. Review URL: http://codereview.chromium.org/13776 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6940 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/SConscript | 17 ++-- chrome/app/locales/ar.vcproj | 4 +- chrome/app/locales/bg.vcproj | 4 +- chrome/app/locales/bn.vcproj | 4 +- chrome/app/locales/ca.vcproj | 4 +- chrome/app/locales/cs.vcproj | 4 +- chrome/app/locales/da.vcproj | 4 +- chrome/app/locales/de.vcproj | 4 +- chrome/app/locales/el.vcproj | 4 +- chrome/app/locales/en-GB.vcproj | 4 +- chrome/app/locales/en-US.vcproj | 4 +- chrome/app/locales/es-419.vcproj | 4 +- chrome/app/locales/es.vcproj | 4 +- chrome/app/locales/et.vcproj | 4 +- chrome/app/locales/fi.vcproj | 4 +- chrome/app/locales/fil.vcproj | 4 +- chrome/app/locales/fr.vcproj | 4 +- chrome/app/locales/gu.vcproj | 4 +- chrome/app/locales/he.vcproj | 4 +- chrome/app/locales/hi.vcproj | 4 +- chrome/app/locales/hr.vcproj | 4 +- chrome/app/locales/hu.vcproj | 4 +- chrome/app/locales/id.vcproj | 4 +- chrome/app/locales/it.vcproj | 4 +- chrome/app/locales/ja.vcproj | 4 +- chrome/app/locales/kn.vcproj | 4 +- chrome/app/locales/ko.vcproj | 4 +- chrome/app/locales/lt.vcproj | 4 +- chrome/app/locales/lv.vcproj | 4 +- chrome/app/locales/ml.vcproj | 4 +- chrome/app/locales/mr.vcproj | 4 +- chrome/app/locales/nb.vcproj | 4 +- chrome/app/locales/nl.vcproj | 4 +- chrome/app/locales/or.vcproj | 4 +- chrome/app/locales/pl.vcproj | 4 +- chrome/app/locales/pt-BR.vcproj | 4 +- chrome/app/locales/pt-PT.vcproj | 4 +- chrome/app/locales/ro.vcproj | 4 +- chrome/app/locales/ru.vcproj | 4 +- chrome/app/locales/sk.vcproj | 4 +- chrome/app/locales/sl.vcproj | 4 +- chrome/app/locales/sr.vcproj | 4 +- chrome/app/locales/sv.vcproj | 4 +- chrome/app/locales/ta.vcproj | 4 +- chrome/app/locales/te.vcproj | 4 +- chrome/app/locales/th.vcproj | 4 +- chrome/app/locales/tr.vcproj | 4 +- chrome/app/locales/uk.vcproj | 4 +- chrome/app/locales/vi.vcproj | 4 +- chrome/app/locales/zh-CN.vcproj | 4 +- chrome/app/locales/zh-TW.vcproj | 4 +- chrome/app/resources/SConscript | 12 ++- chrome/browser/browser.scons | 9 +- chrome/browser/debugger/debugger.scons | 2 +- chrome/browser/views/SConscript | 2 +- chrome/common/common.scons | 2 +- chrome/renderer/renderer.scons | 2 +- chrome/tools/build/win/language_dll.vsprops | 2 +- .../build/win/using_generated_strings.vsprops | 2 +- chrome/views/SConscript | 2 +- tools/grit/build/grit_resource_file.bat | 8 +- tools/grit/build/grit_resource_file.rules | 104 ++++++++++----------- webkit/SConscript | 5 +- webkit/build/glue/glue.vsprops | 2 +- webkit/build/localized_strings/SConscript | 5 +- .../localized_strings/localized_strings.vcproj | 2 +- webkit/default_plugin/default_plugin.vsprops | 2 +- webkit/tools/test_shell/SConscript | 2 +- webkit/tools/test_shell/test_shell.vcproj | 2 +- webkit/tools/test_shell/test_shell.vsprops | 2 +- 70 files changed, 199 insertions(+), 187 deletions(-) diff --git a/chrome/SConscript b/chrome/SConscript index 92d8c33..4942449 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -206,18 +206,21 @@ env_grd = env.Clone() env_grd.Tool('scons', toolpath=[env_grd.Dir('$CHROME_SRC_DIR/tools/grit/grit')]) # NOTE: fake target gets replaced with real targets from reading .grd -generated = env_grd.GRIT('app/resources/fake_generated_target', - '$CHROME_SRC_DIR/chrome/app/generated_resources.grd') +generated = env_grd.GRIT( + '$TARGET_ROOT/grit_derived_sources/fake_generated_target', + '$CHROME_SRC_DIR/chrome/app/generated_resources.grd') grit_files.extend(generated) # NOTE: fake target gets replaced with real targets from reading .grd -chromium = env_grd.GRIT('app/resources/fake_chromium_target', - '$CHROME_SRC_DIR/chrome/app/chromium_strings.grd') +chromium = env_grd.GRIT( + '$TARGET_ROOT/grit_derived_sources/fake_chromium_target', + '$CHROME_SRC_DIR/chrome/app/chromium_strings.grd') grit_files.extend(chromium) # NOTE: fake target gets replaced with real targets from reading .grd -google_chrome = env_grd.GRIT('app/resources/fake_google_chrome_target', - '$CHROME_SRC_DIR/chrome/app/google_chrome_strings.grd') +google_chrome = env_grd.GRIT( + '$TARGET_ROOT/grit_derived_sources/fake_google_chrome_target', + '$CHROME_SRC_DIR/chrome/app/google_chrome_strings.grd') grit_files.extend(google_chrome) @@ -351,7 +354,9 @@ env_flat['BUILDERS']['FlatHtml'] = Builder(action='$FLATTEN_HTML_COM', flats = [ 'browser/resources/about_credits.html', 'browser/resources/about_memory.html', + 'browser/resources/about_stats.html', 'browser/resources/about_version.html', + 'browser/resources/history.html', 'browser/resources/incognito_tab.html', 'browser/resources/new_tab.html', 'browser/resources/safe_browsing_malware_block.html', diff --git a/chrome/app/locales/ar.vcproj b/chrome/app/locales/ar.vcproj index eddde15..46e33d4 100644 --- a/chrome/app/locales/ar.vcproj +++ b/chrome/app/locales/ar.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/bg.vcproj b/chrome/app/locales/bg.vcproj index fa92073..91e0265 100644 --- a/chrome/app/locales/bg.vcproj +++ b/chrome/app/locales/bg.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/bn.vcproj b/chrome/app/locales/bn.vcproj index b93b7e0..4828c8d 100644 --- a/chrome/app/locales/bn.vcproj +++ b/chrome/app/locales/bn.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ca.vcproj b/chrome/app/locales/ca.vcproj index f6b6147..b6c59a7 100644 --- a/chrome/app/locales/ca.vcproj +++ b/chrome/app/locales/ca.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/cs.vcproj b/chrome/app/locales/cs.vcproj index bffe409..5d24481 100644 --- a/chrome/app/locales/cs.vcproj +++ b/chrome/app/locales/cs.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/da.vcproj b/chrome/app/locales/da.vcproj index d5f4170..6705516 100644 --- a/chrome/app/locales/da.vcproj +++ b/chrome/app/locales/da.vcproj @@ -140,11 +140,11 @@ diff --git a/chrome/app/locales/el.vcproj b/chrome/app/locales/el.vcproj index a16f8cd..78e6164 100644 --- a/chrome/app/locales/el.vcproj +++ b/chrome/app/locales/el.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/en-GB.vcproj b/chrome/app/locales/en-GB.vcproj index b717b78..ff718a4 100644 --- a/chrome/app/locales/en-GB.vcproj +++ b/chrome/app/locales/en-GB.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/en-US.vcproj b/chrome/app/locales/en-US.vcproj index b297c98..e200b95 100644 --- a/chrome/app/locales/en-US.vcproj +++ b/chrome/app/locales/en-US.vcproj @@ -142,11 +142,11 @@ diff --git a/chrome/app/locales/es.vcproj b/chrome/app/locales/es.vcproj index 1be7ccf..1609cab 100644 --- a/chrome/app/locales/es.vcproj +++ b/chrome/app/locales/es.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/et.vcproj b/chrome/app/locales/et.vcproj index 888cd0a..3284b30 100644 --- a/chrome/app/locales/et.vcproj +++ b/chrome/app/locales/et.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/fi.vcproj b/chrome/app/locales/fi.vcproj index 6a04cc7..756e181 100644 --- a/chrome/app/locales/fi.vcproj +++ b/chrome/app/locales/fi.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/fil.vcproj b/chrome/app/locales/fil.vcproj index b8cb1eb..efa6421 100644 --- a/chrome/app/locales/fil.vcproj +++ b/chrome/app/locales/fil.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/fr.vcproj b/chrome/app/locales/fr.vcproj index 9570d7d..d01ac02 100644 --- a/chrome/app/locales/fr.vcproj +++ b/chrome/app/locales/fr.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/gu.vcproj b/chrome/app/locales/gu.vcproj index eebaf02..94670fd 100644 --- a/chrome/app/locales/gu.vcproj +++ b/chrome/app/locales/gu.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/he.vcproj b/chrome/app/locales/he.vcproj index eaaf1f4..6c761b2 100644 --- a/chrome/app/locales/he.vcproj +++ b/chrome/app/locales/he.vcproj @@ -140,11 +140,11 @@ diff --git a/chrome/app/locales/hr.vcproj b/chrome/app/locales/hr.vcproj index 1f2dc4b..8a95080 100644 --- a/chrome/app/locales/hr.vcproj +++ b/chrome/app/locales/hr.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/hu.vcproj b/chrome/app/locales/hu.vcproj index c9cdc2d..6e93959 100644 --- a/chrome/app/locales/hu.vcproj +++ b/chrome/app/locales/hu.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/id.vcproj b/chrome/app/locales/id.vcproj index 911c9db..62fde9f 100644 --- a/chrome/app/locales/id.vcproj +++ b/chrome/app/locales/id.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/it.vcproj b/chrome/app/locales/it.vcproj index 6d3cd5e..818e37f 100644 --- a/chrome/app/locales/it.vcproj +++ b/chrome/app/locales/it.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ja.vcproj b/chrome/app/locales/ja.vcproj index 4114117..9c1c294 100644 --- a/chrome/app/locales/ja.vcproj +++ b/chrome/app/locales/ja.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/kn.vcproj b/chrome/app/locales/kn.vcproj index 28b6b70..c2b8caf 100644 --- a/chrome/app/locales/kn.vcproj +++ b/chrome/app/locales/kn.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ko.vcproj b/chrome/app/locales/ko.vcproj index 4aedbeb..03094f5 100644 --- a/chrome/app/locales/ko.vcproj +++ b/chrome/app/locales/ko.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/lt.vcproj b/chrome/app/locales/lt.vcproj index 09046ed..9aa39a4 100644 --- a/chrome/app/locales/lt.vcproj +++ b/chrome/app/locales/lt.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/lv.vcproj b/chrome/app/locales/lv.vcproj index 92d1bfd..4fd328d2 100644 --- a/chrome/app/locales/lv.vcproj +++ b/chrome/app/locales/lv.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ml.vcproj b/chrome/app/locales/ml.vcproj index 13e717ad..77caf57 100644 --- a/chrome/app/locales/ml.vcproj +++ b/chrome/app/locales/ml.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/mr.vcproj b/chrome/app/locales/mr.vcproj index 3b2d2b9..97b5312 100644 --- a/chrome/app/locales/mr.vcproj +++ b/chrome/app/locales/mr.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/nb.vcproj b/chrome/app/locales/nb.vcproj index 922a9f2..00c8fe8 100644 --- a/chrome/app/locales/nb.vcproj +++ b/chrome/app/locales/nb.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/nl.vcproj b/chrome/app/locales/nl.vcproj index eded6b7..6038838 100644 --- a/chrome/app/locales/nl.vcproj +++ b/chrome/app/locales/nl.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/or.vcproj b/chrome/app/locales/or.vcproj index bf65a0b..cba063a 100644 --- a/chrome/app/locales/or.vcproj +++ b/chrome/app/locales/or.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/pl.vcproj b/chrome/app/locales/pl.vcproj index e9e32f5..f91e7a9 100644 --- a/chrome/app/locales/pl.vcproj +++ b/chrome/app/locales/pl.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/pt-BR.vcproj b/chrome/app/locales/pt-BR.vcproj index 57b8f6c..fdae5ff 100644 --- a/chrome/app/locales/pt-BR.vcproj +++ b/chrome/app/locales/pt-BR.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/pt-PT.vcproj b/chrome/app/locales/pt-PT.vcproj index 74153bc..2bc7e10 100644 --- a/chrome/app/locales/pt-PT.vcproj +++ b/chrome/app/locales/pt-PT.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ro.vcproj b/chrome/app/locales/ro.vcproj index f1f2b84..0eb6835 100644 --- a/chrome/app/locales/ro.vcproj +++ b/chrome/app/locales/ro.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ru.vcproj b/chrome/app/locales/ru.vcproj index 8e43029..1c73e98 100644 --- a/chrome/app/locales/ru.vcproj +++ b/chrome/app/locales/ru.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/sk.vcproj b/chrome/app/locales/sk.vcproj index b79b8d7..1b3c8f7 100644 --- a/chrome/app/locales/sk.vcproj +++ b/chrome/app/locales/sk.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/sl.vcproj b/chrome/app/locales/sl.vcproj index 976c28d..b5d9d82 100644 --- a/chrome/app/locales/sl.vcproj +++ b/chrome/app/locales/sl.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/sr.vcproj b/chrome/app/locales/sr.vcproj index 40e5131..6eb25bf 100644 --- a/chrome/app/locales/sr.vcproj +++ b/chrome/app/locales/sr.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/sv.vcproj b/chrome/app/locales/sv.vcproj index e5675a0..5871462 100644 --- a/chrome/app/locales/sv.vcproj +++ b/chrome/app/locales/sv.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/ta.vcproj b/chrome/app/locales/ta.vcproj index 670e310..8c5049e 100644 --- a/chrome/app/locales/ta.vcproj +++ b/chrome/app/locales/ta.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/te.vcproj b/chrome/app/locales/te.vcproj index 875b836..a57090d 100644 --- a/chrome/app/locales/te.vcproj +++ b/chrome/app/locales/te.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/th.vcproj b/chrome/app/locales/th.vcproj index 40a7531..f3b2ea5 100644 --- a/chrome/app/locales/th.vcproj +++ b/chrome/app/locales/th.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/tr.vcproj b/chrome/app/locales/tr.vcproj index f5eaee2..0cfe3c3 100644 --- a/chrome/app/locales/tr.vcproj +++ b/chrome/app/locales/tr.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/uk.vcproj b/chrome/app/locales/uk.vcproj index 9413b84..895a34e 100644 --- a/chrome/app/locales/uk.vcproj +++ b/chrome/app/locales/uk.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/vi.vcproj b/chrome/app/locales/vi.vcproj index 3d7b31b..2e4d220 100644 --- a/chrome/app/locales/vi.vcproj +++ b/chrome/app/locales/vi.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/zh-CN.vcproj b/chrome/app/locales/zh-CN.vcproj index 4bf3dda..bac1e33 100644 --- a/chrome/app/locales/zh-CN.vcproj +++ b/chrome/app/locales/zh-CN.vcproj @@ -140,7 +140,7 @@ diff --git a/chrome/app/locales/zh-TW.vcproj b/chrome/app/locales/zh-TW.vcproj index fc0877e..36c6433 100644 --- a/chrome/app/locales/zh-TW.vcproj +++ b/chrome/app/locales/zh-TW.vcproj @@ -140,11 +140,11 @@ diff --git a/chrome/tools/build/win/using_generated_strings.vsprops b/chrome/tools/build/win/using_generated_strings.vsprops index da11cb0..a92594bcd 100644 --- a/chrome/tools/build/win/using_generated_strings.vsprops +++ b/chrome/tools/build/win/using_generated_strings.vsprops @@ -6,6 +6,6 @@ > diff --git a/chrome/views/SConscript b/chrome/views/SConscript index 78138bf..5512c6b 100644 --- a/chrome/views/SConscript +++ b/chrome/views/SConscript @@ -20,7 +20,7 @@ env.Prepend( env.Append( CPPPATH = [ - '$CHROME_DIR/app/resources', + '$TARGET_ROOT/grit_derived_sources', '$ICU38_DIR/public/common', '$ICU38_DIR/public/i18n', '$SKIA_DIR/include', diff --git a/tools/grit/build/grit_resource_file.bat b/tools/grit/build/grit_resource_file.bat index 7853212..9769bef 100644 --- a/tools/grit/build/grit_resource_file.bat +++ b/tools/grit/build/grit_resource_file.bat @@ -7,9 +7,13 @@ setlocal set InFile=%~1 set SolutionDir=%~2 -set InputDir=%~3 +set OutDir=%~3 + +IF NOT EXIST %OutDir% ( +mkdir %OutDir% +) :: Put cygwin in the path call %SolutionDir%\..\third_party\cygwin\setup_env.bat -%SolutionDir%\..\third_party\python_24\python.exe %SolutionDir%\..\tools\grit\grit.py -i %InFile% build -o %InputDir% +%SolutionDir%\..\third_party\python_24\python.exe %SolutionDir%\..\tools\grit\grit.py -i %InFile% build -o %OutDir% diff --git a/tools/grit/build/grit_resource_file.rules b/tools/grit/build/grit_resource_file.rules index d180c35..2f9e7f9 100644 --- a/tools/grit/build/grit_resource_file.rules +++ b/tools/grit/build/grit_resource_file.rules @@ -7,58 +7,58 @@ diff --git a/webkit/build/localized_strings/SConscript b/webkit/build/localized_strings/SConscript index d964e49..5d7cef2 100644 --- a/webkit/build/localized_strings/SConscript +++ b/webkit/build/localized_strings/SConscript @@ -30,8 +30,9 @@ env_grd = env.Clone() env_grd.Tool('scons', toolpath=[env_grd.Dir('$CHROME_SRC_DIR/tools/grit/grit')]) # This dummy target (webkit_strings) is used to tell the emitter where # to put the target files. -generated = env_grd.GRIT('webkit_strings', - '$CHROME_SRC_DIR/webkit/glue/webkit_strings.grd') +generated = env_grd.GRIT( + '$TARGET_ROOT/grit_derived_sources/fake_generated_target', + '$CHROME_SRC_DIR/webkit/glue/webkit_strings.grd') if env_res['PLATFORM'] == 'win32': for g in [g for g in generated if str(g).endswith('.rc')]: diff --git a/webkit/build/localized_strings/localized_strings.vcproj b/webkit/build/localized_strings/localized_strings.vcproj index a833027..bef1a48 100644 --- a/webkit/build/localized_strings/localized_strings.vcproj +++ b/webkit/build/localized_strings/localized_strings.vcproj @@ -69,7 +69,7 @@ > diff --git a/webkit/default_plugin/default_plugin.vsprops b/webkit/default_plugin/default_plugin.vsprops index db8a4cd..cb111c8 100644 --- a/webkit/default_plugin/default_plugin.vsprops +++ b/webkit/default_plugin/default_plugin.vsprops @@ -7,6 +7,6 @@ > diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript index 193a7b7..7715207 100644 --- a/webkit/tools/test_shell/SConscript +++ b/webkit/tools/test_shell/SConscript @@ -138,7 +138,7 @@ if env['PLATFORM'] == 'win32': resources = [ env_res.RES('resources/test_shell.rc'), '$NET_DIR/net_resources.res', - '$WEBKIT_DIR/build/localized_strings/webkit_strings_en-US.res', + '$TARGET_ROOT/grit_derived_sources/webkit_strings_en-US.res', ] exe_input_files += [ diff --git a/webkit/tools/test_shell/test_shell.vcproj b/webkit/tools/test_shell/test_shell.vcproj index b043e3d..e9170cf 100644 --- a/webkit/tools/test_shell/test_shell.vcproj +++ b/webkit/tools/test_shell/test_shell.vcproj @@ -205,7 +205,7 @@ > diff --git a/webkit/tools/test_shell/test_shell.vsprops b/webkit/tools/test_shell/test_shell.vsprops index bbdbab4..442c4f4 100644 --- a/webkit/tools/test_shell/test_shell.vsprops +++ b/webkit/tools/test_shell/test_shell.vsprops @@ -7,7 +7,7 @@ >