问题
I have these two lines in some of my proguard.cfg files:
-libraryjars /path/to/sdk/android-sdk-linux/add-ons/addon-google_apis-google_inc_-10/libs/maps.jar
-libraryjars /path/to/sdk/android-sdk-linux/tools/support/annotations.jar
My question is whether there is some variable one can use to avoid having a hardcoded path to the sdk?
Otherwise when I commit the file into svn, the other developers must change the file manually, which is not really maintainable.
I've found the <java.home> variable, but <android.sdk> or <sdk.dir> don't work.
回答1:
You can use
-libraryjars <android.sdk>/add-ons/addon-google_apis-google_inc_-10/libs/maps.jar
-libraryjars <android.sdk>/tools/support/annotations.jar
if you make sure that android.sdk is defined as a Java system property. This may mean that you have to pass it to the JVM, e.g. with something like
java -Dandroid.sdk=$ANDROID_HOME ......
来源:https://stackoverflow.com/questions/17040212/proguard-use-variable-to-point-to-the-sdk-directory