[英]How to depend on specific class or package in another Gradle module?
I have two gradle modules, :app
and :backend
. 我有两个gradle模块
:app
和:backend
。 The backend contains some classes that I need in :app
. 后端包含一些我需要在
:app
。 So normally I would add compile project(':backend')
to my app module's dependencies. 因此,通常我会将
compile project(':backend')
到应用模块的依赖项中。
However, this adds all of backend and its dependencies to :app
. 但是,这会将所有后端及其依赖项添加到
:app
。 Is there any way to tell gradle to add only specific classes or packages (and their dependencies) from :backend
to :app
? 有什么办法告诉gradle从
:backend
到:app
仅添加特定的类或包(及其依赖项) ?
EDIT: :backend
is a AppEngine module, which contains a whole host of duplicate google dependencies that clash with my android app when I don't use the android-endpoints
configuration. 编辑::
:backend
是一个AppEngine模块,其中包含大量重复的Google依赖项,当我不使用android-endpoints
配置时,这些依赖项与我的android应用程序发生冲突。
For removing all the transitive dependencies you can 要删除所有传递依赖项,您可以
compile (project(path: ':backend', configuration: 'android-endpoints')) {
transitive = false
}
For ignoring some of them 因为忽略了其中一些
compile (project(path: ':backend', configuration: 'android-endpoints')) {
exclude(group: 'some.group', module: 'some.module')
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.