当前位置:网站首页>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中,不然找不到。
边栏推荐
- CLIP论文解读
- leetcode 16.01. 交换数字(不使用临时变量交换2个数的值)
- NAACL 2022 | 具有元重加权的鲁棒自增强命名实体识别技术
- Android build error: Plugin with id ‘kotlin-android‘ not found.
- 系统运维系列 之CSV文件读取时内容中包含逗号的处理方法
- 华为设备配置VRRP与BFD联动实现快速切换
- Edge box + time series database, technology selection behind Midea's digital platform iBuilding
- TweenMax.js向日葵表情变化
- canvas螺旋动画js特效
- 用 setTimeout 来实现 setInterval
猜你喜欢

Zero trust, which has been popular for more than ten years, why can't it be implemented?

Markdown syntax

15年软件架构师经验总结:在ML领域,初学者踩过的五个坑

abs()、fabs() 和 labs() 的区别

不专业面试官的经验总结

面试官:为什么 0.1 + 0.2 == 0.300000004?

Often forget HiFlow 】 【 check-in?Use tencent cloud scenario connector to remind you every day.

Use setTimeout to realize setInterval

CLIP论文解读

基于DMS的数仓智能运维服务,知多少?
随机推荐
leetcode refers to Offer 58 - II. Left Rotate String
敏捷交付的工程效能治理
Markdown语法
Cesium 修改鼠标样式
YARN功能介绍、交互流程及调度策略
glusterfs build and use
idea2021.1.3配置Gradle步骤
leetcode 231. Powers of 2
在树莓派上搭建属于自己的网页(3)
直播源码开发,各种常见的广告形式
leetcode 136. 只出现一次的数字(异或!!)
leetcode 16.01. Swap numbers (swap the values of 2 numbers without using temporary variables)
Leetcode 899. An orderly queue
数据库定时备份winserver2012篇
leetcode 2119. Numbers reversed twice
【使用 Pytorch 实现入门级的人工神经网络】
化算力为战力:宁夏中卫的数字化转型启示录
太香了! 阿里 Redis 速成笔记, 从头到尾全是精华!
15年软件架构师经验总结:在ML领域,初学者踩过的五个坑
ES6简介及let、var、const区别