Erros in trying to synchronize Eclipse workspace files across a Windows machine and an Ubuntu machine; which files must or must not be included?

前端 未结 2 648
庸人自扰
庸人自扰 2020-12-20 00:15

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 comput

相关标签:
2条回答
  • 2020-12-20 00:34

    The correct, simplest, and most robust way to do what you want is to use a version control system like CVS, svn, git, etc. Even when working alone on a project, its a wise idea, not just for having the code on different computers but also because it gives you all the benefits of version management like being able to rollback changes, etc. There are many free or inexpensive cvs, svn, and git hosting options; I strongly suggest you get an account and check your code in/out on the two machines you work on. If you have a web hosting provider, chances are they provide one of these services with your account.

    If you're going to insist on manually moving/syncing code, you need to know that Eclipse workspaces are NOT designed or intended to be shared. Trying to do so always leads to headaches and other pain. Instead, you can export/import the project(s), not the workspace. Keep in mind that in Eclipse, a Project does not have to be located in the workspace directory; when you create a project there's an option to store it in any arbitrary location on your filesystem. Also note that all files under the project (including .project and .classpath) should be shared, except generated stuff like bin/ and gen/. This applies to using cvs, svn, etc or some other manual syncing mechanism.

    0 讨论(0)
  • 2020-12-20 00:38

    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.

    Generally, the only files that makes your project a Android Project are:

    • src/
    • res/
    • assets/
    • lib/ (if you import external jar libraries)
    • AndroidManifest.xml
    • project.properties (or default.properties, renamed since r14)
    • proguard.cfg (if you use Proguard)

    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.

    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.

    0 讨论(0)
提交回复
热议问题