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
21 changes: 17 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@ fun getSigningSecret(entryName: String, propertyKey: String, envVar: String): St
}

android {
sourceSets {
// MigrationTestHelper reads the exported schemas from the test APK's assets.
getByName("androidTest").assets.srcDir("$projectDir/schemas")
}

namespace = "dev.arrase.geotify"
compileSdk = 37

defaultConfig {
applicationId = "dev.arrase.geotify"
minSdk = 24
targetSdk = 36
versionCode = 14
versionName = "1.0.0-beta.7"
versionCode = 15
versionName = "1.0.0-beta.8"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -103,6 +108,13 @@ ksp {
}

dependencies {
// room-testing's generated schema parser is compiled against the serialization 1.8.x API, so
// the whole build resolves to that version to satisfy Gradle's consistent resolution between
// the main and androidTest classpaths.
constraints {
add("implementation", "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1")
}

// Compose BOM
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
Expand All @@ -117,12 +129,11 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.navigation.compose)

// Hilt
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.hilt.lifecycle.viewmodel.compose)

// DataStore
implementation(libs.androidx.datastore.preferences)
Expand Down Expand Up @@ -156,10 +167,12 @@ dependencies {
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.room.testing)
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation(libs.androidx.compose.ui.tooling)
}


tasks.register<JacocoReport>("jacocoTestReport") {
dependsOn("testDebugUnitTest")
reports {
Expand Down
171 changes: 171 additions & 0 deletions app/schemas/dev.arrase.geotify.data.GeotifyDatabase/4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "9d831e611a5440fa11e057484fe587e8",
"entities": [
{
"tableName": "locations",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `alias` TEXT NOT NULL COLLATE NOCASE, `latitude` REAL NOT NULL, `longitude` REAL NOT NULL, `radius_meters` REAL NOT NULL, `notification_responsiveness_ms` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "latitude",
"columnName": "latitude",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "longitude",
"columnName": "longitude",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "radiusMeters",
"columnName": "radius_meters",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "notificationResponsivenessMs",
"columnName": "notification_responsiveness_ms",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_locations_alias",
"unique": true,
"columnNames": [
"alias"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_locations_alias` ON `${TABLE_NAME}` (`alias`)"
},
{
"name": "index_locations_latitude_longitude",
"unique": false,
"columnNames": [
"latitude",
"longitude"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_locations_latitude_longitude` ON `${TABLE_NAME}` (`latitude`, `longitude`)"
}
]
},
{
"tableName": "reminders",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `location_id` TEXT NOT NULL, `message` TEXT NOT NULL, `transition_type` INTEGER NOT NULL, `is_active` INTEGER NOT NULL, `created_at` INTEGER NOT NULL, `is_in_range` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`id`), FOREIGN KEY(`location_id`) REFERENCES `locations`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "locationId",
"columnName": "location_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "message",
"columnName": "message",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "transitionType",
"columnName": "transition_type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isActive",
"columnName": "is_active",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isInRange",
"columnName": "is_in_range",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_reminders_location_id",
"unique": false,
"columnNames": [
"location_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_reminders_location_id` ON `${TABLE_NAME}` (`location_id`)"
},
{
"name": "index_reminders_is_active_created_at",
"unique": false,
"columnNames": [
"is_active",
"created_at"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_reminders_is_active_created_at` ON `${TABLE_NAME}` (`is_active`, `created_at`)"
}
],
"foreignKeys": [
{
"table": "locations",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"location_id"
],
"referencedColumns": [
"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, '9d831e611a5440fa11e057484fe587e8')"
]
}
}
Loading
Loading