-
Notifications
You must be signed in to change notification settings - Fork 287
/
Copy pathbuild.gradle.kts
175 lines (154 loc) · 5.66 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import io.getstream.chat.android.Configuration
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.androidx.baseline.profile)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.google.services)
}
apply(from = "$rootDir/scripts/android.gradle")
apply(from = "$rootDir/scripts/detekt-compose.gradle")
android {
namespace = "io.getstream.chat.android.compose.sample"
defaultConfig {
targetSdk = Configuration.sampleTargetSdk
applicationId = "io.getstream.chat.android.compose.sample"
versionCode = rootProject.extra.get("sampleAppVersionCode") as Int
versionName = rootProject.extra.get("sampleAppVersionName") as String
testInstrumentationRunner = "io.qameta.allure.android.runners.AllureAndroidJUnitRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
}
testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
val signFile = rootProject.file(".sign/keystore.properties")
if (signFile.exists()) {
val properties = Properties()
properties.load(FileInputStream(signFile))
signingConfigs {
create("release") {
keyAlias = properties["keyAlias"] as? String
keyPassword = properties["keyPassword"] as? String
storeFile = rootProject.file(properties["keystore"] as String)
storePassword = properties["storePassword"] as? String
}
}
} else {
signingConfigs {
create("release") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore")
storePassword = "android"
}
}
}
signingConfigs {
getByName("debug") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore")
storePassword = "android"
}
}
buildTypes {
getByName("debug") {
versionNameSuffix = "-DEBUG"
applicationIdSuffix = ".debug"
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
signingConfig = signingConfigs.getByName("debug")
buildConfigField("Boolean", "BENCHMARK", "false")
}
create("benchmark") {
isDebuggable = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
proguardFiles("benchmark-rules.pro")
buildConfigField("Boolean", "BENCHMARK", "true")
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
signingConfig = signingConfigs.getByName("release")
buildConfigField("Boolean", "BENCHMARK", "false")
}
}
flavorDimensions += "version"
productFlavors {
create("demo") {
dimension = "version"
}
create("e2e") {
dimension = "version"
applicationIdSuffix = ".e2etest"
}
}
buildFeatures {
compose = true
buildConfig = true
}
lint {
disable += "MissingTranslation"
}
}
androidComponents {
beforeVariants { variantBuilder ->
if (variantBuilder.buildType != "debug" &&
variantBuilder.productFlavors.any { it.second.contains("e2e") }
) {
variantBuilder.enable = false
}
}
}
tasks.withType<KotlinCompile> {
compilerOptions.freeCompilerArgs.addAll(
listOf(
"-opt-in=kotlin.RequiresOptIn",
),
)
}
dependencies {
implementation(project(":stream-chat-android-compose"))
implementation(project(":stream-chat-android-offline"))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.android.material)
implementation(libs.stream.push.firebase)
implementation(libs.stream.log)
// Compose
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.core)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.google.accompanist.permissions)
// Firebase
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics)
// Instrumentation tests
"e2eImplementation"(libs.okhttp)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.uiautomator)
androidTestImplementation(libs.androidx.test.junit.ktx)
androidTestImplementation(libs.androidx.test.monitor)
androidTestUtil(libs.androidx.test.orchestrator)
androidTestImplementation(libs.allure.kotlin.model)
androidTestImplementation(libs.allure.kotlin.junit4)
androidTestImplementation(libs.allure.kotlin.commons)
androidTestImplementation(libs.allure.kotlin.android)
androidTestImplementation(project(":stream-chat-android-e2e-test"))
detektPlugins(libs.detekt.formatting)
baselineProfile(project(":stream-chat-android-benchmark"))
}