如何在project.properties文件中使用proguard.config设置? [英] How to use proguard.config setting in project.properties file?

查看:424
本文介绍了如何在project.properties文件中使用proguard.config设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse,我想是蚂蚁建筑系统.在我的项目根目录中,我有一个project.properties文件,其中包含proguard.config设置.在sdk示例中,此设置可以说是

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

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

proguard.config = $ {sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt

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 ":".

但是,在任何地方都没有深入解释哪个文件优先.我的意思是,这是使用{sdk.dir}文件夹中的文件proguard-android.txt还是项目根文件夹中的文件proguard-project.txt还是以某种方式合并了两者的设置. 正确的用法是什么?我是否应该引用这两个文件:{sdk.dir}文件夹中的一个默认文件,而我的proguard-project.txt文件中的项目专用文件?还是应该采用proguard-android.txt或proguard-android-optimize.txt并将其用作proguard-project.txt的基础并进行相应的修改? 基本上,正确的用法或最佳做法是什么?至少可以说,进行实验和测试会花费一些时间.

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.

推荐答案

缺少更好的答案....

In lack of better answer....

通过偶然发现的一个完全不相关的google搜索:

Via a completely unrelated google search I found by coincidence this:

http://tools.android.com/recent/proguardimprovements

从ADT 17开始,proguard.config属性改为引用路径, 因此,您可以根据需要指定任意数量的配置文件.这些是 所有这些都是由ProGuard共同完成的.

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.

...

请注意,ProGuard通常不允许您减去标志,因此,如果您 与默认标志之一不同,您需要复制全局标志 配置到您自己的文件中,然后删除要删除的行 禁用.您可能要考虑的一个这样的标志是-dontoptimize

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

还是很模糊.

标志.

这篇关于如何在project.properties文件中使用proguard.config设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆