在 Eclipse 中将自定义参数传递给 aapt
是否可以告诉 Eclipse 对 aapt 使用一些额外的参数(具体为 -0)?
过去几个小时我一直在寻找,我想到的最好的方法是为 aapt 工具创建一个包装器,以将参数注入命令行。这种方法的问题在于,每当我丢失该包装器时,我就会悄悄地在我的应用程序中引入一个错误。
Is it possible to tell Eclipse to use some extra arguments for aapt (-0 in specific)?
I have been looking for past couple of hours and the best hack I came up with was to create a wrapper for the aapt tool to inject the argument to the command line. The trouble with this approach is that whenever I should lose that wrapper, then I'll be quietly introducing a bug into my application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为如果没有您提到的某种包装脚本,这是不可能的。
或者,您可以使用 Android ant 脚本来构建应用程序的发布版本,因为这可以让您轻松覆盖所使用的命令行参数。它还可以帮助您独立于 Eclipse 插件构建事物,这在您进行持续集成时非常有用。
希望您不会因为至少在发布前对您的应用程序进行冒烟测试而悄悄引入错误。
I don't think it is possible without some sort of wrapper script as you mention.
Alternatively, you could use an Android ant script to build the release version of your application, as that lets you easily override the command line parameters used. It also helps you build things independently of the Eclipse plugin which is useful should you get into continuous integration.
Hopefully you wouldn't be quietly introducing a bug anyway due to at least smoke testing your app before release.
谢谢克里斯托弗的回答。这是我用 python 构建的 aapt 包装器脚本,以防有人需要它:
Thank you Christopher for your answer. Here is the aapt wrapper script I built in python for my purposes in case anyone needs it: