Java – Turning Proguard On/Off Using Properties

androidantjavaproguard

In my project.properties file there is a property proguard.config and when i run ant it will run proguard. All of the following will cause proguard to run

 proguard.config
 proguard.config=
 proguard.config=proguard.cfg

Is there a way within the properties file to turn proguard on/off?

Otherwise I am going to need to write a script to add/remove or rename the proguard.config property to control this. I would rather just get/set properties. I want the best solution for this. Right now I am coding replaceregexpr to rename the proguard.config to something else to turn off. Looking for a better solution and would like to know how others are controlling this?

Best Answer

A lot simpler way is to just have the line

#proguard.config=proguard.cfg

or even better still leave it out altogether! That way proguard doesn't run at all.