DescriptionStrip comments and whitespace from Javascript resources
This CL creates the infrastructure to strip comments and spaces from
Javascript resources, and uses this infrastructure on
the components and browser resources, hence reducing the size of
each pak file by around 20% (total reduction ~340KB)
The CL uses the Closure compiler to strip spaces and comments. Because
this may be slow, the CL uses ninja (via GN) to only run it on changed
Javascript resources. To do this the resources are processed in three
stages:
1) Strip <include..> and <if...> blocks. These are not part of Javascript
and can't be handled by the compiler.
2) Run the Closure compiler
3) Run grit, creating the resource file.
To enable this sequence this CL adds an argument to grit that tells it the
location of preprocessed (and hence moved) files.
At present this is only implemented on Android builds, since the builders
for other platforms may not have Java, which is required to run
the closure compiler.
BUG=619091
Patch Set 1 #Patch Set 2 : Fix some silly errors #Patch Set 3 : Fix setting platform when not cross-compiling #Patch Set 4 : Disable on everything except Android #Patch Set 5 : Fix non-Android builds #Patch Set 6 : Add test for flattener, move code to grit subdirectory #Patch Set 7 : Also strip Javascript browser resources #
Total comments: 22
Patch Set 8 : Respond to comments, plus rebases. #
Total comments: 9
Messages
Total messages: 53 (18 generated)
|