简体   繁体   English

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

[英]How do i checkout an android project from an SVN repository

I have an android project and I have added it to an SVN repository. 我有一个Android项目,我已将其添加到SVN存储库。 These are the directories/files I have added 这些是我添加的目录/文件

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) 从SVN签出导入项目(这是一个项目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 在eclipse中使用创建新项目来创建新项目 - 步骤是: 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? 在我创建新项目时,您是否有一些我没有提交的文件或者我做错了什么?

I spent a lot of time trying to import an Android project from a web based SVN provider into Eclipse (Juno). 我花了很多时间尝试从基于Web的SVN提供程序导入Android项目到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. 您必须已安装和配置SVN。 No previous project is needed in Eclipse Eclipse中不需要以前的项目 您必须已安装和配置SVN。 Eclipse中不需要以前的项目

  • I already had the connection to the provider correctly configured due to previous attempts. 由于之前的尝试,我已经正确配置了与提供商的连接。 YMYV here. YMYV在这里。 由于之前的尝试,我已经正确配置了与提供商的连接。 YMYV在这里。

  • I use SVNKit 1.7 because it will work just fine over a proxy here at work. 我使用SVNKit 1.7,因为它在工作时可以正常工作。 我使用SVNKit 1.7,因为它在工作时可以正常工作。

  • Here is the most important step: make sure the Find projects in the children option is selected 这是最重要的步骤:确保选中项中的查找项目选项 这是最重要的步骤:确保选中子项中的查找项目选项。

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

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

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

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. 希望它能够在找出正确的步骤之后为我节省很多时间。

In Eclipse try: 在Eclipse中尝试:

Right click in project view. 在项目视图中右键单击。

-> Import - >导入

-> Enter Android - >输入Android

-> Select "Existing Android Code Into Workspace" - >选择“现有Android代码进入工作区”

-> Select your checked out svn folder. - >选择已签出的svn文件夹。

finish. 完。 :) :)

The easiest way to checkout an Android Project with Eclipse is the use the plugin "Subclipse" (http://subclipse.tigris.org). 使用Eclipse签出Android项目的最简单方法是使用插件“Subclipse”(http://subclipse.tigris.org)。 With this plugin, directly on Eclipse you can checkout "as android project" 有了这个插件,可以直接在Eclipse上查看“as android project”

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. 在撰写本文时,我正在使用Eclipse Kepler Service Release 2和最新的Subclipse。 Here is the workaround. 这是解决方法。 This method also preserves the ability to commit your changes, unlike some instructions I found on this site. 与我在本网站上找到的一些说明不同,此方法还保留了提交更改的功能。

  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 通过Eclipse将项目从SVN导入临时目录
  3. Delete the project, don't check "Delete files" 删除项目,不要选中“删除文件”
  4. Import Android project from existing code, choose your imported project in the temp directory 从现有代码导入Android项目,在temp目录中选择导入的项目
  5. Refactor - > Move, check "Use default location". 重构 - >移动,选中“使用默认位置”。 This moves the project from the temp directory to your regular workspace, ie one level up. 这会将项目从临时目录移动到常规工作区,即一级。

Despite of biggvsdiccvs I skipped using a temp directory which helped to avoid problems with referenced libs like the android support library . 尽管有biggvsdiccvs我跳过使用临时目录,这有助于避免引用libs的问题,如android支持库

  1. Install Subclipse and SVNKit ( video tutorial 0:12 ) 安装Subclipse和SVNKit( 视频教程0:12
  2. Switch to SVN perspective and add your repository ( video tutorial 1:12 ) 切换到SVN透视图并添加您的存储库( 视频教程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 切换回Java透视图并使用刚安装的SVN Eclipse插件选择“文件>导入> SVN>从SVN签出项目”或按照视频教程1:42
  4. Select your repo 选择你的回购
  5. Choose "Checkout as project with the name specified" 选择“Checkout as name with name name”
  6. Choose "Checkout as projects into Workspace" 选择“Checkout as Project 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 从现有代码导入Android项目,选择导入的项目

Use TortoiseSVN . 使用TortoiseSVN You can also use it for Git.To properly upload and download your files from SVN. 您也可以将它用于Git。从SVN正确上传和下载您的文件。 Maybe your SVN client not working correctly. 也许您的SVN客户端无法正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从svn到android studio的checkout eclipse项目 - checkout eclipse project from svn to android studio 如何在具有支持库的svn中放置android项目 - how do I place an android project in svn having support libraries Eclipse项目存储在Android studio的SVN checkout中 - Eclipse project stored in SVN checkout in Android studio Eclipse Android项目SVN检出:文件夹已锁定 - Eclipse Android project SVN checkout: folder locked 如何将Android项目上传到SVN存储库以及要忽略哪些文件? - How to upload an Android project into SVN repository & which files to ignore? 从Eclipse在SVN存储库上提交项目 - Commiting project on svn repository from eclipse 如何将项目导入到android studio中,该项目实际上是我已经克隆到计算机的github存储库? - How do I import a project into android studio that is actually a github repository that I have already cloned to my computer? 如何从SVN将Cordova-Android存储库导入Cordova-Base项目平台 - How can I import cordova-android respository to platform of cordova-base project from svn 如何将APP结帐从Android代码库迁移到Gradle项目 - How to migrate a APP checkout from Android code base to gradle project 在SVN存储库中导入Android Studio项目的正确方法是什么? - What is the right way to import an Android Studio project in a SVN repository?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM