eclipse 我如何从 SVN 存储库签出一个 android 项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11326189/
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 18:27:53  来源:igfitidea点击:

How do i checkout an android project from an SVN repository

androideclipsesvneclipse-pluginsubclipse

提问by Arvind Sridharan

I have an android project and I have added it to an SVN repository. These are the directories/files I have added

我有一个 android 项目,并且已将其添加到 SVN 存储库中。这些是我添加的目录/文件

Directories : res, src, lib,

目录:res、src、lib、

Files : AndroidManiFest.xml, project.properties, proguard.cfg, and 2 launch files

文件:AndroidManiFest.xml、project.properties、proguard.cfg 和 2 个启动文件

However, when i do the following, I'm not able to create the file as an android project

但是,当我执行以下操作时,我无法将该文件创建为 android 项目

  1. Import project by checking out from SVN (this is a project A)
  2. Using the create new project in eclipse to create the new project - steps are : Create New Projects -> Android Project from Existing Source Code
  1. 通过从SVN检出导入项目(这是一个项目A)
  2. 在 Eclipse 中使用 create new project 创建新项目 - 步骤是: Create New Projects -> Android Project from Existing Source Code

Are thee some files that I have not committed or am I doing something wrong when I'm creating the new project?

你是我没有提交的一些文件还是我在创建新项目时做错了什么?

回答by Henrique de Sousa

I spent a lot of time trying to import an Android project from a web based SVN provider into Eclipse (Juno).

我花了很多时间尝试将一个 Android 项目从基于 Web 的 SVN 提供程序导入到 Eclipse (Juno) 中。

Seeing how hard it was for me to find out the correct steps, I leave here my suggestion with screenshots. Enjoy!

看到我很难找到正确的步骤,我把我的建议和截图留在了这里。享受!

  • You must have SVN already installed and configured. No previous project is needed in EclipseYou must have SVN already installed and configured. No previous project is needed in Eclipse

  • I already had the connection to the provider correctly configured due to previous attempts. YMYV here.I already had the connection to the provider correctly configured due to previous attempts. YMYV here.

  • I use SVNKit 1.7 because it will work just fine over a proxy here at work.I use SVNKit 1.7 because it will work just fine over a proxy here at work.

  • Here is the most important step: make sure the Find projects in the childrenoption is selectedHere is the most important step: make sure the Find projects in the children option is selected.

  • Choose Checkout as a projectChoose checkout as a project

  • Choose whatever workspace you needChoose whatever workspace you need

  • And voilá, the project is ready to roll!And *voilá*, the project is ready to roll!

  • 您必须已经安装并配置了 SVN。Eclipse 中不需要以前的项目您必须已经安装并配置了 SVN。 Eclipse 中不需要以前的项目

  • 由于之前的尝试,我已经正确配置了与提供者的连接。YMYV在这里。由于之前的尝试,我已经正确配置了与提供者的连接。 YMYV在这里。

  • 我使用 SVNKit 1.7,因为它可以在工作中通过代理正常工作。我使用 SVNKit 1.7,因为它可以在工作中通过代理正常工作。

  • 这是最重要的步骤:确保选中“在子项中查找项目”选项这是最重要的步骤:确保选中“在子项中查找项目”选项。

  • 选择Checkout 作为项目Choose checkout as a project

  • 选择您需要的任何工作空间Choose whatever workspace you need

  • 瞧,该项目已准备就绪!And *voilá*, the project is ready to roll!

I added descriptions into the images, for your viewing pleasure. Hope it saves someone a lot of time as it did to me after figuring out the correct steps.

我在图像中添加了描述,以供您观看。希望在找出正确的步骤后,它可以像对我一样节省很多时间。

回答by Fabian

In Eclipse try:

在 Eclipse 中尝试:

Right click in project view.

在项目视图中右键单击。

-> Import

-> Enter Android

-> Select "Existing Android Code Into Workspace"

-> Select your checked out svn folder.

-> 导入

-> 进入安卓

-> 选择“现有的 Android 代码进入工作区”

-> 选择您签出的 svn 文件夹。

finish. :)

结束。:)

回答by Aurélien Guillard

The easiest way to checkout an Android Project with Eclipse is the use the plugin "Subclipse" (http://subclipse.tigris.org). With this plugin, directly on Eclipse you can checkout "as android project"

使用 Eclipse 检查 Android 项目的最简单方法是使用插件“Subclipse”(http://subclipse.tigris.org)。使用此插件,您可以直接在 Eclipse 上签出“作为 android 项目”

回答by biggvsdiccvs

I'm not sure why, but I'm missing the "Find projects in the children" option. I'm using Eclipse Kepler Service Release 2 with the latest Subclipse as of this writing. Here is the workaround. This method also preserves the ability to commit your changes, unlike some instructions I found on this site.

我不知道为什么,但我缺少“在孩子中查找项目”选项。在撰写本文时,我正在使用 Eclipse Kepler Service Release 2 和最新的 Subclipse。这是解决方法。与我在本网站上找到的一些说明不同,此方法还保留了提交更改的能力。

  1. Create a temp directory under your default workspace directory (may not necessarily need to be under workspace, but it works)
  2. Import your project from SVN into the temp directory through Eclipse
  3. Delete the project, don't check "Delete files"
  4. Import Android project from existing code, choose your imported project in the temp directory
  5. Refactor - > Move, check "Use default location". This moves the project from the temp directory to your regular workspace, i.e. one level up.
  1. 在您的默认工作空间目录下创建一个临时目录(可能不一定需要在工作空间下,但它可以工作)
  2. 通过Eclipse将你的项目从SVN导入到temp目录中
  3. 删除项目,不要勾选“删除文件”
  4. 从现有代码导入 Android 项目,在 temp 目录中选择您导入的项目
  5. 重构 -> 移动,勾选“使用默认位置”。这会将项目从临时目录移动到您的常规工作区,即上一级。

回答by OneWorld

Despite of biggvsdiccvs I skipped using a temp directory which helped to avoid problems with referenced libs like the android support library.

尽管有 biggvsdiccvs,我还是跳过了使用临时目录,这有助于避免引用的库(如 android 支持库)出现问题

  1. Install Subclipse and SVNKit (video tutorial 0:12)
  2. Switch to SVN perspective and add your repository (video tutorial 1:12)
  3. Switch back to Java perspective and Choose "File > Import > SVN > Checkout Projects from SVN" using your freshly installed SVN Eclipse plugin or follow video tutorial 1:42
  4. Select your repo
  5. Choose "Checkout as project with the name specified"
  6. Choose "Checkout as projects into Workspace"
  7. Enable "Use default workspace location"
  8. Delete the project, don't check "Delete files"
  9. Import Android project from existing code, choose your imported project
  1. 安装 Subclipse 和 SVNKit(视频教程 0:12
  2. 切换到 SVN 透视图并添加您的存储库(视频教程 1:12
  3. 切换回 Java 透视图并使用新安装的 SVN Eclipse 插件或按照视频教程 1:42选择“文件 > 导入 > SVN > Checkout Projects from SVN”
  4. 选择你的回购
  5. 选择“Checkout as project with the name specified”
  6. 选择“作为项目结帐到工作区”
  7. 启用“使用默认工作区位置”
  8. 删除项目,不要勾选“删除文件”
  9. 从现有代码导入 Android 项目,选择您导入的项目

回答by Vipul Purohit

Use TortoiseSVN. You can also use it for Git.To properly upload and download your files from SVN. Maybe your SVN client not working correctly.

使用TortoiseSVN。您也可以将其用于 Git。从 SVN 正确上传和下载您的文件。也许您的 SVN 客户端工作不正常。