Android:用于在 Eclipse 中调试的目标 res 文件夹 [英] Android: targeted res folders for debugging in eclipse

查看:23
本文介绍了Android:用于在 Eclipse 中调试的目标 res 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我有多个不同品牌的版本,有两个不同的 res 文件夹.IE.res-customer1, res-customer2使用 Maven 构建配置文件,我可以使用指定的 res 文件夹轻松构建项目.

I have a project which I have a number of different branded versions, with two different res folders. ie. res-customer1, res-customer2 Using Maven build profiles I can easily build the project using the specified res folder.

然而,当谈到黯然失色时,它又是另一回事了.我想要做的是有一个设置,以便我可以指定我想要的 res 文件夹,同时在 eclipse 中进行调试.

However when it comes to eclipse its another story. What I want to do is to have a setting so that I can specify the res folder that I want, whilst debugging in eclipse.

有人知道我该怎么做吗?

Anyone know how I can do this?

我目前的工作是将 res-customer1 文件夹复制到 res 文件夹中,然后在 eclipse 中进行调试,然后在我可以使用 Maven 构建它之前将其移回 res-customer1.我真的不想这样做,因为它很容易犯错误并给自己带来很多问题,如果我可以将 eclipse 直接指向文件夹,而不是为 eclipse 移动文件夹,那么麻烦就会少得多.

My current work around is to copy the res-customer1 folder into the res folder work on it and debug in eclipse then move it back to res-customer1 before I can build it using Maven. I don't really want to be doing this as it will be easy to make a mistake and cause myself loads of problems, if I could just direct eclipse to the folder, rather than moving the folder for eclipse would be much less hassle.

有什么想法吗?提前致谢

Any ideas? Thanks in Advance

推荐答案

您可以在 Eclipse 中使用 Link Source,右键单击您的项目,选择 Build Path ->链接源...:

You can use Link Source in Eclipse, right-click your project, choose Build Path -> Link Source...:

更新:对于某些 Eclipse 版本使用 此链接

UPDATE: For some Eclipse versions use this link

在项目资源管理器中最后查看:

Final look in Project Explorer:

注意res文件夹图标中的小标志,它只是一个符号链接指向 res-customer1 文件夹.这种方法的优点在于文件系统中现有的项目文件夹保持不变,您不需要从一开始就建立一个固定的 res 文件夹.

Note that the little sign in the res folder icon , it is just a symbolic link poing to the res-customer1 folder. The beautiful point in this approach is the existing project folder in file system remain the same, you don't need a solid res folder from the beginning.

这篇关于Android:用于在 Eclipse 中调试的目标 res 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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