之前的Andr​​oid dex'ing在Eclipse中始终运行ProGuard的 [英] Always running proguard before Android dex'ing in Eclipse

查看:126
本文介绍了之前的Andr​​oid dex'ing在Eclipse中始终运行ProGuard的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,使Eclipse中的总是的运行ProGuard的尝试运行的是Android应用程序时dex'ing过吗?例如无缝插入它作为构建步骤某种方式?

Is there a way to make Eclipse always run proguard before dex'ing when trying to run an Android Application? e.g. some way of seamlessly inserting it as a build step?

默认情况下,将运行导出时,但我需要它总是在运行,即使如从菜单/键盘只是在做一个正常的运行或调试。

By default it will run when exporting, but I need it to always run, even when e.g. just doing a normal "Run" or "Debug" from the menu / keyboard.

有关的背景下,这是相关的原因是,我遇到了太多的运算codeS /不扩充运codeS(HTTP://$c$c.google.com/ P /安卓/问题/详细信息?ID = 26203)与我建立在Eclipse中的问题。这不是一个问题,蚂蚁构建,因为它们运行ProGuard的,它去掉所有未使用的code。到现在为止,我一直在手工剥离从我的第三方的依赖未使用的东西,但它正变得有些可笑了。

For context, the reason this is relevant is that I'm running into the "too many opcodes / no expanded opcodes" (http://code.google.com/p/android/issues/detail?id=26203) issues with my build in Eclipse. It's not an issue for ant builds because they run proguard, which strips all of the unused code. Up until now I've been manually stripping unused things from my third party dependencies, but it is getting somewhat ridiculous.

此外,作为一个附带的好处是,它应该大大加快我的体型,因为收缩只ProGuard的运行是方式,方法比dex'ing更快,它消除大部分需要被DEX的code编辑。

Also, as a side benefit, it should dramatically speed up my build, because a shrink-only proguard run is way, way faster than dex'ing and it removes most of the code that needs to be dex'ed.

推荐答案

此行​​为是硬codeD的Eclipse插件在Android开发工具的建设者。你可以修改它的源$ C ​​$ C( Android的工具),使制造商的行为更像是导出向导(或内部的BuildHelper类的行为更像ExportHelper类)。这可能不会有太大的乐趣,但保持

This behavior is hard-coded in the builder of the Eclipse plugin in the Android Development Tools. You could adapt its source code (Android Tools) so the builder behaves more like the export wizard (or internally, the BuildHelper class behaves more like the ExportHelper class). That might not be much fun to maintain though.

另外,你可以从Eclipse中运行Ant。

Alternatively, you can run Ant from Eclipse.

另外另外,ProGuard的商业,封闭源代码的兄弟姐妹, DexGuard 的,集成的DX ProGuard,并将其的功能(和apkbuilder,jarsign,zipalign)。它可以被配置为缩小/模糊/优化调试/发布版本的Eclipse和蚂蚁。

Also alternatively, the commercial, closed-source sibling of ProGuard, DexGuard, integrates the functionality of ProGuard and of dx (and apkbuilder, jarsign, zipalign). It can be configured to shrink/obfuscate/optimize for debug/release builds in Eclipse and in Ant.

(我ProGuard,并将DexGuard的开发者)

(I am the developer of ProGuard and DexGuard)

这篇关于之前的Andr​​oid dex'ing在Eclipse中始终运行ProGuard的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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