Proposal: eliminate platform assertions from grit (e.g. is_win, is_android, etc)

7 views
Skip to first unread message

Newton Allen

unread,
Feb 26, 2014, 3:05:54 PM2/26/14
to grit-...@googlegroups.com, Jói Sigurðsson, aur...@chromium.org
TL;DR: I am planning to remove platform assertions (e.g. is_win, is_android, etc) from grit. If you don't use platform assertions to conditionally include strings on certain platforms, this will not affect you. (As far as I can tell, platform assertions are only used in Chromium.) If you do use platform assertions, let me know, see the example below describing how your build scripts will need to change, and voice any concerns if you have them.

Background: Now that https://codereview.chromium.org/156443002/ has landed, platform assertions can be replaced with simple variable defines, and we can remove the target platform (-t) flag from the build tool.

Example grd file:
... <if expr="is_android"> ... </if> ...
... <if expr="is_win"> ... </if> ...
... <if expr="is_posix"> ... </if> ...

Before:
# Specify the target platform with -t while building
grit -i example.grd build -t android ...

After:
# Define variables is_android and is_posix using -D
grit -i example.grd build -D is_android -D is_posix ...

The main reason for removing platform assertions is that it decouples grit from the platforms that it's able to build on and removes a feature which is now mostly redundant with variable defines.

Best,
Newton
Reply all
Reply to author
Forward
0 new messages