导入与版本控制系统为Android的工作室一个Eclipse Android项目 [英] Import an eclipse android project with version control system into Android Studio

查看:130
本文介绍了导入与版本控制系统为Android的工作室一个Eclipse Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入一个Eclipse项目与版本控制系统为Android的工作室。

支持直接Eclipse项目导入中添加了Android的工作室版0.5.5,我们并不需要从日食第一出口项目将其导入到Android的工作室。

我有一个Eclipse的Andr​​oid项目,而我试图导入到Android的工作室。 导入成功,但引进项目不再有版本控制。

编辑: - 更多细节

假设我有以下目录结构

 项目----
           | ---------- git的/
           | ----------- MyApp的
           | ------------ MyApp_imported
 

在项目导入,我点的Andr​​oid Studio将项目目录MyApp的,它复制在我的项目MyApp的新目录MyApp_Imported的所有文件。但是,导入的项目没有启用版本控制。 现在我不知道如何进一步进行。 我该如何告诉Android的Studio中使用旧的存储库,导入的项目。 一步一步的指导,这样做将是非常有益的。

下面是Android的工具书电子化计划网站

  

项目    - 导入模块现在应该正常工作。你可以导入现有的Eclipse    ADT项目以及摇篮模块集成到现有的摇篮工程;    它将在源复制如全项目导入完成后,以及    及物动词处理的依赖。导入模块,无论是从项目结构对话框或文件|导入模块的动作。    - 新的项目结构对话框中执行:应该会更快,包括    摇篮同步通知,不仅要在最后执行摇篮同步    必要时,并不会列出无效的IntelliJ模块警告和以前一样。照片    这是积极地,并在各个编辑工作    (对于口味,生成类型,签约配置等)将得到改善     在即将到来的构建。

解决方案

下面是一步一步的解决方案来做到这一点。

  1. 开启Android的工作室 - >导入项目 - >选择您的项目目录。 (另外,在上述情况下,MyApp的) 记住选择包含清单文件,否则新目录直接导入向导不 被触发和Android Studio使用旧的导入向导。
  2. 在Android的Studio将创建项目MyApp_imported新目录结构的副本。
  3. 在副本里你现有的git的目录MyApp_imported
  4. Android的工作室 - > VCS - >启用版本控制 这将使Android的工作室使用导入的项目现有的资源库。虽然进口的项目有 不同的目录结构,但混帐处理它们pretty的好。 你可能想也叫 git的补充。 git的添加-u 在进口项目的根文件夹内,确保所有的新文件添加和现有文件的动作是由git的检测。
  5. Android的工作室 - >更改 查看所有文件和提交。 Git会自动处理新的目录结构和文件历史记录等不会丢失。
  6. 现在,你可以在github /按到位桶分享 VCS->分享它在github 注: - 为您到位桶必须安装插件到位桶为Android工作室。

I am trying to import an eclipse project with version control system into Android Studio.

Support for direct eclipse project import was added in Android-Studio version "0.5.5" where we don't need to export project first from eclipse to import it into Android-Studio.

I have an eclipse Android Project which I am trying to import into Android Studio. Import is successful but imported project no more has version control.

Edit:- More detail

Suppose I have following Directory Structure

Project ----
           |---------- .git/
           |----------- MyApp 
           |------------MyApp_imported

During project import, I point Android Studio to Project Directory "MyApp", It copies all files in my project "MyApp" to new directory "MyApp_Imported". But imported project doesn't have version control enabled. Now I am not sure how to proceed further. How should I tell Android Studio to use old repository for imported project. A step by step guide to do this will be very helpful .

Here is text from Android Tools Project Site

Project - Importing modules should now work properly. You can import existing Eclipse ADT projects as well as Gradle modules into an existing Gradle project; it will copy in the sources as is done for full project import, as well as handle dependencies transitively. Import modules either from the project structure dialog or the File | Import Module action. - New project structure dialog implementation: Should be faster, includes Gradle sync notification, should only perform a Gradle sync at the end when necessary, and won't list invalid IntelliJ module warnings as before.
This is actively being worked on and the individual editors (for flavors, build types, signing configurations etc) will be improved in upcoming builds.

解决方案

Here is the step by step solution to do it.

  1. Open Android Studio -> Import Project-> Select your project directory. (In above case "MyApp") Remember Select the directory which contains Manifest file otherwise new "direct import wizard" doesn't get triggered and android studio uses old import wizard.
  2. Android Studio will create a copy of your project "MyApp_imported" with new directory structure.
  3. Copy your existing ".git" directory inside "MyApp_imported"
  4. Android Studio -> VCS -> Enable version control This will make Android Studio use your existing repository for imported project. Though imported project has different directory structure but git handles them pretty well. You might want to also call git add . and git add -u in the root folder of the imported project to make sure all new files are added and existing file moves are detected by git.
  5. Android Studio -> Changes Review all files and commit. Git will automatically handle new directory structure and file history etc will not be lost.
  6. Now you can share it on github/Bitbucket by VCS-> Share it on GitHUb Note:- For bitbucket you will have to install "Bitbucket plugin" for Android Studio.

这篇关于导入与版本控制系统为Android的工作室一个Eclipse Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆