1
0
forked from GRIN/grim

Build 27: let the Android app build without upstream's private maven mirror

This commit is contained in:
Claude
2026-06-12 01:13:07 -04:00
parent 704d95b04f
commit 661fd1834b
2 changed files with 23 additions and 24 deletions
+3 -1
View File
@@ -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
View File
@@ -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'