导入库项目+不同的项目进入Android的工作室从Eclipse中 [英] importing library project + different projects into Android Studio from Eclipse
问题描述
貌似时机已经成熟,我开始使用Android的工作室,因为我需要,不幸的是没有被移植一些功能到Eclipse:(
Looks like the time has come for me to start using Android Studio, as I need some features that unfortunately have not been ported to Eclipse :(
幸运的是Android的工作室能够近乎完美地导入我的项目,但我担心如果我做正确
Fortunately Android Studio is able to nearly-flawlessly import my projects, although I'm concerned if I'm doing it correctly
我的Eclipse工作区布局如下:
My Eclipse Workspace Layout is as follows:
- LIB- codeBase的是一个大的库项目包含大部分应用程序的牛肉
- APP-KINDLE 为可运行的项目使用前者,并提供了一些额外的课程和活动,为应用程序 版Kindle
- APP-FIRETV 是一样的,但有针对性亚马逊FireTV设备
- APP-GOOGLE 是一样的,但针对谷歌播放认证的设备
- APP-GCAST 是一样的,但有针对性支持的Chromecast现代化设备。
- LIB-CODEBASE is a big library project that contains most of the application beef
- APP-KINDLE is a runnable project that uses the former, and provides some additional classes and activities for the KINDLE version of the app
- APP-FIRETV is the same, but targeted to Amazon FireTV devices
- APP-GOOGLE is the same, but targeted to Google-Play certified devices
- APP-GCAST is the same, but targeted to modern devices supporting Chromecast.
当我导入Android Studio中的任何应用-XXXX 的项目,它创建 LIB- codeBase的的副本中。因此,对于每个 APP-XXXX 的项目,我有 LIB-的codeBase的完全复制他们的文件夹中。
When I import into Android Studio any of the APP-XXXX projects, it creates a copy of LIB-CODEBASE inside. So for each APP-XXXX project I have a full copy of LIB-CODEBASE inside their folders.
有没有一种简单的方法,使所有的 APP-XXXX 项目刚刚份额,链接,或包括在 LIB- codeBase的项目?
Is there an easy way to make all APP-XXXX projects to just share, link or include the LIB-CODEBASE project?
推荐答案
您可以参考一个项目里面的外部模块
Inside a project you can refer an external module.
只需使用:
Project
|__build.gradle
|__settings.gradle
|__app (application module)
|__build.gradle
在 settings.gradle
:
include ':app'
include ':codeBaseLib'
project(':codeBaseLib').projectDir=new File('pathLibrary')
在应用程序/的build.gradle
:
dependencies {
compile project(':codeBaseLib')
}
讲究codeBaseLib。结果
你必须使用该项目的其他项目,不是root 里面的库的路径。
也为您的APP-XXXX项目检查您可以使用一个单一的项目不同的的口味
Also for your APP-XXXX projects check if you can use a single project with different flavors.
这篇关于导入库项目+不同的项目进入Android的工作室从Eclipse中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!