多项目摇篮 [英] Gradle Multiproject
问题描述
我想为多环境的gradle配置。
I am trying to configure gradle for a multiproject environment.
我的项目结构如下:
MainProject
--external
--A
--B
--C
我已经能够配置的build.gradle并为MainProject的settings.gradle文件。
I have been able to configure the build.gradle and the settings.gradle file for the MainProject.
这是我的问题是,这两个子项目A和乙依赖基于C
The problem that I have is that both subprojects A & B depend on C
在项目中的的build.gradle
In project A 's build.gradle
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project('../C')
}
摇篮说无法找到路径../C项目。我应该把什么路在那里?
Gradle says unable to find project with path ../C. What path should I put in there?
推荐答案
试着用:
compile project(':external:C')
有关项目路径的更多详情,请参阅<一个href=\"http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec%3aproject_and_task_paths\"相对=nofollow>的摇篮用户手册中的部分56.5 。
For more details about project paths see section 56.5 in the Gradle user guide.
这篇关于多项目摇篮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!