Build build storage backup lib within AOSP

This removes the AAR binary from the repo as it isn't needed anymore. Also room schema migrations will need to be one manually in the future as schema export doesn't seem to work in AOSP.
This commit is contained in:
Torsten Grote 2021-10-08 11:17:40 -03:00 committed by Chirayu Desai
parent 5662409ef5
commit 97398f1c5c
9 changed files with 37 additions and 145 deletions

View file

@ -32,11 +32,8 @@ android_app {
"androidx.lifecycle_lifecycle-livedata-ktx",
"androidx-constraintlayout_constraintlayout",
"com.google.android.material_material",
// storage
"seedvault-lib-storage", // did not manage to add this as transitive dependency
"seedvault-lib-tink-android",
"androidx.room_room-runtime",
"libprotobuf-java-lite",
// storage backup lib
"seedvault-lib-storage",
// koin
"seedvault-lib-koin-core-jvm", // did not manage to add this as transitive dependency
"seedvault-lib-koin-android",

View file

@ -112,7 +112,6 @@ dependencies {
* Storage Dependencies
*/
implementation project(':storage:lib')
// implementation fileTree(include: ['storage.aar'], dir: "${rootProject.rootDir}/storage/lib/libs")
/**
* External Dependencies

View file

@ -1,2 +1 @@
build/*
!build/outputs/aar/lib-release.aar

View file

@ -1,11 +1,38 @@
android_library_import {
android_library {
name: "seedvault-lib-storage",
aars: ["libs/storage.aar"],
sdk_version: "current",
srcs: [
"src/main/java/**/*.kt",
"src/main/java/**/*.java",
"src/main/proto/*.proto",
],
resource_dirs: [
"src/main/res",
],
proto: {
type: "lite",
local_include_dirs: ["src/main/proto"],
},
static_libs: [
"seedvault-lib-tink-android",
"libprotobuf-java-lite",
"androidx.core_core-ktx",
"androidx.documentfile_documentfile",
"androidx.lifecycle_lifecycle-viewmodel-ktx",
"androidx.room_room-runtime",
"androidx-constraintlayout_constraintlayout",
"com.google.android.material_material",
]
],
plugins: [
"androidx.room_room-compiler-plugin",
],
manifest: "src/main/AndroidManifest.xml",
optimize: {
enabled: false,
},
kotlincflags: [
"-Xopt-in=kotlin.RequiresOptIn",
],
}
java_import {

View file

@ -19,11 +19,6 @@ android {
testInstrumentationRunnerArguments disableAnalytics: 'true'
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {

View file

@ -1 +0,0 @@
../build/outputs/aar/lib-release.aar

View file

@ -1,128 +0,0 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "6286a22113131a780d1a28ba059d5a6d",
"entities": [
{
"tableName": "StoredUri",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "CachedFile",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `size` INTEGER NOT NULL, `last_modified` INTEGER, `generation_modified` INTEGER, `chunks` TEXT NOT NULL, `zip_index` INTEGER, `last_seen` INTEGER NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "size",
"columnName": "size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "lastModified",
"columnName": "last_modified",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "generationModified",
"columnName": "generation_modified",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "chunks",
"columnName": "chunks",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "zipIndex",
"columnName": "zip_index",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "lastSeen",
"columnName": "last_seen",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "CachedChunk",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `ref_count` INTEGER NOT NULL, `size` INTEGER NOT NULL, `version` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "refCount",
"columnName": "ref_count",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "size",
"columnName": "size",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"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, '6286a22113131a780d1a28ba059d5a6d')"
]
}
}

View file

@ -8,7 +8,11 @@ import androidx.room.TypeConverters
internal const val DB_MAX_OP = 750
@Database(entities = [StoredUri::class, CachedFile::class, CachedChunk::class], version = 1)
@Database(
version = 1,
exportSchema = false,
entities = [StoredUri::class, CachedFile::class, CachedChunk::class],
)
@TypeConverters(Converters::class)
internal abstract class Db : RoomDatabase() {
abstract fun getUriStore(): UriStore