Skip to content

Commit

Permalink
Update Room version, re-enable Room plugin, move AGP to the end of pl…
Browse files Browse the repository at this point in the history
…ugin list as a workaround to CMP-5835
  • Loading branch information
zsmb13 committed Sep 6, 2024
1 parent 9285c64 commit eb7042f
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 10 deletions.
14 changes: 5 additions & 9 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.kotlinx.serialization)
id("com.android.library")
alias(libs.plugins.ksp)
alias(libs.plugins.skie)
// alias(libs.plugins.room)
alias(libs.plugins.room)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
id("com.android.library")
}

kotlin {
Expand Down Expand Up @@ -102,10 +102,6 @@ kotlin {
}
}

//kotlin.sourceSets.all {
// languageSettings.optIn("kotlin.experimental.ExperimentalObjCName")
//}

skie {
features {
enableSwiftUIObservingPreview = true
Expand All @@ -120,6 +116,6 @@ dependencies {
add("kspJvm", libs.androidx.room.compiler)
}

//room {
// schemaDirectory("$projectDir/schemas")
//}
room {
schemaDirectory("$projectDir/schemas")
}
173 changes: 173 additions & 0 deletions common/schemas/dev.johnoreilly.common.database.AppDatabase/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "1d6755f9cf99963261ab91735a13f1a9",
"entities": [
{
"tableName": "Team",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `index` INTEGER NOT NULL, `name` TEXT NOT NULL, `code` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "index",
"columnName": "index",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "code",
"columnName": "code",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "Player",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `team` TEXT NOT NULL, `photoUrl` TEXT NOT NULL, `points` INTEGER NOT NULL, `currentPrice` REAL NOT NULL, `goalsScored` INTEGER NOT NULL, `assists` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "team",
"columnName": "team",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "photoUrl",
"columnName": "photoUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "points",
"columnName": "points",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "currentPrice",
"columnName": "currentPrice",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "goalsScored",
"columnName": "goalsScored",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "assists",
"columnName": "assists",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "GameFixture",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `localKickoffTime` TEXT NOT NULL, `homeTeam` TEXT NOT NULL, `awayTeam` TEXT NOT NULL, `homeTeamPhotoUrl` TEXT NOT NULL, `awayTeamPhotoUrl` TEXT NOT NULL, `homeTeamScore` INTEGER, `awayTeamScore` INTEGER, `event` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localKickoffTime",
"columnName": "localKickoffTime",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "homeTeam",
"columnName": "homeTeam",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "awayTeam",
"columnName": "awayTeam",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "homeTeamPhotoUrl",
"columnName": "homeTeamPhotoUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "awayTeamPhotoUrl",
"columnName": "awayTeamPhotoUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "homeTeamScore",
"columnName": "homeTeamScore",
"affinity": "INTEGER"
},
{
"fieldPath": "awayTeamScore",
"columnName": "awayTeamScore",
"affinity": "INTEGER"
},
{
"fieldPath": "event",
"columnName": "event",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '1d6755f9cf99963261ab91735a13f1a9')"
]
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ androidxActivity = "1.9.1"
androidxComposeBom = "2024.06.00"
androidxNavigationCompose = "2.8.0-beta06"
androidxLifecycle = "2.8.4"
androidxRoom = "2.7.0-alpha06"
androidxRoom = "2.7.0-alpha07"
sqlite = "2.5.0-SNAPSHOT"
compose-plugin = "1.6.11"
accompanist = "0.32.0"
Expand Down

0 comments on commit eb7042f

Please sign in to comment.