build gradle dependencies闭包的详解


转 :https://blog.csdn.net/guanguanboy/article/details/91043641

dependencies闭包的整体功能是指定当前项目所有依赖关系:本地依赖、库依赖及远程依赖。

本地依赖:可以对本地Jar包或者目录添加依赖关系

库依赖:可以对项目中的库模块添加依赖关系

远程依赖:可以对jcenter库上的开源项目添加依赖,标准的远程依赖格式是:域名:组织名:版本号

dependencies {
   implementation fileTree(dir: 'libs', include: ['*.jar']) // 本地依赖
   // 远程依赖,com.android.support是域名部分,appcompat-v7是组名称,26.1.0是版本号
  implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
     implementation project(':hello') // 库依赖
    testImplementation 'junit:junit:4.12' // 声明测试用列库
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM