-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
101 lines (89 loc) · 3.19 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
buildscript {
dependencies {
listOf(
libs.jacoco.agent,
libs.jacoco.ant,
libs.jacoco.core,
libs.jacoco.report,
).forEach {
classpath(it)
}
}
val localProperties = java.util.Properties()
if (rootProject.file("local.properties").exists()) {
localProperties.load(java.io.FileInputStream(rootProject.file("local.properties")))
}
val getVersionCode: () -> Int = {
val code: Int =
if (rootProject.hasProperty("versionCode")) {
rootProject.property("versionCode").toString().toInt()
} else if (localProperties.getProperty("versionCode") != null) {
localProperties.getProperty("versionCode").toString().toInt()
} else {
throw Error(
"Version code was not found as a command line parameter or a local property",
)
}
println("VersionCode is set to $code")
code
}
val getVersionName: () -> String = {
val name: String =
if (rootProject.hasProperty("versionName")) {
rootProject.property("versionName") as String
} else if (localProperties.getProperty("versionName") != null) {
localProperties.getProperty("versionName") as String
} else {
throw Error(
"Version name was not found as a command line parameter or a local property",
)
}
println("VersionName is set to $name")
name
}
val versionCode: Int by rootProject.extra(
getVersionCode()
)
val versionName: String by rootProject.extra(
getVersionName()
)
val debugAppCheckToken: String by rootProject.extra(
try {
providers.gradleProperty("debugAppCheckToken").get()
} catch (e: org.gradle.api.internal.provider.MissingValueException) {
logger.warn("firebase debug token not found in gradle properties")
System.getenv("BUILD_DEBUG_APP_CHECK_TOKEN")
}
)
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.crashlytics) apply false
id("uk.gov.sonar.root-config")
}
setProperty("appId", "uk.gov.onelogin")
setProperty("compileSdkVersion", 34)
setProperty("configDir", "${rootProject.rootDir}/config")
setProperty("minSdkVersion", 29)
setProperty("targetSdkVersion", 34)
val jacocoVersion: String by rootProject.extra(
libs.versions.jacoco.get(),
)
fun setProperty(
key: String,
value: Any,
) {
rootProject.ext[key] = value
}
val composeVersion by project.extra("1.5.3")
val intentsVersion by project.extra("3.4.0")
val navigationVersion by project.extra("2.6.0")
apply(plugin = "lifecycle-base")
apply(plugin = "uk.gov.vale-config")