Proguard:使用变量指向sdk目录 [英] Proguard: use variable to point to the sdk directory
本文介绍了Proguard:使用变量指向sdk目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的一些proguard.cfg文件中有这两行:
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
我的问题是,是否可以使用一些变量来避免对sdk进行硬编码?
否则,当我将文件提交到svn时,其他开发人员必须手动更改文件,这实际上是无法维护的.
Otherwise when I commit the file into svn, the other developers must change the file manually, which is not really maintainable.
我找到了<java.home>
变量,但是<android.sdk>
或<sdk.dir>
无效.
I've found the <java.home>
variable, but <android.sdk>
or <sdk.dir>
don't work.
推荐答案
您可以使用
-libraryjars <android.sdk>/add-ons/addon-google_apis-google_inc_-10/libs/maps.jar
-libraryjars <android.sdk>/tools/support/annotations.jar
,如果您确保将android.sdk定义为Java系统属性.这可能意味着您必须将其传递给JVM,例如像
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 ......
这篇关于Proguard:使用变量指向sdk目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文