-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle.kts
148 lines (128 loc) · 4.97 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
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
@Suppress("PropertyName")
val VERSION_NAME="3.3.0"
@Suppress("PropertyName")
val VERSION_CODE=28
val useFpProDebugVersion =
false // switch to true when needed to debug the locally built library
val fingerprintProLib = if (useFpProDebugVersion) libs.fingerprint.pro.debug else libs.fingerprint.pro.asProvider()
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.jetbrains.kotlin.compose)
alias(libs.plugins.jetbrains.kotlin.serialization)
alias(libs.plugins.jetbrains.kotlin.kapt)
}
android {
namespace = "com.fingerprintjs.android.fpjs_pro_demo"
compileSdk = 34
externalNativeBuild {
cmake {
path = File("src/main/cpp/CMakeLists.txt")
}
}
defaultConfig {
applicationId = "com.fingerprintjs.android.fpjs_pro_demo"
minSdk = 21
targetSdk = 34
versionCode = VERSION_CODE
versionName = VERSION_NAME
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
buildConfigField("String", "SDK_VERSION_NAME", "\"${fingerprintProLib.get().versionConstraint.requiredVersion}\"")
}
signingConfigs {
create("release") {
storeFile = file("release.jks")
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("RELEASE_SIGN_KEY_ALIAS")
keyPassword = System.getenv("RELEASE_SIGN_KEY_PASSWORD")
}
}
buildTypes {
// Default build type, debug symbols are enabled, minification is disabled,
// includes an option of mocking responses of Fingerprint's servers.
debug {
buildConfigField("boolean", "ALLOW_MOCKS", "true")
}
// Production release build variant
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("release")
buildConfigField("boolean", "ALLOW_MOCKS", "false")
}
// Use this build variant for testing the app locally with minification enabled and release
// level of performance, but also with the mocking functionality that the debug build type has.
create("debugOptimized") {
isMinifyEnabled = true
proguardFiles (getDefaultProguardFile ("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
buildConfigField("boolean", "ALLOW_MOCKS", "true")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
applicationVariants.all {
val variant = this
this.outputs.all {
(this as? BaseVariantOutputImpl)?.outputFileName = "FPJS-Pro-Playground-${variant.name}-${variant.versionName}.apk"
}
}
}
dependencies {
//core
implementation(libs.androidx.ktx.core)
implementation(libs.androidx.naviation.compose)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.core.splashscreen)
//compose
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material.icons)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.preview)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.animation)
//shimmer
implementation(libs.valentinilk.compose.shimmer)
//network
implementation(libs.squareup.okHttp3)
//kotlin
implementation(libs.michaelbull.kotlin.result)
implementation(libs.michaelbull.kotlin.result.coroutine)
implementation(libs.jetbrains.kotlinx.serialization.json)
//di
implementation(libs.google.dagger)
kapt(libs.google.dagger.compiler)
//security
implementation(libs.androidx.security.crypto)
implementation(fingerprintProLib)
//testing
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.junit.ext)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}