In GWT 2.0 CssResource, how I can turn off obfuscation for all my css classes?

AlfaTeK picture AlfaTeK · May 12, 2011 · Viewed 8.5k times · Source

I have a CssResource where I want to have some of the css classes "mapped" to methods:

@ClassName("top-table")
String topTable();

But I want to turn off the obfuscation GWT does (while developing at least, for better debugging in firebug, etc).

Is there an easy way to achieve this? I know I can use @external in my css file but then I have to define all my css classes like @external .c1, .c2, .c3, etc...

Something like @external .* would solve my problem but that doesn't seem to be available at least in gwt 2.0.x

My current solution is to use:

<set-configuration-property name="CssResource.style" value="pretty"/>

But that doesn't turn off the obfuscation, just makes it prettier :) I know obf is needed to avoid collisions but I don't have that in my case and would really like to turn off obfuscation

Answer

Christian Achilli picture Christian Achilli · Oct 15, 2013

To disable obfuscation for all of you legacy classes at once, you can exploit what is said here

In short, in the legacy css file, which you are binding using CssResource bundle, put this declaration: @external .*;

All the classes in the file that has this declaration file will not be obfuscated.