如何排除文件在" / RES"一个Android Eclipse项目的文件夹 [英] How To Exclude Files in "/res" Folder of an Android Eclipse Project

查看:211
本文介绍了如何排除文件在" / RES"一个Android Eclipse项目的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法来从Android的建设者正在处理中排除/ res文件夹下的某些文件?

Is there any way to exclude certain files under the /res folder from being processed by the Android builder?

我有几款Android项目,我建立使用Eclipse。我在我们的版本控制系统上传这些项目。问题是,版本控制增加了一些project.pj文件,每个文件夹。

I have several Android projects, which I build using Eclipse. I uploaded these projects in our version-control system. The problem is, the version-control adds some "project.pj" file to every folder.

由于这些project.pj的文件,我的项目不会在Eclipse构建了。我得到的错误,因为建筑商试图处理下/ RES这些文件。我知道我可以排除这些文件为/ src和/根文件夹,但我怎么排除它们用于/ RES(和/资产)文件夹?

Because of these project.pj files, my projects won't build in Eclipse anymore. I get errors because the builder tries to process these files under /res. I know I can exclude these files for the /src and /gen folders, but how do I exclude them for the /res (and /assets) folders?

推荐答案

AAPT 是处理下RES /文件的程序。有没有办法告诉它忽略某些文件。所以,答案很简单:你不能。您的VCS是不适宜采用的Andr​​oid项目。你听说过的git的?

aapt is the program that processes the files under res/. There's no way to tell it to ignore certain files. So, short answer: you can't. Your VCS is poorly suited to Android projects. Have you heard of git?

这是说,你的编译系统可以扩展到这些不必要的文件移动出的方式,运行AAPT,然后将它们移到右后卫。当你使用Eclipse,完成这意味着黑客攻击的Andr​​oid插件添加这些额外的步骤。或者编写自己的插件,执行绕到Android插件调用这些步骤 - 我从来没砍死Eclipse的自己,不会想。有任何其他的构建系统(例如使用maven或蚂蚁,或作出或脚本),这样做是为了解该系统如何做任何事情一样简单。 Eclipse是只需方式更多地参与。作为最后的选择,你可以写在项目目录自己的脚本,围绕移动这些.pj文件,自己在适当的时间运行这些脚本,而不从Eclipse中得到任何帮助。

That said, your build system can be extended to move these unwanted files out of the way, run aapt, and then move them right back. As you're using Eclipse, accomplishing this means hacking its Android plugin to add these additional steps. Or perhaps writing your own plugin that performs these steps around a call to the Android plugin -- I've never hacked on Eclipse myself, and wouldn't want to. To have any other build system (e.g. using maven, or ant, or make, or scripts) do this is as simple as understanding how that system does anything. Eclipse is just way more involved. As a final option, you can write your own scripts in the project directory that move these .pj files around, and run these scripts yourself at appropriate times, without getting any help from Eclipse.

这篇关于如何排除文件在" / RES"一个Android Eclipse项目的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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