Prepare public-only GitHub publication

This commit is contained in:
Xisheng-Zhao
2026-06-03 18:45:29 +08:00
parent 376879bb74
commit 0da314e13f
+26 -12
View File
@@ -4,18 +4,32 @@ plugins {
id "org.jetbrains.kotlin.plugin.compose" id "org.jetbrains.kotlin.plugin.compose"
} }
def umengPublicAppKey = providers.gradleProperty("multicaUmengPublicAppKey") def localProperties = new Properties()
.orElse("") def localPropertiesFile = rootProject.file("local.properties")
.get() if (localPropertiesFile.exists()) {
def postHogPublicApiKey = providers.gradleProperty("multicaPostHogPublicApiKey") localPropertiesFile.withInputStream { localProperties.load(it) }
.orElse("") }
.get()
def postHogPublicHost = providers.gradleProperty("multicaPostHogPublicHost") def configValue = { String propertyName, String environmentName, String defaultValue ->
.orElse("https://us.i.posthog.com") def localValue = localProperties.getProperty(propertyName)
.get() if (localValue != null && !localValue.isBlank()) {
def analyticsRoute = providers.gradleProperty("multicaAnalyticsRoute") return localValue
.orElse("auto") }
.get() def gradleValue = providers.gradleProperty(propertyName).orNull
if (gradleValue != null && !gradleValue.isBlank()) {
return gradleValue
}
def environmentValue = providers.environmentVariable(environmentName).orNull
if (environmentValue != null && !environmentValue.isBlank()) {
return environmentValue
}
return defaultValue
}
def umengPublicAppKey = configValue("multicaUmengPublicAppKey", "MULTICA_UMENG_PUBLIC_APP_KEY", "")
def postHogPublicApiKey = configValue("multicaPostHogPublicApiKey", "MULTICA_POSTHOG_PUBLIC_API_KEY", "")
def postHogPublicHost = configValue("multicaPostHogPublicHost", "MULTICA_POSTHOG_PUBLIC_HOST", "https://us.i.posthog.com")
def analyticsRoute = configValue("multicaAnalyticsRoute", "MULTICA_ANALYTICS_ROUTE", "auto")
android { android {
namespace "ai.multica.app" namespace "ai.multica.app"