diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-11 14:57:20 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-11 14:57:20 +0000 |
commit | 50db8131849c456c71cadf455438bb51b5e55b82 (patch) | |
tree | 6b31f0cecd281f2abacf17c95efad045c555662a /chrome | |
parent | b1fc294270003c25ffebf7d3cf4381b93cf91c40 (diff) | |
download | chromium_src-50db8131849c456c71cadf455438bb51b5e55b82.zip chromium_src-50db8131849c456c71cadf455438bb51b5e55b82.tar.gz chromium_src-50db8131849c456c71cadf455438bb51b5e55b82.tar.bz2 |
Add about_credits.html and recognize ssl_error.html in its new location.
Do a better job of handling source .html files in arbitrary directories
by using a Builder (to massage the suffixes) with an Emitter (to put the
target in the $BROWSER_RESOURCES directory).
Review URL: http://codereview.chromium.org/7248
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/SConscript | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/chrome/SConscript b/chrome/SConscript index a23b126..d333d5e 100644 --- a/chrome/SConscript +++ b/chrome/SConscript @@ -367,28 +367,38 @@ env_flat = env.Clone( FLATTEN_HTML_COM = '$PYTHON $HTML_INLINE $SOURCE $TARGET', ) +def FlatHtmlEmitter(target, source, env): + # When we get the target, it will have the "_flat.html" suffix, + # but will be next to the sourcefile. Replace it with a + # string that puts it in the $BROWSER_RESOURCES directory. + target = [env.File('$BROWSER_RESOURCES/' + target[0].name)] + return target, source + +env_flat['BUILDERS']['FlatHtml'] = Builder(action='$FLATTEN_HTML_COM', + suffix='_flat.html', + source_suffix='.html', + emitter=FlatHtmlEmitter) + flats = [ - 'about_memory', - 'about_version', - 'incognito_tab', - 'new_tab', - 'safe_browsing_malware_block', - 'safe_browsing_phishing_block', - 'ssl_error', + 'browser/resources/about_credits.html', + 'browser/resources/about_memory.html', + 'browser/resources/about_version.html', + 'browser/resources/incognito_tab.html', + 'browser/resources/new_tab.html', + 'browser/resources/safe_browsing_malware_block.html', + 'browser/resources/safe_browsing_phishing_block.html', + 'browser/security/resources/ssl_error.html', + 'browser/security/resources/ssl_roadblock.html', ] # TODO(port) if env_flat['PLATFORM'] == 'win32': flats_out = [] for i in flats: - flats_out += env_flat.Command( - '$BROWSER_RESOURCES/' + i + '_flat.html', - 'browser/resources/' + i + '.html', '$FLATTEN_HTML_COM') - - flats_out += env_flat.Command( - '$BROWSER_RESOURCES/ssl_roadblock_flat.html', - 'browser/security/resources/ssl_roadblock.html', '$FLATTEN_HTML_COM') + flats_out.extend(env_flat.FlatHtml(i)) + # TODO(sgk): Remove when we upgrade to SCons 1.1.0, which + # determines implicit dependencies from .rc files. env_flat.Depends(browser_res, flats_out) |