Skip to content

Commit 49c9b8f

Browse files
committed
Update sample app to Room 3.0.0
1 parent 5be772f commit 49c9b8f

11 files changed

Lines changed: 42 additions & 44 deletions

File tree

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ junit = "4.13.2"
66
junitVersion = "1.3.0"
77
espressoCore = "3.7.0"
88
activity = "1.13.0"
9-
room = "2.8.4"
9+
room = "3.0.0"
1010
ksp = "2.3.9"
1111
hilt = "2.59.2"
1212

@@ -16,9 +16,8 @@ androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "j
1616
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
1717
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
1818
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
19-
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
20-
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
21-
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
19+
room-compiler = { group = "androidx.room3", name = "room3-compiler", version.ref = "room" }
20+
room-runtime = { group = "androidx.room3", name = "room3-runtime", version.ref = "room" }
2221
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
2322
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
2423
hilt-core = { group = "com.google.dagger", name = "hilt-core", version.ref = "hilt" }
@@ -28,4 +27,4 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
2827
android-application = { id = "com.android.application", version.ref = "agp" }
2928
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
3029
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
31-
androidx-room = { id = "androidx.room", version.ref = "room" }
30+
androidx-room = { id = "androidx.room3", version.ref = "room" }

sample/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ dependencies {
5050
ksp(libs.hilt.compiler)
5151

5252
implementation(libs.room.runtime)
53-
implementation(libs.room.ktx)
5453
ksp(libs.room.compiler)
5554

5655
testImplementation(libs.junit)
5756
androidTestImplementation(libs.androidx.junit)
5857
androidTestImplementation(libs.androidx.espresso.core)
5958
}
6059

61-
room {
60+
room3 {
6261
schemaDirectory("$projectDir/schemas")
6362
}
6463

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/database/AppDatabase.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package jp.ntsk.room.schema.docs.sample.database
22

3-
import androidx.room.AutoMigration
4-
import androidx.room.Database
5-
import androidx.room.DeleteColumn
6-
import androidx.room.DeleteTable
7-
import androidx.room.RoomDatabase
8-
import androidx.room.migration.AutoMigrationSpec
3+
import androidx.room3.AutoMigration
4+
import androidx.room3.Database
5+
import androidx.room3.DeleteColumn
6+
import androidx.room3.DeleteTable
7+
import androidx.room3.RoomDatabase
8+
import androidx.room3.migration.AutoMigrationSpec
99
import jp.ntsk.room.schema.docs.sample.entity.ProfileEntity
1010
import jp.ntsk.room.schema.docs.sample.entity.SubTaskEntity
1111
import jp.ntsk.room.schema.docs.sample.entity.SubscriptionEntity

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/database/AppDatabaseFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package jp.ntsk.room.schema.docs.sample.database
22

33
import android.content.Context
4-
import androidx.room.Room
4+
import androidx.room3.Room
55
import dagger.hilt.android.qualifiers.ApplicationContext
66
import javax.inject.Inject
77

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/ProfileEntity.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.ForeignKey
6-
import androidx.room.Index
7-
import androidx.room.PrimaryKey
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.ForeignKey
6+
import androidx.room3.Index
7+
import androidx.room3.PrimaryKey
88

99
@Entity(
1010
tableName = "profiles",

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/SubTaskEntity.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.ForeignKey
6-
import androidx.room.Index
7-
import androidx.room.PrimaryKey
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.ForeignKey
6+
import androidx.room3.Index
7+
import androidx.room3.PrimaryKey
88

99
@Entity(
1010
tableName = "sub_tasks",

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/SubscriptionEntity.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.ForeignKey
6-
import androidx.room.Index
7-
import androidx.room.PrimaryKey
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.ForeignKey
6+
import androidx.room3.Index
7+
import androidx.room3.PrimaryKey
88

99
@Entity(
1010
tableName = "subscriptions",

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/TagEntity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.PrimaryKey
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.PrimaryKey
66

77
@Entity(tableName = "tag")
88
data class TagEntity(

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/TaskEntity.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.ForeignKey
6-
import androidx.room.Index
7-
import androidx.room.PrimaryKey
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.ForeignKey
6+
import androidx.room3.Index
7+
import androidx.room3.PrimaryKey
88

99
@Entity(
1010
tableName = "tasks",

sample/src/main/kotlin/jp/ntsk/room/schema/docs/sample/entity/TaskTagCrossRef.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package jp.ntsk.room.schema.docs.sample.entity
22

3-
import androidx.room.ColumnInfo
4-
import androidx.room.Entity
5-
import androidx.room.ForeignKey
6-
import androidx.room.Index
3+
import androidx.room3.ColumnInfo
4+
import androidx.room3.Entity
5+
import androidx.room3.ForeignKey
6+
import androidx.room3.Index
77

88
@Entity(
99
primaryKeys = ["task_id", "tag_id"],

0 commit comments

Comments
 (0)