-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
84 lines (75 loc) · 2.86 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
plugins {
id("vkid.android.application.compose")
id("vkid.manifest.placeholders")
alias(libs.plugins.baselineprofile)
}
android {
namespace = "com.vk.id.sample.app"
defaultConfig {
applicationId = "com.vk.id.sample"
versionCode = generateVersionCode()
versionName = properties["VERSION_NAME"] as? String ?: "NO_VERSION"
setProperty("archivesBaseName", "vkid-${stringProperty("build.type")}-${stringProperty("build.number")}")
signingConfigs {
getByName("debug") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = file("config/debug.keystore")
storePassword = "android"
}
}
}
buildTypes {
release {
isMinifyEnabled = true
signingConfig = signingConfigs.findByName("debug")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
create("benchmark") {
initWith(getByName("release"))
matchingFallbacks.add("release")
signingConfig = signingConfigs.getByName("debug")
isShrinkResources = false
isMinifyEnabled = false
}
}
}
dependencies {
implementation(projects.sampleXml)
implementation(projects.sampleOldsdk)
implementation(projects.multibrandingCompose)
implementation(projects.multibrandingXml)
implementation(projects.onetapCompose)
implementation(projects.onetapXml)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.util)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.navigation.compose)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.okhttp3.okhttp)
implementation(libs.androidx.profileinstaller)
baselineProfile(projects.baselineProfile)
debugImplementation(libs.androidx.compose.ui.tooling)
val DEPEND_ON_VK_SDK: String by project
if (DEPEND_ON_VK_SDK == "true") {
implementation(libs.vk.sdk.core)
implementation(libs.vk.sdk.api)
}
}
fun generateVersionCode(): Int {
return TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()).toInt()
}
fun Project.stringProperty(key: String, default: String = ""): String {
var prop = (properties[key] as? String)?.takeIf { it.isNotEmpty() }
if (prop == null) {
prop = (rootProject.properties[key] as? String)?.takeIf { it.isNotEmpty() }
}
return prop ?: default
}