diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f40828d..b82f87c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.compose.compiler) alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.ksp) } android { @@ -86,7 +87,7 @@ dependencies { // Room implementation(libs.androidx.room.runtime) implementation(libs.androidx.room.ktx) - annotationProcessor(libs.androidx.room.compiler) + ksp(libs.androidx.room.compiler) // DataStore implementation(libs.androidx.datastore.preferences) diff --git a/app/src/main/java/com/example/esp32aldldashboard/AldlApplication.kt b/app/src/main/java/com/example/esp32aldldashboard/AldlApplication.kt index 09d881b..b222eb2 100644 --- a/app/src/main/java/com/example/esp32aldldashboard/AldlApplication.kt +++ b/app/src/main/java/com/example/esp32aldldashboard/AldlApplication.kt @@ -4,19 +4,21 @@ import android.app.Application import com.example.esp32aldldashboard.bluetooth.BluetoothService import com.example.esp32aldldashboard.repository.SettingsRepository import com.example.esp32aldldashboard.repository.TelemetryRepository +import com.example.esp32aldldashboard.logging.CsvLogger +import com.example.esp32aldldashboard.data.database.TelemetryDatabase class AldlApplication : Application() { lateinit var bluetoothService: BluetoothService lateinit var telemetryRepository: TelemetryRepository lateinit var settingsRepository: SettingsRepository - lateinit var csvLogger: com.example.esp32aldldashboard.logging.CsvLogger + lateinit var csvLogger: CsvLogger override fun onCreate() { super.onCreate() - val database = com.example.esp32aldldashboard.data.database.TelemetryDatabase.getDatabase(this) + val database = TelemetryDatabase.getDatabase(this) settingsRepository = SettingsRepository(this) - csvLogger = com.example.esp32aldldashboard.logging.CsvLogger(this) + csvLogger = CsvLogger(this) bluetoothService = BluetoothService(this) telemetryRepository = TelemetryRepository( bluetoothService, diff --git a/app/src/main/java/com/example/esp32aldldashboard/data/database/TelemetryDao.kt b/app/src/main/java/com/example/esp32aldldashboard/data/database/TelemetryDao.kt index 102d191..2cbc0c0 100644 --- a/app/src/main/java/com/example/esp32aldldashboard/data/database/TelemetryDao.kt +++ b/app/src/main/java/com/example/esp32aldldashboard/data/database/TelemetryDao.kt @@ -5,17 +5,20 @@ import androidx.room.Insert import androidx.room.Query import kotlinx.coroutines.flow.Flow +import kotlin.jvm.JvmSuppressWildcards + @Dao +@JvmSuppressWildcards interface TelemetryDao { @Insert suspend fun insertSession(session: SessionEntity): Long @Query("UPDATE sessions SET endTime = :endTime WHERE id = :sessionId") - suspend fun endSession(sessionId: Long, endTime: Long) + suspend fun endSession(sessionId: Long, endTime: Long): Int @Insert - suspend fun insertDataPoints(dataPoints: List) + suspend fun insertDataPoints(dataPoints: List): List @Query("SELECT * FROM sessions ORDER BY startTime DESC") fun getAllSessions(): Flow> @@ -24,5 +27,5 @@ interface TelemetryDao { fun getSessionData(sessionId: Long): Flow> @Query("DELETE FROM sessions WHERE id = :sessionId") - suspend fun deleteSession(sessionId: Long) + suspend fun deleteSession(sessionId: Long): Int } diff --git a/build.gradle.kts b/build.gradle.kts index bb92a46..9903cc3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,4 +3,5 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.kotlin.serialization) apply false + alias(libs.plugins.ksp) apply false } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 32d72a9..419e240 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,3 +27,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true +android.disallowKotlinSourceSets=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8616f5b..99f7125 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,11 +10,12 @@ androidxTestRunner = "1.7.0" androidxTestEspresso = "3.7.0" coroutines = "1.10.2" junit = "4.13.2" -kotlin = "2.3.20" +kotlin = "2.1.0" nav3Core = "1.0.1" lifecycleViewmodelNav3 = "2.10.0" room = "2.6.1" datastore = "1.1.1" +ksp = "2.1.0-1.0.29" [libraries] androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } @@ -47,4 +48,5 @@ androidx-datastore-preferences = { module = "androidx.datastore:datastore-prefer [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } \ No newline at end of file +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } \ No newline at end of file diff --git a/ksp_versions.xml b/ksp_versions.xml new file mode 100644 index 0000000..0b3839f --- /dev/null +++ b/ksp_versions.xml @@ -0,0 +1,169 @@ + + + com.google.devtools.ksp + com.google.devtools.ksp.gradle.plugin + + 2.3.9 + 2.3.9 + + 1.5.21-1.0.0-beta07 + 1.5.30-1.0.0-beta08 + 1.5.30-1.0.0-beta09 + 1.5.30-1.0.0 + 1.5.31-1.0.0 + 1.5.31-1.0.1 + 1.6.0-M1-1.0.0 + 1.6.0-RC-1.0.1-RC + 1.6.0-RC-1.0.0 + 1.6.0-1.0.1 + 1.6.0-1.0.2 + 1.6.10-RC-1.0.1 + 1.6.10-1.0.2 + 1.6.10-1.0.3 + 1.6.10-1.0.4 + 1.6.20-M1-1.0.2 + 1.6.20-RC-1.0.4 + 1.6.20-RC2-1.0.4 + 1.6.20-1.0.4 + 1.6.20-1.0.5 + 1.6.21-1.0.5 + 1.6.21-1.0.6 + 1.7.0-Beta-1.0.5 + 1.7.0-RC-1.0.5 + 1.7.0-RC2-1.0.5 + 1.7.0-1.0.6 + 1.7.10-1.0.6 + 1.7.20-Beta-1.0.6 + 1.7.20-RC-1.0.6 + 1.7.20-1.0.6 + 1.7.20-1.0.7 + 1.7.20-1.0.8 + 1.7.21-1.0.8 + 1.7.22-1.0.8 + 1.8.0-Beta-1.0.8 + 1.8.0-RC-1.0.8 + 1.8.0-RC2-1.0.8 + 1.8.0-1.0.8 + 1.8.0-1.0.9 + 1.8.10-1.0.9 + 1.8.20-Beta-1.0.9 + 1.8.20-RC-1.0.9 + 1.8.20-RC2-1.0.9 + 1.8.20-1.0.10 + 1.8.20-1.0.11 + 1.8.21-1.0.11 + 1.8.22-1.0.11 + 1.9.0-Beta-1.0.11 + 1.9.0-RC-1.0.11 + 1.9.0-1.0.11 + 1.9.0-1.0.12 + 1.9.0-1.0.13 + 1.9.10-1.0.13 + 1.9.20-Beta-1.0.13 + 1.9.20-Beta2-1.0.13 + 1.9.20-RC-1.0.13 + 1.9.20-RC2-1.0.13 + 1.9.20-1.0.13 + 1.9.20-1.0.14 + 1.9.21-1.0.15 + 1.9.21-1.0.16 + 1.9.22-1.0.16 + 1.9.22-1.0.17 + 1.9.22-1.0.18 + 1.9.23-1.0.19 + 1.9.23-1.0.20 + 1.9.24-1.0.20 + 1.9.25-1.0.20 + 2.0.0-Beta1-1.0.15 + 2.0.0-Beta1-1.0.14 + 2.0.0-Beta2-1.0.16 + 2.0.0-Beta3-1.0.17 + 2.0.0-Beta4-1.0.19 + 2.0.0-Beta4-1.0.18 + 2.0.0-Beta4-1.0.17 + 2.0.0-Beta5-1.0.20 + 2.0.0-Beta5-1.0.19 + 2.0.0-RC1-1.0.20 + 2.0.0-RC2-1.0.20 + 2.0.0-RC3-1.0.20 + 2.0.0-1.0.21 + 2.0.0-1.0.22 + 2.0.0-1.0.23 + 2.0.0-1.0.24 + 2.0.10-RC-1.0.23 + 2.0.10-RC2-1.0.24 + 2.0.10-1.0.24 + 2.0.20-Beta1-1.0.22 + 2.0.20-Beta2-1.0.23 + 2.0.20-RC-1.0.24 + 2.0.20-RC2-1.0.24 + 2.0.20-1.0.24 + 2.0.20-1.0.25 + 2.0.21-RC-1.0.25 + 2.0.21-1.0.25 + 2.0.21-1.0.26 + 2.0.21-1.0.27 + 2.0.21-1.0.28 + 2.1.0-Beta1-1.0.25 + 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