-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
48 lines (42 loc) · 1.65 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import java.util.Properties
buildscript {
repositories {
google()
mavenCentral()
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlinKapt) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.kover) apply false
}
subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
}
}
}
val localProperties = Properties().apply {
val localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.inputStream().use { load(it) }
}
}
// Helper function to retrieve property with priority to environment variable
fun getProperty(key: String, defaultValue: String = ""): String =
System.getenv(key) ?: localProperties.getProperty(key, defaultValue)
// Set extra properties that will be accessible in all modules
extra["BASE_URL"] = getProperty("BASE_URL", "https://default-url.com")
extra["VIEW_NAME"] = getProperty("VIEW_NAME", "defaultView")
extra["ROKT_TAG_ID"] = getProperty("ROKT_TAG_ID", "defaultTagId")
extra["ROKT_PUB_ID"] = getProperty("ROKT_PUB_ID", "defaultPubId")
extra["ROKT_SECRET"] = getProperty("ROKT_SECRET", "defaultSecretId")
extra["ROKT_CLIENT_UNIQUE_ID"] = getProperty("ROKT_CLIENT_UNIQUE_ID", "defaultClientId")