Issue #17819: Add Maven Central repository.

This commit is contained in:
Sebastian Kaspari 2021-02-09 17:06:03 +01:00
parent 88facc4608
commit 886850483c
3 changed files with 43 additions and 1 deletions

View File

@ -13,6 +13,7 @@ buildscript {
includeGroupByRegex RepoMatching.mozilla
}
}
maven {
name "Mozilla"
url "https://maven.mozilla.org/maven2"
@ -21,6 +22,7 @@ buildscript {
includeGroupByRegex RepoMatching.mozilla
}
}
if (project.hasProperty("googleRepo")) {
maven {
name "Google"
@ -38,6 +40,24 @@ buildscript {
}
}
if (project.hasProperty("centralRepo")) {
maven {
name "MavenCentral"
url project.property("centralRepo")
}
} else {
mavenCentral() {
content {
// Improve security: don't search deps with known repos.
excludeGroupByRegex RepoMatching.mozilla
excludeGroupByRegex RepoMatching.androidx
excludeGroupByRegex RepoMatching.comGoogleAndroid
excludeGroupByRegex RepoMatching.comGoogleFirebase
excludeGroupByRegex RepoMatching.comAndroid
}
}
}
if (project.hasProperty("jcenterRepo")) {
maven {
name "BintrayJCenter"
@ -86,6 +106,7 @@ allprojects {
includeGroupByRegex RepoMatching.mozilla
}
}
maven {
name "Mozilla"
url "https://maven.mozilla.org/maven2"
@ -94,6 +115,7 @@ allprojects {
includeGroupByRegex RepoMatching.mozilla
}
}
if (project.hasProperty("googleRepo")) {
maven {
name "Google"
@ -110,6 +132,25 @@ allprojects {
}
}
}
if (project.hasProperty("centralRepo")) {
maven {
name "MavenCentral"
url project.property("centralRepo")
}
} else {
mavenCentral() {
content {
// Improve security: don't search deps with known repos.
excludeGroupByRegex RepoMatching.mozilla
excludeGroupByRegex RepoMatching.androidx
excludeGroupByRegex RepoMatching.comGoogleAndroid
excludeGroupByRegex RepoMatching.comGoogleFirebase
excludeGroupByRegex RepoMatching.comAndroid
}
}
}
if (project.hasProperty("jcenterRepo")) {
maven {
name "BintrayJCenter"

View File

@ -19,7 +19,7 @@ pushd $PROJECT_DIR
. taskcluster/scripts/toolchain/android-gradle-dependencies/before.sh
NEXUS_PREFIX='http://localhost:8081/nexus/content/repositories'
GRADLE_ARGS="--parallel -PgoogleRepo=$NEXUS_PREFIX/google/ -PjcenterRepo=$NEXUS_PREFIX/jcenter/"
GRADLE_ARGS="--parallel -PgoogleRepo=$NEXUS_PREFIX/google/ -PjcenterRepo=$NEXUS_PREFIX/jcenter/ -PcentralRepo=$NEXUS_PREFIX/central/"
# We build everything to be sure to fetch all dependencies
./gradlew $GRADLE_ARGS assemble assembleAndroidTest testClasses ktlint detekt
# Some tests may be flaky, although they still download dependencies. So we let the following

View File

@ -22,6 +22,7 @@ mkdir -p android-gradle-dependencies /builds/worker/artifacts
cp -R ${NEXUS_WORK}/storage/jcenter android-gradle-dependencies
cp -R ${NEXUS_WORK}/storage/google android-gradle-dependencies
cp -R ${NEXUS_WORK}/storage/central android-gradle-dependencies
tar cf - android-gradle-dependencies | xz > /builds/worker/artifacts/android-gradle-dependencies.tar.xz