Build 27: let the Android app build without upstream's private maven mirror
This commit is contained in:
@@ -71,7 +71,9 @@ android {
|
||||
applicationVariants.all { variant ->
|
||||
def flavor = variant.productFlavors[0].name
|
||||
|
||||
if (flavor == "ci") {
|
||||
// The ci branch reads the private-mirror properties at configuration time,
|
||||
// which runs for every variant — only enter it when the mirror is configured.
|
||||
if (flavor == "ci" && project.hasProperty("mavenHost")) {
|
||||
repositories {
|
||||
maven {
|
||||
credentials {
|
||||
|
||||
+20
-23
@@ -1,29 +1,26 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven {
|
||||
credentials {
|
||||
username "$mavenUser"
|
||||
password "$mavenPassword"
|
||||
// Private mirror only when its coordinates are supplied (-PmavenHost=… as in upstream CI);
|
||||
// everyone else resolves plugins from the public repositories.
|
||||
def mavenHost = providers.gradleProperty("mavenHost")
|
||||
if (mavenHost.present) {
|
||||
def mavenUser = providers.gradleProperty("mavenUser").get()
|
||||
def mavenPassword = providers.gradleProperty("mavenPassword").get()
|
||||
["gradle-plugin-portal", "google-maven", "maven-central"].each { repo ->
|
||||
maven {
|
||||
credentials {
|
||||
username mavenUser
|
||||
password mavenPassword
|
||||
}
|
||||
url "${mavenHost.get()}/repository/${repo}/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
}
|
||||
url "$mavenHost/repository/gradle-plugin-portal/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
maven {
|
||||
credentials {
|
||||
username "$mavenUser"
|
||||
password "$mavenPassword"
|
||||
}
|
||||
url "$mavenHost/repository/google-maven/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
maven {
|
||||
credentials {
|
||||
username "$mavenUser"
|
||||
password "$mavenPassword"
|
||||
}
|
||||
url "$mavenHost/repository/maven-central/"
|
||||
allowInsecureProtocol = true
|
||||
} else {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
}
|
||||
include ':app'
|
||||
include ':app'
|
||||
|
||||
Reference in New Issue
Block a user