|
|
Descriptionoptimize branding - use branding_path_component variable for defining branding specific paths
Please take a look at my post here
https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-dev/pIQjhkVl4cE
I am not sure about build/common.gypi
Please correct me if I am wrong.
PS:
This is just to start, there are more places to refactor.
BUG=
Committed: https://crrev.com/c88987ff0e5f9df2218c1bb62e671cbbb50991e0
Cr-Commit-Position: refs/heads/master@{#326765}
Patch Set 1 #
Total comments: 3
Patch Set 2 : Fixed according to comments #
Total comments: 7
Patch Set 3 : Fixed conditional branding #
Messages
Total messages: 37 (7 generated)
gburanov@gmail.com changed reviewers: + cjhopman@chromium.org, dpranke@chromium.org
gburanov@gmail.com changed reviewers: + jochen@chromium.org, sky@chromium.org
Just some comments about the syntax. https://codereview.chromium.org/1090213002/diff/1/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/1/build/common.gypi#newcode94 build/common.gypi:94: 'branding_path_component%': 'chromium', You can remove this one. https://codereview.chromium.org/1090213002/diff/1/build/common.gypi#newcode150 build/common.gypi:150: 'branding_path_component%': '<(branding_path_component)', Should be: 'branding_path_component%': 'chromium', https://codereview.chromium.org/1090213002/diff/1/build/common.gypi#newcode303 build/common.gypi:303: 'branding_path_component%': '<(branding_path_component)', Fix indentation here and everywhere else.
should there be corresponding changes in the GN files? I'm not actually sure yet if we have the branding stuff hooked up in the necessary places in GN, but please check and verify.
Fixed according to comments We have branding hooked in GN files, but we dont need to change anything in GN files (at least in this review). Because all paths are remaining exactly the same
mmoss@chromium.org changed reviewers: + mmoss@chromium.org
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', Default 'branding' is "Chromium", but the usages you're replacing are "chromium", so if branding is unspecified, this will break on case-sensitive file systems.
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', On 2015/04/21 15:11:53, Michael Moss wrote: > Default 'branding' is "Chromium", but the usages you're replacing are > "chromium", so if branding is unspecified, this will break on case-sensitive > file systems. No, just to clarify: For Chromium: branding_path_component: 'chromium' branding: 'Chromium' For Google Chrome branding_path_component: 'google_chrome' branding: 'Chrome' For other brandings, branding_path_component = branding Take a look at upper line 'branding_path_component%': 'chromium',
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', > Take a look at upper line > 'branding_path_component%': 'chromium', That just sets a default, which you then universally override here, by setting it to either 'google_chrome' or '<(branding)'. This effectively makes the default "branding_path_component" value == the default "branding" value, which is 'Chromium', not 'chromium'. You can easily see this by running gyp_chromium with different "branding" values (or no "branding" defined) and see what paths are used in the output.
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', yep, you are correct. sorry. I will fix it.
https://codereview.chromium.org/1090213002/diff/20001/chrome/chrome_installer... File chrome/chrome_installer.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/chrome/chrome_installer... chrome/chrome_installer.gypi:10: 'branding_dir_100': 'app/theme/default_100_percent/<(branding_path_component)', FYI, I think since this is moved out of the conditionals at the bottom, you can also remove the workaround re-definitions of these variables in the Mac and Linux sections below.
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', Do you know how to make double if here? ['branding == "Chrome"', { 'branding_path_component%': 'google_chrome', }, { ['branding == "Chromium"', { 'branding_pathcomponent%': 'chromium', }, { 'branding_path_component%': '<(branding)', }] }], This one is not working...
https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/1090213002/diff/20001/build/common.gypi#newco... build/common.gypi:192: 'branding_path_component%': '<(branding)', You can wrap a 'conditions' inside a 'conditions', which is awkward, but I don't know if there's any better way to basically do an 'if/else-if/else' in gyp, like: # if ['branding == "Chrome"', { 'branding_path_component%': 'google_chrome', }, { # else-if 'conditions': [ ['branding == "Chromium"', { 'branding_path_component%': 'chromium', # else }, { 'branding_path_component%': '<(branding)', }], ] }], Or maybe something like: # Set the default above, where you currently set it to 'chromium'. 'branding_path_component%': '<(branding)', # Then handle special cases (with no "else") in the 'conditions' block. 'conditions': [ ['branding == "Chrome"', { 'branding_path_component%': 'google_chrome', }], ['branding == "Chromium"', { 'branding_path_component%': 'chromium', }],
yep, fixed, I like the second much more!
On 2015/04/23 09:02:20, gburanov wrote: > yep, fixed, I like the second much more! BTW, I have found one strange definition in remoting_options.gypi 'branding_path': '../remoting/branding_<(branding)', this seems dangerous to be (case sensitive issue) and can be also refactored by me. What do you think?
On 2015/04/23 11:34:08, gburanov wrote: > On 2015/04/23 09:02:20, gburanov wrote: > > yep, fixed, I like the second much more! > > BTW, I have found one strange definition in remoting_options.gypi > > 'branding_path': '../remoting/branding_<(branding)', > > this seems dangerous to be (case sensitive issue) and can be also refactored by > me. What do you think? but better to do it in separate review fo course
Just take a look how much optimization it is possible to do after this review will be closed. And this is just the first part. https://codereview.chromium.org/1105633003 This will be the next review after this one will be closed and commited
On 2015/04/23 11:34:08, gburanov wrote: > On 2015/04/23 09:02:20, gburanov wrote: > > yep, fixed, I like the second much more! > > BTW, I have found one strange definition in remoting_options.gypi > > 'branding_path': '../remoting/branding_<(branding)', > > this seems dangerous to be (case sensitive issue) and can be also refactored by > me. What do you think? Yes, that will break for any new "branding" values. It probably shouldn't be doing that :(
> Yes, that will break for any new "branding" values. It probably shouldn't be > doing that :( I means this will break for new branding anyway. But IMHO it is better to use lower case file names and use 'branding_path': '../remoting/branding_<(branding_path_component)',
Is it possible to close it today?)
Hi. Is it possible to close it today please?)
lgtm
lgtm
The CQ bit was checked by gburanov@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1090213002/40001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
gburanov@gmail.com changed reviewers: + jhawkins@chromium.org
lgtm
The CQ bit was checked by gburanov@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1090213002/40001
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/c88987ff0e5f9df2218c1bb62e671cbbb50991e0 Cr-Commit-Position: refs/heads/master@{#326765}
Message was sent while issue was closed.
On 2015/04/24 09:27:17, I haz the power (commit-bot) wrote: > Patchset 3 (id:??) landed as > https://crrev.com/c88987ff0e5f9df2218c1bb62e671cbbb50991e0 > Cr-Commit-Position: refs/heads/master@{#326765} thank you!
Message was sent while issue was closed.
lgtm
Message was sent while issue was closed.
LGTM |