尝试在 Windows 机器和 Ubuntu 机器上同步 Eclipse 工作区文件时出错;哪些文件必须包含或不能包含?
我一直在 Windows 机器上开发 Android 应用程序.现在我想在另一台 Ubuntu 10.04 LTS 机器上继续开发.我想在计算机之间移动,维护每台计算机上项目文件的最新副本.我正在使用 SpiderOak 创建用于开发的 Eclipse 工作区目录的同步.当文件从 Windows 机器复制到 Ubuntu 机器上并运行 Eclipse 时,出现错误,无法验证 java sdk 的路径,显示的路径是与 Windows 机器相关的路径.
I have been developing an Android app on a Windows machine. Now I would like to continue development on another Ubuntu 10.04 LTS machine. I would like to move between computers maintaining a recent copy of the project files on each computer. I am using SpiderOak to create a synchronization of the workspace directories of Eclipse which I am using for development. When the files were copied from the Windows machine onto the Ubuntu machine and I ran Eclipse, an error was presented that the path to the java sdk could not be validated and the path shown was the path relevant to the Windows machine.
有没有简单的解决方案?我可以想象一些关于工作空间细节的文件不应该被传输.我可以简单地省略传输 Eclipse 创建的每个工作空间中包含的 .metadata
文件夹吗?我对同步对应用程序的操作不重要的首选项/插件/部分不感兴趣.从同步中排除 .metadata
是否会造成另一个问题,即无法传输有关正在开发的 Android 应用程序的有价值信息?
Is there a simple solution to this? I can imagine that some files regarding the workspace specifics should not be transferred. Can I simply omit transferring the .metadata
folder contained in each workspace created by Eclipse? I am not interested in synchronizing preferences/plugins/parts not essential to the operation of the app. Will excluding the .metadata
from the sync create another problem in not transferring valuable information regarding the Android app being developed?
推荐答案
只要我手头有我的项目源代码,我永远不会考虑同步Eclipse工作区目录进行跨平台开发.正确的方法是单独维护您的源代码(分开,我的意思是不要将您的源代码绑定到任何操作系统上的任何 IDE,如果条件允许,始终建议使用版本控制系统),无论您想通过 Eclipse 还是 IntelliJ 开始开发,在 Windows、Linux 或 Mac 上,获取源代码副本并将其导入 IDE.
As long as I have my project source code on hand, I will never consider synchronizing Eclipse workspace directory for cross-platform development. The correct way is maintain your source separately (by separately, I means do not bind your source to any IDE on any OS, use version control system is always recommended if the condition allows), wherever your want to start development by Eclipse or IntelliJ, on Windows, Linux or Mac, get a copy of you source and import it into your IDE.
通常,使您的项目成为 Android 项目的唯一文件是:
Generally, the only files that makes your project a Android Project are:
- src/
- res/
- 资产/
- lib/(如果你导入外部 jar 库)
- AndroidManifest.xml
- project.properties(或 default.properties,自 r14 起重命名)
- proguard.cfg(如果您使用 Proguard)
如果您在团队中工作并使用 SVN 之类的源代码管理,则只有这些文件夹/文件需要签入 SVN,所有其他文件夹/文件(.project、.classpath、.settings/、bin/、target/和等)是不必要的.这些是在导入和构建项目时由 IDE 迭代生成的.
If you work within a team and use source control like SVN, these are the only required folders/files that need checked in to SVN, all others (.project, .classpath, .settings/, bin/, target/ and etc.) are not necessary. thoese are iteratively generated by IDE when import and build your project.
这适用于所有三种 Android 项目类型(Android 项目、Libaray 项目和测试项目),如果您熟悉 Ant 或 Maven 等其他构建工具,它也可能对您维护跨平台开发有很大帮助.
This applies to all three Android project type (Android Project, Libaray Project and Test Project), If you are familiar with other build tools like Ant or Maven, it may also helps you a lot to maintain cross-platform development.
相关文章