1
+ plugins {
2
+ id(" com.android.application" )
3
+ id(" org.jetbrains.kotlin.android" )
4
+ id(" org.jetbrains.kotlin.plugin.serialization" )
5
+ }
6
+ android {
7
+ compileSdk = 34
8
+
9
+ defaultConfig {
10
+ applicationId = " com.couchbase.kotlin.learningpath"
11
+ minSdk = 26
12
+ targetSdk = 34
13
+ versionCode = 1
14
+ versionName = " 1.1"
15
+
16
+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
17
+
18
+ // The following argument makes the Android Test Orchestrator run its
19
+ // "pm clear" command after each test invocation. This command ensures
20
+ // that the app's state is completely cleared between tests.
21
+ testInstrumentationRunnerArguments(mapOf (" clearPackageData" to " true" ))
22
+
23
+ vectorDrawables {
24
+ useSupportLibrary = true
25
+ }
26
+ }
27
+
28
+ signingConfigs {
29
+ // We use a bundled debug keystore, to allow debug builds from CI to be upgradable
30
+ getByName(" debug" ) {
31
+ storeFile = rootProject.file(" debug.keystore" )
32
+ storePassword = " android"
33
+ keyAlias = " androiddebugkey"
34
+ keyPassword = " android"
35
+ }
36
+ }
37
+ buildTypes {
38
+ getByName(" debug" ) {
39
+ signingConfig = signingConfigs.getByName(" debug" )
40
+ }
41
+ getByName(" release" ) {
42
+ isMinifyEnabled = false
43
+ proguardFiles(getDefaultProguardFile(" proguard-android-optimize.txt" ), " proguard-rules.pro" )
44
+ }
45
+ }
46
+ testOptions {
47
+ unitTests.isIncludeAndroidResources = true
48
+ }
49
+
50
+ kotlinOptions {
51
+ jvmTarget = " 1.8"
52
+ }
53
+
54
+ buildFeatures {
55
+ compose = true
56
+ buildConfig = true
57
+ }
58
+
59
+ composeOptions {
60
+ kotlinCompilerExtensionVersion = " 1.5.9"
61
+ }
62
+
63
+ packagingOptions {
64
+ resources.excludes.add(" /META-INF/{AL2.0,LGPL2.1}" )
65
+ }
66
+ namespace = " com.couchbase.learningpath"
67
+ }
68
+
69
+ dependencies {
70
+
71
+ // Gradle docs on Extra properties
72
+ // https://docs.gradle.org/current/userguide/kotlin_dsl.html#extra_properties
73
+ val kotlin_version: String by rootProject.extra
74
+ val core_ktx: String by rootProject.extra
75
+ val compose_version: String by rootProject.extra
76
+ val compose_ui_version: String by rootProject.extra
77
+ val activity_compose_version: String by rootProject.extra
78
+ val lifecyle_runtime_ktx_version: String by rootProject.extra
79
+ val koin_version: String by rootProject.extra
80
+ val android_materialdesign_version: String by rootProject.extra
81
+ val androidx_navigation_compose_version: String by rootProject.extra
82
+ val google_accompanist_version: String by rootProject.extra
83
+ val kotlinx_serialization_json: String by rootProject.extra
84
+ val constraints_compose_version: String by rootProject.extra
85
+ val annotation_experimental_version: String by rootProject.extra
86
+ val coroutines_tests_version: String by rootProject.extra
87
+
88
+ // couchbase
89
+ val couchbase_lite_version: String by rootProject.extra
90
+ // core serialization
91
+ implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_json " )
92
+
93
+ // core compose
94
+ implementation(" androidx.core:core-ktx:$core_ktx " )
95
+ implementation(" androidx.compose.ui:ui:$compose_ui_version " )
96
+
97
+ // Tooling support (Previews, etc.)
98
+ implementation(" androidx.compose.ui:ui-tooling:$compose_ui_version " )
99
+
100
+ // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
101
+ implementation(" androidx.compose.foundation:foundation:$compose_ui_version " )
102
+ implementation(" androidx.compose.foundation:foundation-layout:$compose_ui_version " )
103
+
104
+ // animation
105
+ implementation(" androidx.compose.animation:animation:$compose_ui_version " )
106
+
107
+ // Material design and icons
108
+ implementation(" androidx.compose.material:material:$compose_ui_version " )
109
+ implementation(" androidx.compose.material:material-icons-core:$compose_ui_version " )
110
+ implementation(" androidx.compose.material:material-icons-extended:$compose_ui_version " )
111
+ implementation(" com.google.android.material:material:$android_materialdesign_version " )
112
+
113
+ // lifecycle and integration with ViewModels
114
+ implementation(" androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecyle_runtime_ktx_version " )
115
+ implementation(" androidx.lifecycle:lifecycle-runtime-ktx:$lifecyle_runtime_ktx_version " )
116
+ implementation(" androidx.lifecycle:lifecycle-viewmodel-compose:$lifecyle_runtime_ktx_version " )
117
+ implementation(" androidx.lifecycle:lifecycle-livedata-ktx:$lifecyle_runtime_ktx_version " )
118
+
119
+ // Integration with observables
120
+ implementation(" androidx.compose.runtime:runtime-livedata:$compose_ui_version " )
121
+
122
+ // Integration with activities
123
+ implementation(" androidx.activity:activity-compose:$activity_compose_version " )
124
+
125
+ // Integration with constraints
126
+ implementation(" androidx.constraintlayout:constraintlayout-compose:$constraints_compose_version " )
127
+
128
+ // navigation
129
+ implementation(" androidx.navigation:navigation-compose:$androidx_navigation_compose_version " )
130
+
131
+ // fix for android versions older than 9 that won't load images https://github.com/google/accompanist
132
+ implementation(" com.google.accompanist:accompanist-drawablepainter:0.34.0" )
133
+ implementation(" com.google.accompanist:accompanist-insets:0.30.1" )
134
+
135
+ // Dependency injection
136
+ implementation(" io.insert-koin:koin-core:$koin_version " )
137
+ implementation(" io.insert-koin:koin-android:$koin_version " )
138
+ implementation(" io.insert-koin:koin-androidx-compose:$koin_version " )
139
+
140
+ // couchbase lite for kotlin
141
+ implementation(" com.couchbase.lite:couchbase-lite-android-ktx:$couchbase_lite_version " )
142
+
143
+ // required because some flow APIs are still experimental (Card's onclick and cblite flow)
144
+ implementation(" androidx.annotation:annotation-experimental:$annotation_experimental_version " )
145
+
146
+ testImplementation(" junit:junit:4.13.2" )
147
+ testImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3" )
148
+ androidTestImplementation(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3" )
149
+ androidTestImplementation(" androidx.test.ext:junit:1.1.5" )
150
+ androidTestImplementation(" androidx.test.espresso:espresso-core:3.5.1" )
151
+ androidTestImplementation(" androidx.compose.ui:ui-test-junit4:$compose_ui_version " )
152
+ androidTestImplementation(" androidx.test:runner:1.5.2" )
153
+ androidTestUtil(" androidx.test:orchestrator:1.4.2" )
154
+ debugImplementation(" androidx.compose.ui:ui-tooling:$compose_ui_version " )
155
+ debugImplementation(" androidx.compose.ui:ui-test-manifest:$compose_ui_version " )
156
+ }
0 commit comments