Android+Eclipse 项目通过 SVN 共享?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3166947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:51:37  来源:igfitidea点击:

Android+Eclipse project sharing via SVN?

javaandroideclipsesvn

提问by el2iot2

I am very new to Eclipse (Galileo, Eclipse IDE for Java Developers) and working on my first Android app, but have used SVN on many other kinds of projects and development. Last night I took my first crack at pushing the new source into a shared repository (at work) and then pulling it back down at home.

我对 Eclipse(Galileo,Java 开发人员的 Eclipse IDE)非常陌生,正在开发我的第一个 Android 应用程序,但在许多其他类型的项目和开发中使用了 SVN。昨晚,我第一次尝试将新源代码推送到共享存储库(在工作中),然后将其拉回家中。

Based on an SO question/answer, I had ignored the binand genfolders, but added everything else. When I got home, I had hoped it would be as easy as pointing eclipse to the newly downloaded source tree.

基于 SO 问题/答案,我忽略了bingen文件夹,但添加了其他所有内容。当我回到家时,我曾希望它会像将 eclipse 指向新下载的源代码树一样简单。

I tried setting the workspace (requested when eclipse started) to the precise folder holding all source. Nothing showed up. It was as if I were starting fresh regardless of all the source and files sitting in the workspace folder.

我尝试将工作区(在 eclipse 启动时请求)设置为包含所有源的精确文件夹。什么都没有出现。无论工作区文件夹中的所有源文件和文件如何,我都好像重新开始一样。

Then I thought maybe I needed to open a "project" file to get things rolling. Opening the .projectfile yielded the contents of that file in the XML editor of eclipse.

然后我想也许我需要打开一个“项目”文件才能让事情顺利进行。.project在 Eclipse 的 XML 编辑器中打开该文件会产生该文件的内容。

What am I missing here? Is the project metadata not stored in the source tree? Do I have to build project metadata up on every machine that gets a working copy of the source? Is this something wrong with my home Eclipse install? Can someone give me an overview of how they (successfully) do this?

我在这里错过了什么?项目元数据是否未存储在源树中?我是否必须在获得源工作副本的每台机器上构建项目元数据?我的家庭 Eclipse 安装有问题吗?有人可以概述一下他们是如何(成功地)做到这一点的吗?

回答by Ryan Conrad

You should be able to do it like you tried. Make sure you have the Android Development Tools (android eclipse plugin) installed along with the android SDK and make sure you set up ADT before you open the project.

你应该能够像你尝试的那样做。确保您已安装 Android 开发工具(android eclipse 插件)以及 android SDK,并确保在打开项目之前设置 ADT。

Not checking in the bin directory makes sense to me, but I do check in the gen folder and don't have any problems.

不检查 bin 目录对我来说很有意义,但我确实检查了 gen 文件夹并且没有任何问题。

Here is what I do to open a project from SVN if the source is already on the machine:

如果源已经在机器上,这是我从 SVN 打开项目的操作:

  1. Open eclipse
  2. Click on File->Import
  3. Select General->Existing Projects into Workspace
  1. 打开日食
  2. 点击文件->导入
  3. 选择 General->Existing Projects into Workspace

Or you can also do this:

或者你也可以这样做:

  1. Open Eclipse
  2. File -> Import
  3. Select SVN -> Checkout Projects from SVN
  4. Follow the steps to get from SVN
  1. 打开日食
  2. 文件 -> 导入
  3. 选择 SVN -> 从 SVN 签出项目
  4. 按照步骤从SVN获取