70 lines
3.1 KiB
Groovy
70 lines
3.1 KiB
Groovy
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
buildscript {
|
|
repositories {
|
|
def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/central/'
|
|
def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/public/'
|
|
all { ArtifactRepository repo ->
|
|
if (repo instanceof MavenArtifactRepository) {
|
|
def url = repo.url.toString()
|
|
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('http://repo1.maven.org/maven2')) {
|
|
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
|
|
remove repo
|
|
}
|
|
if (url.startsWith('https://jcenter.bintray.com/') || url.startsWith('http://jcenter.bintray.com/')) {
|
|
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
|
|
remove repo
|
|
}
|
|
}
|
|
}
|
|
|
|
maven { url ALIYUN_REPOSITORY_URL }
|
|
maven { url ALIYUN_JCENTER_URL }
|
|
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
maven { url "https://s01.oss.sonatype.org/content/groups/public" }
|
|
maven { url 'https://jitpack.io' }
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath "com.android.tools.build:gradle:4.2.0"
|
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
// in the individual module build.gradle files
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
def ALIYUN_REPOSITORY_URL = 'https://maven.aliyun.com/repository/central/'
|
|
def ALIYUN_JCENTER_URL = 'https://maven.aliyun.com/repository/public/'
|
|
all { ArtifactRepository repo ->
|
|
if (repo instanceof MavenArtifactRepository) {
|
|
def url = repo.url.toString()
|
|
if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('http://repo1.maven.org/maven2')) {
|
|
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
|
|
remove repo
|
|
}
|
|
if (url.startsWith('https://jcenter.bintray.com/') || url.startsWith('http://jcenter.bintray.com/')) {
|
|
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
|
|
remove repo
|
|
}
|
|
}
|
|
}
|
|
maven {
|
|
url ALIYUN_REPOSITORY_URL
|
|
}
|
|
maven { url ALIYUN_JCENTER_URL }
|
|
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
|
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
|
maven { url "https://s01.oss.sonatype.org/content/groups/public" }
|
|
maven { url 'https://jitpack.io' }
|
|
google()
|
|
mavenCentral()
|
|
jcenter() // Warning: this repository is going to shut down soon
|
|
}
|
|
}
|
|
|
|
task clean(type: Delete) {
|
|
delete rootProject.buildDir
|
|
} |