[英]Git Versioning and Library Projects
Please read both 1 and 2. If you are not an Android dev you could still help because this is a versioning problem as well. 请阅读1和2.如果您不是Android开发人员,您仍然可以提供帮助,因为这也是版本控制问题。
Here is the situation: 情况如下:
I have inherited an android project created in IntelliJ and am currently importing it into Eclipse. 我继承了一个在IntelliJ中创建的android项目,目前正在将它导入Eclipse。 But many obstacles lay in the way...
但是路上有很多障碍......
The project inherited was build in IntelliJ and the Android Library was a git repo and git submodules. 继承的项目是在IntelliJ中构建的,Android库是一个git repo和git子模块。 Thus the reference was to a git commit and the repo could be externally updated.
因此,引用是git提交,repo可以在外部更新。 I essentially need to get versioning with Android Libraries working (I do not care about using or not using git submodules).
我基本上需要使用Android库进行版本控制(我不关心使用或不使用git子模块)。 Anybody have a solution?
有人有解决方案吗?
The Answer for 答案
In IntelliJ Android Libraries can be sub-directories (children) of the project, however, in Eclipse you can only select Android Libraries that are in the current workspace (Siblings). 在IntelliJ中,Android库可以是项目的子目录(子项),但是,在Eclipse中,您只能选择当前工作区中的Android库(兄弟姐妹)。 Is it possible to select a child directory?
是否可以选择子目录?
Yes it is possible to reference a child directory(Android Library Project) in your Application project.
是的,可以在Application项目中引用子目录(Android Library Project)。
File
->Import
, UnderAndroid
selectExisting Android Code Into Workspace
, ForRoot Directory
browse to the root directory of your app project directory.File
- >Import
,在Android
选择Existing Android Code Into Workspace
,对于Root Directory
浏览到应用项目目录的根目录。 In the list of Projects you get your own project plus the library project ie the sub directory.在项目列表中,您可以获得自己的项目以及库项目,即子目录。 Make sure that only the library project is selected and not your App .
确保仅选择了库项目,而不是您的应用程序 。 Hit
Finish
.命中
Finish
。
Go to your Application project's
Android properties
and add this library project in thelibrary section
.转到Application项目的
Android properties
并在library section
添加此库项目。
And you're done. 而且你已经完成了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.