Proguard: use variable to point to the sdk directory

坚强是说给别人听的谎言 提交于 2020-01-06 04:36:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!