Android:有针对性的res文件夹进行eclipse调试 [英] Android: targeted res folders for debugging in eclipse

查看:140
本文介绍了Android:有针对性的res文件夹进行eclipse调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



然而,当涉及到eclipse的另一个故事。我想做的是设置一个设置,以便我可以指定我想要的res文件夹,同时在eclipse中调试。



任何人都知道我该怎么做?



我目前的工作是将res-customer1文件夹复制到res文件夹中,并在eclipse中进行调试,然后将其移回res-customer1,然后才能构建它使用Maven。我真的不想这样做,因为它会很容易犯错误,并导致自己负担的问题,如果我只是将eclipse直接导入文件夹,而不是移动文件夹为eclipse将会更加麻烦。 / p>

任何想法?感谢提前

解决方案

您可以在Eclipse中使用链接源,右键单击您的项目,选择构建路径 - > 链接源...



更新: Eclipse版本使用此链接





Project Explorer中的最后一个样子:





请注意,res文件夹图标,它只是一个符号链接到res-customer1文件夹。这种方法的优点是文件系统中现有的项目文件夹保持不变,从头开始就不需要一个固定的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.

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?

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

解决方案

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

UPDATE: For some Eclipse versions use this link

Final look in Project Explorer:

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:有针对性的res文件夹进行eclipse调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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