Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ internal object ModuleArtifacts {
fun mainCore(version: String) = "$GROUP:main-core:$version"
fun mainRuntime(version: String) = "$GROUP:main-runtime:$version"
fun mainRuntimeStub(version: String) = "$GROUP:main-runtime-stub:$version"
private fun sqliteCore(version: String) = "$GROUP:sqlite-core:$version"
private fun sqliteRuntime(version: String) = "$GROUP:sqlite-runtime:$version"
private fun sqliteRuntimeStub(version: String) = "$GROUP:sqlite-runtime-stub:$version"
private fun sqliteRoomAdapter(version: String) = "$GROUP:sqlite-room-adapter:$version"
private fun sqliteRoomAdapterStub(version: String) = "$GROUP:sqlite-room-adapter-stub:$version"
private fun sqliteSqldelightAdapter(version: String) = "$GROUP:sqlite-sqldelight-adapter:$version"
private fun sqliteSqldelightAdapterStub(version: String) =
"$GROUP:sqlite-sqldelight-adapter-stub:$version"

fun runtimeArtifacts(module: KickModule, version: String): List<String> {
return when (module) {
Expand All @@ -23,15 +31,15 @@ internal object ModuleArtifacts {
KickModule.MultiplatformSettings -> listOf("$GROUP:multiplatform-settings:$version")
KickModule.Overlay -> listOf("$GROUP:overlay:$version")
KickModule.Room -> listOf(
"$GROUP:sqlite-core:$version",
"$GROUP:sqlite-runtime:$version",
"$GROUP:sqlite-room-adapter:$version"
sqliteCore(version),
sqliteRuntime(version),
sqliteRoomAdapter(version),
)
KickModule.Runner -> listOf("$GROUP:runner:$version")
KickModule.Sqldelight -> listOf(
"$GROUP:sqlite-core:$version",
"$GROUP:sqlite-runtime:$version",
"$GROUP:sqlite-sqldelight-adapter:$version"
sqliteCore(version),
sqliteRuntime(version),
sqliteSqldelightAdapter(version),
)
}
}
Expand All @@ -47,11 +55,16 @@ internal object ModuleArtifacts {
KickModule.Logging -> listOf("$GROUP:logging-stub:$version")
KickModule.MultiplatformSettings -> listOf("$GROUP:multiplatform-settings-stub:$version")
KickModule.Overlay -> listOf("$GROUP:overlay-stub:$version")
KickModule.Room -> listOf("$GROUP:sqlite-runtime-stub:$version", "$GROUP:sqlite-room-adapter-stub:$version")
KickModule.Room -> listOf(
sqliteCore(version),
sqliteRuntimeStub(version),
sqliteRoomAdapterStub(version),
)
KickModule.Runner -> listOf("$GROUP:runner-stub:$version")
KickModule.Sqldelight -> listOf(
"$GROUP:sqlite-runtime-stub:$version",
"$GROUP:sqlite-sqldelight-adapter-stub:$version"
sqliteCore(version),
sqliteRuntimeStub(version),
sqliteSqldelightAdapterStub(version),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ru.bartwell.kick.core.data.PlatformContext

@Suppress("EmptyFunctionBlock", "UNUSED_PARAMETER")
public class FirebaseAnalyticsModule(
context: PlatformContext,
platformContext: PlatformContext,
) : Module {

override val description: ModuleDescription = ModuleDescription.FIREBASE_ANALYTICS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.bartwell.kick.module.firebase.analytics.core.persist

import android.util.Log
import app.cash.sqldelight.async.coroutines.synchronous
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import ru.bartwell.kick.core.data.PlatformContext
Expand All @@ -17,6 +18,11 @@ internal actual class DatabaseBuilder {
context = appContext,
name = "kick_firebase_analytics.db"
)
runCatching {
FirebaseAnalyticsDb.Schema.synchronous().create(driver)
}.onFailure { throwable ->
Log.e("KickFirebaseAnalyticsDb", "Failed to create firebase analytics schema", throwable)
}
val db = FirebaseAnalyticsDb(
driver = driver,
analyticsEventAdapter = AnalyticsEvent.Adapter(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import kotlin.collections.Map;
import kotlin.String;

CREATE TABLE analyticsEvent (
CREATE TABLE IF NOT EXISTS analyticsEvent (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp INTEGER NOT NULL,
name TEXT NOT NULL,
Expand All @@ -17,7 +17,7 @@ INSERT INTO analyticsEvent (timestamp, name, params) VALUES (?, ?, ?);
deleteEvents:
DELETE FROM analyticsEvent;

CREATE TABLE userProperty (
CREATE TABLE IF NOT EXISTS userProperty (
name TEXT PRIMARY KEY NOT NULL,
value TEXT NOT NULL,
timestamp INTEGER NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import platform.UserNotifications.UNNotification
public fun FirebaseCloudMessagingAccessor.handleApnsPayload(userInfo: NSDictionary) {}

@Suppress("UnusedParameter", "EmptyFunctionBlock", "unused")
public fun FirebaseCloudMessagingAccessor.handleApnsPayload(userInfo: Map<Any?, *>) {}
public fun FirebaseCloudMessagingAccessor.handleApnsPayload(userInfo: Map<*, *>) {}

@Suppress("UnusedParameter", "EmptyFunctionBlock", "unused")
public fun FirebaseCloudMessagingAccessor.handleApnsNotification(notification: UNNotification) {}

@Suppress("UnusedParameter", "EmptyFunctionBlock", "unused")
public fun FirebaseCloudMessagingAccessor.setFcmToken(token: String?) {}

@Suppress("UnusedParameter", "EmptyFunctionBlock", "unused")
public fun FirebaseCloudMessagingAccessor.setFirebaseInstallationId(id: String?) {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.bartwell.kick.module.firebase.cloudmessaging.core.persist

import android.util.Log
import app.cash.sqldelight.async.coroutines.synchronous
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import ru.bartwell.kick.core.data.PlatformContext
Expand All @@ -17,6 +18,15 @@ internal actual class DatabaseBuilder {
context = appContext,
name = "kick_firebase_cloud_messaging.db",
)
runCatching {
FirebaseCloudMessagingDb.Schema.synchronous().create(driver)
}.onFailure { throwable ->
Log.e(
"KickFirebaseCloudMessagingDb",
"Failed to create firebase cloud messaging schema",
throwable,
)
}
val db = FirebaseCloudMessagingDb(
driver = driver,
fcmMessageAdapter = FcmMessage.Adapter(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import kotlin.collections.Map;
import kotlin.String;

CREATE TABLE fcmMessage (
CREATE TABLE IF NOT EXISTS fcmMessage (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
body TEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ru.bartwell.kick.core.data.get
import ru.bartwell.kick.module.logging.core.persist.adapter.logLevelAdapter
import ru.bartwell.kick.module.logging.db.Log
import ru.bartwell.kick.module.logging.db.LoggingDb
import android.util.Log as AndroidLog

@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
internal actual class DatabaseBuilder {
Expand All @@ -17,6 +18,11 @@ internal actual class DatabaseBuilder {
context = appContext,
name = "kick_logging.db"
)
runCatching {
LoggingDb.Schema.synchronous().create(driver)
}.onFailure { throwable ->
AndroidLog.e("KickLoggingDb", "Failed to create logging schema", throwable)
}
val db = LoggingDb(
driver = driver,
logAdapter = Log.Adapter(levelAdapter = logLevelAdapter)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ru.bartwell.kick.module.logging.core.data.LogLevel;

CREATE TABLE log (
CREATE TABLE IF NOT EXISTS log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
time INTEGER NOT NULL,
level TEXT AS LogLevel NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import kotlinx.coroutines.CoroutineScope
public interface OverlayProvider {
public val categories: Set<String>

public val isAvailable: Boolean

public fun start(scope: CoroutineScope)

public fun stop()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package ru.bartwell.kick.module.overlay.core.provider

import kotlinx.coroutines.CoroutineScope
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds

public class PerformanceOverlayProvider : OverlayProvider {
@Suppress("UnusedPrivateProperty")
public class PerformanceOverlayProvider(
private val updateIntervalMillis: Duration,
) : OverlayProvider {
override val categories: Set<String> = setOf(CATEGORY)
override val isAvailable: Boolean = true

public constructor() : this(1.seconds)

@Suppress("EmptyFunctionBlock")
override fun start(scope: CoroutineScope) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.bartwell.kick.module.ktor3.core.persist

import android.util.Log
import app.cash.sqldelight.async.coroutines.synchronous
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import ru.bartwell.kick.core.data.PlatformContext
Expand All @@ -17,6 +18,11 @@ internal actual class DatabaseBuilder {
context = appContext,
name = "kick_ktor3.db"
)
runCatching {
Ktor3Db.Schema.synchronous().create(driver)
}.onFailure { throwable ->
Log.e("KickKtor3Db", "Failed to create ktor3 schema", throwable)
}
val db = Ktor3Db(
driver = driver,
requestAdapter = Request.Adapter(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ru.bartwell.kick.module.ktor3.feature.list.data.HttpMethod;
import kotlin.Boolean;

CREATE TABLE request (
CREATE TABLE IF NOT EXISTS request (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp INTEGER NOT NULL,
method TEXT AS HttpMethod NOT NULL,
Expand Down