Skip to content

Commit 960cdef

Browse files
authored
Enable Kotlin and upgrade Java compile/target version for utils
1 parent b546422 commit 960cdef

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

app/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
plugins {
2+
alias(libs.plugins.kotlin.android)
3+
}
14
apply plugin: 'com.android.application'
25
apply plugin: 'org.ajoberstar.grgit'
36

@@ -32,6 +35,9 @@ android {
3235
sourceCompatibility = JavaVersion.VERSION_17
3336
targetCompatibility = JavaVersion.VERSION_17
3437
}
38+
kotlinOptions {
39+
jvmTarget = '17'
40+
}
3541
}
3642

3743
dependencies {
@@ -56,6 +62,8 @@ dependencies {
5662

5763
// Room components
5864
implementation(libs.androidx.room.runtime)
65+
implementation libs.androidx.core.ktx
66+
implementation libs.androidx.lifecycle.viewmodel.ktx
5967
annotationProcessor(libs.androidx.room.compiler)
6068
androidTestImplementation(libs.androidx.room.testing)
6169

gradle/libs.versions.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ lifecycleExtensions = "2.2.0"
1414
room = "2.4.2"
1515
androidXJunit = "1.1.3"
1616
androidXEspresso = "3.4.0"
17+
coreKtx = "1.15.0"
18+
lifecycleViewmodelKtx = "2.2.0"
19+
kotlin = "2.1.10"
1720

1821
[libraries]
1922
elimu-model = { group = "com.github.elimu-ai", name = "model", version.ref = "elimuModel" }
@@ -35,5 +38,8 @@ androidx-espresso = { group = "androidx.test.espresso", name = "espresso-core",
3538
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
3639
retrofit-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit" }
3740
junit = { group = "junit", name = "junit", version.ref = "junit" }
41+
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
42+
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
3843

3944
[plugins]
45+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

utils/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'com.android.library'
33
id 'maven-publish'
4+
alias(libs.plugins.kotlin.android)
45
}
56

67
android {
@@ -21,14 +22,18 @@ android {
2122
}
2223
}
2324
compileOptions {
24-
sourceCompatibility JavaVersion.VERSION_11
25-
targetCompatibility JavaVersion.VERSION_11
25+
sourceCompatibility JavaVersion.VERSION_17
26+
targetCompatibility JavaVersion.VERSION_17
27+
}
28+
kotlinOptions {
29+
jvmTarget = '17'
2630
}
2731
}
2832

2933
dependencies {
3034
implementation(libs.elimu.model) // See https://jitpack.io/#elimu-ai/model
31-
implementation(libs.elimu.analytics) // See https://jitpack.io/#elimu-ai/analytics
35+
implementation(libs.elimu.analytics)
36+
implementation libs.androidx.core.ktx// See https://jitpack.io/#elimu-ai/analytics
3237
}
3338

3439
// See https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html

0 commit comments

Comments
 (0)