Skip to content

Commit f24066d

Browse files
committed
updated to KTS from Groovey format and updated CBS version
1 parent 159be01 commit f24066d

File tree

10 files changed

+208
-199
lines changed

10 files changed

+208
-199
lines changed

couchbase-server/init-cbserver.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# used to start couchbase server - can't get around this as docker compose only allows you to start one command - so we have to start couchbase like the standard couchbase Dockerfile would
3-
# https://github.com/couchbase/docker/blob/master/enterprise/couchbase-server/7.1.1/Dockerfile#L88
3+
# https://github.com/couchbase/docker/blob/master/enterprise/couchbase-server/7.2.0/Dockerfile#L88
44

55
/entrypoint.sh couchbase-server &
66

@@ -17,9 +17,10 @@ if ! [ -f "$FILE" ]; then
1717
/opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1 \
1818
--cluster-username $COUCHBASE_ADMINISTRATOR_USERNAME \
1919
--cluster-password $COUCHBASE_ADMINISTRATOR_PASSWORD \
20-
--services data,index,query \
20+
--services data,index,query,eventing \
2121
--cluster-ramsize $COUCHBASE_RAM_SIZE \
2222
--cluster-index-ramsize $COUCHBASE_INDEX_RAM_SIZE \
23+
--cluster-eventing-ramsize $COUCHBASE_EVENTING_RAM_SIZE \
2324
--index-storage-setting default
2425

2526
sleep 2s

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
- COUCHBASE_RBAC_PASSWORD=P@$$w0rd
1717
- COUCHBASE_RBAC_NAME=admin
1818
- COUCHBASE_RAM_SIZE=2048
19+
- COUCHBASE_EVENTING_RAM_SIZE=512
1920
- COUCHBASE_INDEX_RAM_SIZE=512
2021
hostname: couchbase-server
2122
container_name: couchbase-server

src/app/build.gradle

Lines changed: 0 additions & 147 deletions
This file was deleted.

src/app/build.gradle.kts

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
}

src/app/src/main/java/com/couchbase/learningpath/InventoryApplication.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.couchbase.learningpath
22

33
import android.app.Application
44
import com.couchbase.learningpath.data.DatabaseManager
5-
import org.koin.android.BuildConfig
65
import org.koin.android.ext.koin.androidContext
76
import org.koin.android.ext.koin.androidLogger
87
import org.koin.core.context.GlobalContext

src/build.gradle

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)