Skip to content

Commit cf61e26

Browse files
authored
Bump up all the versions to latest and refactor when required (#313)
1 parent 5851657 commit cf61e26

32 files changed

+222
-178
lines changed

.editorconfig

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
# noinspection EditorConfigKeyCorrectness
12
[*.{kt,kts}]
2-
ktlint_code_style = android_studio
3+
ktlint_code_style = android_studio
4+
ktlint_function_naming_ignore_when_annotated_with=Composable

.idea/codeStyles/Project.xml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTACT_US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ To join the Kotlin Community Slack, [request access here](http://slack.kotlinlan
77
For direct assistance, please [reach out to Touchlab](https://go.touchlab.co/contactkamp) to discuss support options.
88

99
If you find any bugs or issues in with project, you can create an issue in
10-
the [GitHub repository](https://github.com/touchlab/KaMPKit), but please don't mistake it with general KMM helpline. You
10+
the [GitHub repository](https://github.com/touchlab/KaMPKit), but please don't mistake it with general KMP helpline. You
1111
can get answers for general questions in Slack.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
KaMP Kit started in early 2020 with the goal of helping developers interested in Kotlin Multiplatform (aka KMP) get started
1313
quickly with a great set of libraries and patterns. At the time, there were not many sample apps and getting started
14-
was not trivial. The KMM situation has improved considerably since then, and various barriers to entry have been
14+
was not trivial. The KMP situation has improved considerably since then, and various barriers to entry have been
1515
removed.
1616

1717
Whereas KaMP Kit started with the goal of being a minimal sample, we now intend it to be less "getting started" and
@@ -23,8 +23,8 @@ We updated `KaMPKit` to make sure of Touchlab's new [SKIE](https://skie.touchlab
2323

2424
> ## Subscribe!
2525
>
26-
> We build solutions that get teams started smoothly with Kotlin Multiplatform and ensure their success in production. Join our community to learn how your peers are adopting KMM.
27-
[Sign up here](https://go.touchlab.co/newsletter-gh)!
26+
> We build solutions that get teams started smoothly with Kotlin Multiplatform and ensure their success in production. Join our community to learn how your peers are adopting KMP.
27+
[Sign up here](https://form.typeform.com/to/MJTpmm?typeform-source=touchlab.co)!
2828

2929
## Getting Help
3030

@@ -47,7 +47,7 @@ KaMP Kit is designed to get you past that primary stumbling block. You should be
4747

4848
#### *Very Important Message!!!*
4949

50-
This kit exists because the info you may find from Google about KMM and KMP is likely to be outdated or conflicting with the config here. It is highly recommended that you reach out directly if you run into issues.
50+
This kit exists because the info you may find from Google about KMP is likely to be outdated or conflicting with the config here. It is highly recommended that you reach out directly if you run into issues.
5151

5252
### Audience
5353

app/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id("com.android.application")
3-
kotlin("android")
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
44
}
55

66
android {

app/src/main/kotlin/co/touchlab/kampkit/android/MainApp.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class MainApp : Application() {
2020
single<Context> { this@MainApp }
2121
viewModel { BreedViewModel(get(), get { parametersOf("BreedViewModel") }) }
2222
single<SharedPreferences> {
23-
get<Context>().getSharedPreferences("KAMPSTARTER_SETTINGS", Context.MODE_PRIVATE)
23+
get<Context>().getSharedPreferences(
24+
"KAMPSTARTER_SETTINGS",
25+
Context.MODE_PRIVATE
26+
)
2427
}
2528
single<AppInfo> { AndroidAppInfo }
2629
single {

app/src/main/kotlin/co/touchlab/kampkit/android/ui/Composables.kt

+9-10
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ import co.touchlab.kermit.Logger
4242
import kotlinx.coroutines.launch
4343

4444
@Composable
45-
fun MainScreen(
46-
viewModel: BreedViewModel,
47-
log: Logger
48-
) {
45+
fun MainScreen(viewModel: BreedViewModel, log: Logger) {
4946
val dogsState by viewModel.breedState.collectAsStateWithLifecycle()
5047
val scope = rememberCoroutineScope()
5148

@@ -97,7 +94,11 @@ fun MainScreenContent(
9794
}
9895
}
9996

100-
PullRefreshIndicator(dogsState.isLoading, refreshState, Modifier.align(Alignment.TopCenter))
97+
PullRefreshIndicator(
98+
dogsState.isLoading,
99+
refreshState,
100+
Modifier.align(Alignment.TopCenter)
101+
)
101102
}
102103
}
103104
}
@@ -129,10 +130,7 @@ fun Error(error: String) {
129130
}
130131

131132
@Composable
132-
fun Success(
133-
successData: List<Breed>,
134-
favoriteBreed: (Breed) -> Unit
135-
) {
133+
fun Success(successData: List<Breed>, favoriteBreed: (Breed) -> Unit) {
136134
DogList(breeds = successData, favoriteBreed)
137135
}
138136

@@ -167,7 +165,8 @@ fun FavoriteIcon(breed: Breed) {
167165
animationSpec = TweenSpec(
168166
durationMillis = 500,
169167
easing = FastOutSlowInEasing
170-
)
168+
),
169+
label = "CrossFadeFavoriteIcon"
171170
) { fav ->
172171
if (fav) {
173172
Image(

app/src/main/kotlin/co/touchlab/kampkit/android/ui/theme/Theme.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ private val LightColorPalette = lightColors(
2828
)
2929

3030
@Composable
31-
fun KaMPKitTheme(
32-
darkTheme: Boolean = isSystemInDarkTheme(),
33-
content: @Composable () -> Unit
34-
) {
31+
fun KaMPKitTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
3532
val colors = if (darkTheme) {
3633
DarkColorPalette
3734
} else {

build.gradle.kts

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
plugins {
22
alias(libs.plugins.ktlint) apply false
3+
alias(libs.plugins.kotlin.android) apply false
34
alias(libs.plugins.kotlin.multiplatform) apply false
45
alias(libs.plugins.sqlDelight) apply false
56
alias(libs.plugins.android.library) apply false
7+
alias(libs.plugins.android.application) apply false
68
alias(libs.plugins.kotlin.serialization) apply false
79
alias(libs.plugins.skie) apply false
8-
}
9-
10-
allprojects {
11-
repositories {
12-
google()
13-
mavenCentral()
14-
}
10+
alias(libs.plugins.cocoapods) apply false
1511
}
1612

1713
subprojects {
1814
apply(plugin = rootProject.libs.plugins.ktlint.get().pluginId)
1915

2016
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
21-
version.set("1.0.0")
17+
version.set("1.1.1")
2218
enableExperimentalRules.set(true)
2319
verbose.set(true)
2420
filter {
@@ -34,5 +30,5 @@ subprojects {
3430
}
3531

3632
tasks.register<Delete>("clean") {
37-
delete(rootProject.buildDir)
33+
delete(rootProject.layout.buildDirectory)
3834
}

docs/APP_BUILD.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Before you build the app you will require these items:
55

66
* JVM 17
7-
- Android SDK and the latest stable Android Studio (2022.3+) or IntelliJ(2023.2+)
7+
- Android SDK and the latest stable Android Studio (2023.1+) or IntelliJ(2023.3+)
88
- Mac with Xcode 14+ for the iOS build
99

1010
For more details, check out the [DETAILED_DEV_SETUP](DETAILED_DEV_SETUP.md) document.

docs/DETAILED_DEV_SETUP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Some alternative options, if desired:
1717
## Install the IDE(s)
1818

1919
You'll also need either Android Studio, IntelliJ, or both. Android Studio is an Android development
20-
focused skin of IntelliJ, which is more platform agnostic. There is a built-in KMM plugin in the
20+
focused skin of IntelliJ, which is more platform agnostic. There is a built-in KMP plugin in the
2121
Android Studio, which enables you to run and debug the iOS part of your application on iOS targets
2222
straight from Android Studio. IntelliJ IDEA has a newer Kotlin API platform and gets bugfixes
2323
sooner, but it has an older version of Android Gradle Plugin. If you don't have either, we recommend

docs/GENERAL_ARCHITECTURE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* [Structure of the Project](#Structure-of-the-Project)
66
* [Overall Architecture](#Overall-Architecture)
7-
* [Coroutines and Ktor](#Coroutines-and-Ktor)
7+
* [Kotlinx Coroutines](#kotlinx-Coroutines)
88
* [Libraries and Dependencies](#Libraries-and-Dependencies)
99
* [SKIE](#SKIE) - Swift-friendly API generator
1010
* [Kermit](#Kermit) - Logging

docs/IOS_PROJ_INTEGRATION.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ cocoapods {
3535
homepage = "https://github.com/touchlab/KaMPKit"
3636
framework {
3737
isStatic = false
38-
export(Deps.kermit)
39-
transitiveExport = true
38+
linkerOpts("-lsqlite3")
39+
export(libs.touchlab.kermit.simple)
4040
}
41+
extraSpecAttributes["swift_version"] = "\"5.0\"" // <- SKIE Needs this!
42+
podfile = project.file("../ios/Podfile")
4143
}
4244
```
4345
Note that you need to apply the `native.cocoapods` plugin.

gradle.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx3g
9+
org.gradle.jvmargs=-Xmx6g
1010
# AndroidX package structure to make it clearer which packages are bundled with the
1111
# Android operating system, and which are packaged with your app's APK
1212
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1313
android.useAndroidX=true
1414
# Kotlin code style for this project: "official" or "obsolete":
1515
kotlin.code.style=official
16-
# Tell the KMM plugin where the iOS project lives
16+
# Tell the KMP plugin where the iOS project lives
1717
xcodeproj=./ios
18+
org.gradle.caching=true
19+
org.gradle.parallel=true

gradle/libs.versions.toml

+18-16
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ targetSdk = "34"
55
compileSdk = "34"
66

77
# Dependencies
8-
kotlin = "1.9.10"
8+
kotlin = "1.9.22"
99

10-
android-gradle-plugin = "8.1.1"
11-
ktlint-gradle = "11.6.0"
10+
android-gradle-plugin = "8.2.2"
11+
ktlint-gradle = "12.1.0"
1212

13-
compose = "1.5.2"
14-
composeCompiler = "1.5.3"
13+
compose = "1.5.4"
14+
composeCompiler = "1.5.8"
1515

16-
android-desugaring = "2.0.3"
16+
android-desugaring = "2.0.4"
1717
androidx-core = "1.12.0"
1818
androidx-test-junit = "1.1.5"
19-
androidx-activity-compose = "1.7.2"
20-
androidx-lifecycle = "2.6.2"
19+
androidx-activity-compose = "1.8.2"
20+
androidx-lifecycle = "2.7.0"
2121

2222
junit = "4.13.2"
2323

2424
coroutines = "1.7.3"
25-
kotlinx-datetime = "0.4.1"
26-
ktor = "2.3.4"
25+
kotlinx-datetime = "0.5.0"
26+
ktor = "2.3.7"
2727

2828
robolectric = "4.10.3"
2929

30-
kermit = "2.0.1"
31-
skie = "0.5.0"
30+
kermit = "2.0.2"
31+
skie = "0.6.1"
3232

33-
koin = "3.5.0"
34-
multiplatformSettings = "1.0.0"
33+
koin = "3.5.3"
34+
multiplatformSettings = "1.1.1"
3535
turbine = "1.0.0"
36-
sqlDelight = "2.0.0"
36+
sqlDelight = "2.0.1"
3737

3838
[libraries]
3939
android-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "android-desugaring" }
@@ -78,7 +78,6 @@ sqlDelight-android = { module = "app.cash.sqldelight:android-driver", version.re
7878
sqlDelight-jvm = { module = "app.cash.sqldelight:sqlite-driver", version.ref = "sqlDelight" }
7979
sqlDelight-coroutinesExt = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqlDelight" }
8080
sqlDelight-native = { module = "app.cash.sqldelight:native-driver", version.ref = "sqlDelight" }
81-
sqlDelight-runtime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDelight" }
8281

8382
touchlab-kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
8483
touchlab-kermit-simple = { module = "co.touchlab:kermit-simple", version.ref = "kermit" }
@@ -89,11 +88,14 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl
8988

9089
[plugins]
9190
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint-gradle" }
91+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
9292
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
9393
sqlDelight = { id = "app.cash.sqldelight", version.ref = "sqlDelight" }
94+
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
9495
android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
9596
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
9697
skie = { id = "co.touchlab.skie", version.ref = "skie" }
98+
cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
9799

98100
[bundles]
99101
app-ui = [

gradle/wrapper/gradle-wrapper.jar

1.73 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+8-4
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -133,10 +130,13 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197197
done
198198
fi
199199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in

ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ EXTERNAL SOURCES:
1515
:path: "../shared/"
1616

1717
SPEC CHECKSUMS:
18-
shared: ea50f7840493e1a81d5081cf342309e93b0dfa57
18+
shared: 81394056467cc83be297c4a24cbe685ad921e677
1919
SwiftLint: c585ebd615d9520d7fbdbe151f527977b0534f1e
2020

2121
PODFILE CHECKSUM: 3130ca9ec3cd58f2c60cfe8a432d7d96d89938bf
2222

23-
COCOAPODS: 1.12.1
23+
COCOAPODS: 1.14.3

ios/Pods/Local Podspecs/shared.podspec.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/Pods/Manifest.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)