Android的工作室0.8.1创建模块,而不复制文件? [英] Android Studio 0.8.1 Creating Modules without copying files?

查看:151
本文介绍了Android的工作室0.8.1创建模块,而不复制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建与Android的工作室0.8.1依赖项目。我知道如何通过添加模块来连接项目。

I'm creating projects with dependencies in Android Studio 0.8.1. I know how to link projects by adding modules.

不过,我意识到,导入模块创建libProject副本的项目中。

But I realized that 'importing modules' create a copy of the libProject inside the project.

有没有一种方法,以prevent是什么?就像一个外部模块?

Is there a way to prevent that ? Like an 'external module' ?

由于我负责这两个项目,我希望能够推动改变libProject回购,而无需复制文件夹中粘贴文件。

Since i'm in charge of both project, I want to be able to push changes to the libProject Repo, without having to copy paste files between folders.

感谢

推荐答案

是的,你可以做到这一点。该模块需要有设置为它摇篮构建文件。如果它有这一点,那么在你链接到它的项目,将其添加到 settings.gradle 的文件,在项目的根:

Yes, you can do it. The module needs to have a Gradle build file set up for it. If it's got that, then in the project you're linking to it, add this to the settings.gradle file at the project root:

include ':libraryName'
project(':libraryName').projectDir=new File('/path/to/library')

,你在第二行中指定的路径是包含库的 build.gradle 的文件的目录。路径可以是相对或绝对的。

where the path you specify in the second line is the path to the directory containing the library's build.gradle file. The path can be relative or absolute.

这篇关于Android的工作室0.8.1创建模块,而不复制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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