问题
I use eclipse and I guess ant building system. In my project root i have a project.properties file which contains proguard.config setting. This setting is said in sdk examples to either
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
or
proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt
I have found somewhere that you can state multiple files delimited by colon ":".
But nowhere it is explained in depth which of files takes precedence. I mean does this use file proguard-android.txt from {sdk.dir} folder or proguard-project.txt from project root folder or does it somehow merge the setting from the two. What is the correct usage? Should I reference both files: the one in {sdk.dir} folder as a default and my proguard-project.txt for project specific stuff? Or should I take proguard-android.txt or proguard-android-optimize.txt and use that as a base for my proguard-project.txt and modify accordingly? Basically, what is the correct usage or best practice? Experimenting and testing is a bit time consuming to say the least.
回答1:
In lack of better answer....
Via a completely unrelated google search I found by coincidence this:
http://tools.android.com/recent/proguardimprovements
As of ADT 17, the proguard.config property refers to a path instead, so you can specify as many configuration files as you want. These are all joined together by ProGuard.
...
Note that ProGuard typically doesn't let you subtract flags, so if you disagree with one of the default flags, you'll need to copy the global configuration into your own files and remove the lines you want to disable. One such flag you might want to consider is the -dontoptimize
Still very vague.
flag.
来源:https://stackoverflow.com/questions/33070599/how-to-use-proguard-config-setting-in-project-properties-file