当前位置:网站首页>buildscript和allprojects的作用和区别是什么?
buildscript和allprojects的作用和区别是什么?
2022-08-03 20:56:00 【互联网小熊猫】
在Android Studio的Project的build.gradle中
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.novoda:bintray-release:0.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://dl.bintray.com/calvinning/maven'}
}
}
那么buildscript中的repositories和allprojects的repositories的作用和区别是什么呢?
答:
1、 buildscript里是gradle脚本执行所需依赖,分别是对应的maven库和插件
2、 allprojects里是项目本身需要的依赖,比如我现在要依赖我自己maven库的toastutils库,那么我应该将maven {url ‘https://dl.bintray.com/calvinning/maven’}写在这里,而不是buildscript中,不然找不到。
边栏推荐
猜你喜欢
[email protected] 594/[email prote"/>RNA核糖核酸修饰Alexa 568/[email protected] 594/[email prote

RNA核糖核酸修饰荧光染料|HiLyte Fluor 488/555/594/647/680/750标记RNA核糖核酸

Likou 59 - Spiral Matrix II - Boundary Judgment

NAACL 2022 | 具有元重加权的鲁棒自增强命名实体识别技术

Orcad Capture Cadence 新建原理图多部分smybol和Homogeneous、Heterogeneous类型介绍教程

Engineering Effectiveness Governance for Agile Delivery

【HiFlow】经常忘记签到怎么办?使用腾讯云场景连接器每天提醒你。

敏捷交付的工程效能治理

小朋友学C语言(1):Hello World

PyCharm function automatically add comments without parameters
随机推荐
Android build error: Plugin with id ‘kotlin-android‘ not found.
Markdown syntax
leetcode 231. 2 的幂
李沐动手学深度学习V2-自然语言推断与数据集SNLI和代码实现
数学之美 第六章——信息的度量和作用
alicloud3搭建wordpress
glusterfs 搭建使用
leetcode 326. Powers of 3
Alexa染料标记RNA核糖核酸|RNA-Alexa 514|RNA-Alexa 488|RNA-Alexa 430
ES6--剩余参数
ES6-箭头函数
leetcode 剑指 Offer 15. 二进制中1的个数
leetcode 448. Find All Numbers Disappeared in an Array 找到所有数组中消失的数字(简单)
收藏-即时通讯(IM)开源项目OpenIM-功能手册
Leetcode 125. Verify palindrome string
From September 1st, my country has granted zero-tariff treatment to 98% of tax items from 16 countries including Togo
Cesium 修改鼠标样式
力扣707-设计链表——链表
2022-8-3 第七组 潘堂智 锁、多线程
15 years experience in software architect summary: in the field of ML, tread beginners, five hole