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.不过,我...

我要创建与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.

阅读全文

相关推荐

最新文章