build: conditionalize JitPack repository for desktop-only builds (#5426)

This commit is contained in:
James Rich
2026-05-12 10:15:44 -05:00
committed by GitHub
parent 3bfc66eb29
commit fcf0b50746
2 changed files with 12 additions and 23 deletions

View File

@@ -20,12 +20,6 @@ pluginManagement {
google()
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://jitpack.io")
content {
includeGroupByRegex("com\\.github\\..*")
}
}
maven { url = uri("../offline-repository") }
}
}
@@ -46,12 +40,6 @@ dependencyResolutionManagement {
}
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://jitpack.io")
content {
includeGroupByRegex("com\\.github\\..*")
}
}
maven { url = uri("../offline-repository") }
}
versionCatalogs {

View File

@@ -21,11 +21,16 @@ pluginManagement {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://jitpack.io") }
maven { url = uri("./offline-repository") }
}
}
// Desktop-only mode: skip Android-only modules when ANDROID_HOME is unavailable (e.g. Flatpak builds).
// Activate via: DESKTOP_ONLY=true ./gradlew :desktop:packageUberJarForCurrentOS
val desktopOnly =
providers.gradleProperty("desktop.only").orNull?.toBoolean() == true ||
System.getenv("DESKTOP_ONLY")?.toBoolean() == true
plugins {
id("org.gradle.toolchains.foojay-resolver") version "1.0.0"
id("com.gradle.develocity") version "4.4.1"
@@ -50,10 +55,12 @@ dependencyResolutionManagement {
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
mavenContent { snapshotsOnly() }
}
maven {
url = uri("https://jitpack.io")
content {
includeGroupByRegex("com\\.github\\..*")
if (!desktopOnly) {
maven {
url = uri("https://jitpack.io")
content {
includeGroupByRegex("com\\.github\\..*")
}
}
}
maven { url = uri("./offline-repository") }
@@ -79,12 +86,6 @@ toolchainManagement {
}
}
// Desktop-only mode: skip Android-only modules when ANDROID_HOME is unavailable (e.g. Flatpak builds).
// Activate via: DESKTOP_ONLY=true ./gradlew :desktop:packageUberJarForCurrentOS
val desktopOnly =
providers.gradleProperty("desktop.only").orNull?.toBoolean() == true ||
System.getenv("DESKTOP_ONLY")?.toBoolean() == true
include(
":core:ble",
":core:common",