依赖的gradle以上项目文件夹 [英] gradle dependencies in folder above project
问题描述
我将如何引用存储在文件的build.gradle上面的一个文件夹的Gradle中依赖?
必须有一些语法,这是否正确?所有引用我看到的样子。
编译':库:第三方
不过这算不上什么我要为
所以现在我已经在尝试这样做我的 settings.gradle
文件
包括':应用',':Android的凌空项目(':Android的凌空')PROJECTDIR =新的文件(../../共享组件/ Android的凌空抽射')。
在这里我想链接我的Android凌空抽射项目,这是重大的修改,所以在使用maven的链接不会对我好,我想用这个项目和其他项目,我在
这不允许我的项目同步正常的多了,对抽射import语句不工作,因为它无法找到依赖
下面是 .iml
文件Android的工作室/的IntelliJ创建
<?XML版本=1.0编码=UTF-8&GT?;
<模块external.linked.project.path =$ MODULE_DIR $external.root.project.path =$ MODULE_DIR $ / ..external.system.id =摇篮external.system.module.group = whosayexternal.system.module.version =未指定类型=JAVA_MODULE版本=4>
<成分名称=FacetManager>
<小面型=Android的gradle这个NAME =Android的摇篮>
<结构>
<选项名=GRADLE_PROJECT_PATHVALUE =:Android的凌空/>
< /结构>
< /面>
<小面型=java的gradle这个NAME =Java的摇篮>
<结构>
<选项名=BUILD_FOLDER_PATH/>
< /结构>
< /面>
< /成分>
<成分名称=NewModuleRootManager继承编译器输出=真>
<排除输出/>
<内容URL =文件:// $ MODULE_DIR $>
< excludeFolder URL =文件://$MODULE_DIR$/.gradle/>
< excludeFolder URL =文件:// $ MODULE_DIR $ /打造/>
< /内容>
<订单条目类型=inheritedJdk/>
<订单条目类型=sourceFolderforTests =FALSE/>
< /成分>
< /模块>
什么是错的?
也许你忘了在应用程序build.grade文件中添加依赖关系:
事情是这样的:
{相关性
编制项目(路径:':Android的凌空')
}
How would I reference gradle dependencies that are stored in a folder above the build.gradle file?
There must be some syntax for this correct? all the references I see look like
compile ':libs:thirdparty'
but this isn't really what I'm going for
so now I've tried this in my settings.gradle
file
include ':app', ':android-volley'
project(':android-volley').projectDir=new File('../../shared-components/android-volley')
where I am trying to link my android-volley project, it is heavily modified so using the maven link will be no good for me, and I want to use these files between this project and other projects I work on
this does not allow my project to "sync" properly any more, and the import statements for volley do not work because it cannot find the dependencies
here is the .iml
file Android Studio / IntelliJ creates
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="whosay" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":android-volley" />
</configuration>
</facet>
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
what is wrong?
Probably you forgot to add dependencies in app build.grade file:
Something like this:
dependencies {
compile project(path: ':android-volley')
}
这篇关于依赖的gradle以上项目文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!