mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore(build): enable AboutLibraries offlineMode by default (#5054)
This commit is contained in:
parent
520fa717a9
commit
77e30b60e1
5 changed files with 22 additions and 19 deletions
|
|
@ -316,16 +316,16 @@ dependencies {
|
|||
}
|
||||
|
||||
aboutLibraries {
|
||||
// Fetch full license text + funding info from GitHub API when on CI with a token
|
||||
val isCi =
|
||||
providers
|
||||
.gradleProperty("ci")
|
||||
.map { it.toBoolean() }
|
||||
.getOrElse(providers.environmentVariable("CI").map { it.toBoolean() }.getOrElse(false))
|
||||
// Run offline by default to avoid burning GitHub API calls on every build.
|
||||
// Release builds pass -PaboutLibraries.release=true to fetch full license text + funding info.
|
||||
val isReleaseBuild = providers.gradleProperty("aboutLibraries.release").map { it.toBoolean() }.getOrElse(false)
|
||||
val ghToken = providers.environmentVariable("GITHUB_TOKEN")
|
||||
|
||||
offlineMode = !isReleaseBuild
|
||||
|
||||
collect {
|
||||
fetchRemoteLicense = isCi && ghToken.isPresent
|
||||
fetchRemoteFunding = isCi && ghToken.isPresent
|
||||
fetchRemoteLicense = isReleaseBuild && ghToken.isPresent
|
||||
fetchRemoteFunding = isReleaseBuild && ghToken.isPresent
|
||||
if (ghToken.isPresent) {
|
||||
gitHubApiToken = ghToken.get()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue