diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 64a912d..398a85e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,6 +6,11 @@ plugins { alias(libs.plugins.android) alias(libs.plugins.kotlinAndroid) alias(libs.plugins.ksp) + base +} + +base { + archivesName.set("calculator") } val keystorePropertiesFile: File = rootProject.file("keystore.properties") @@ -23,7 +28,9 @@ android { targetSdk = project.libs.versions.app.build.targetSDK.get().toInt() versionName = project.libs.versions.app.version.versionName.get() versionCode = project.libs.versions.app.version.versionCode.get().toInt() - setProperty("archivesBaseName", "calculator") + ksp { + arg("room.schemaLocation", "$projectDir/schemas") + } } signingConfigs { diff --git a/app/schemas/com.simplemobiletools.calculator.databases.CalculatorDatabase/1.json b/app/schemas/com.simplemobiletools.calculator.databases.CalculatorDatabase/1.json new file mode 100644 index 0000000..5feb3df --- /dev/null +++ b/app/schemas/com.simplemobiletools.calculator.databases.CalculatorDatabase/1.json @@ -0,0 +1,62 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "847fbacc72515e2c4dc9985eefeb45f9", + "entities": [ + { + "tableName": "history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `formula` TEXT NOT NULL, `result` TEXT NOT NULL, `timestamp` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "formula", + "columnName": "formula", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "result", + "columnName": "result", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_history_id", + "unique": true, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_history_id` ON `${TABLE_NAME}` (`id`)" + } + ], + "foreignKeys": [] + } + ], + "views": [], + "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, '847fbacc72515e2c4dc9985eefeb45f9')" + ] + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3ecd7f4..269b416 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip