build fix

This commit is contained in:
unknown 2022-03-16 12:33:45 +01:00
parent 551ed6ebdb
commit 1e9247652a
No known key found for this signature in database
GPG Key ID: 1D070E0B09CFB257
5 changed files with 23 additions and 7 deletions

2
.gitignore vendored
View File

@ -19,3 +19,5 @@ doc/api/
*.js_ *.js_
*.js.deps *.js.deps
*.js.map *.js.map
*.txt

View File

@ -13,7 +13,7 @@ if test -e /mnt/enc/keys/filc3.properties
set -x ANDROID_SIGNING /mnt/enc/keys/filc3.properties set -x ANDROID_SIGNING /mnt/enc/keys/filc3.properties
end end
flutter build apk --release --dart-define=APPVER=(get_version) flutter build apk --release --dart-define=APPVER=(get_version) --no-tree-shake-icons
cp -v "build/app/outputs/flutter-apk/app-release.apk" ~/"Desktop/hu.filc.naplo_"(get_version_bn).apk cp -v "build/app/outputs/flutter-apk/app-release.apk" ~/"Desktop/hu.filc.naplo_"(get_version_bn).apk
notify-send "Flutter" "Apk build done." notify-send "Flutter" "Apk build done."

View File

@ -31,8 +31,12 @@ Future<Database> initDB() async {
} }
// Migrate Databases // Migrate Databases
await migrateDB(db, "settings", settingsDB.struct.keys, SettingsProvider.defaultSettings().toMap(), createSettingsTable); try {
await migrateDB(db, "users", usersDB.struct.keys, {"role": 0}, createUsersTable); await migrateDB(db, "settings", settingsDB.struct.keys, SettingsProvider.defaultSettings().toMap(), createSettingsTable);
await migrateDB(db, "users", usersDB.struct.keys, {"role": 0}, createUsersTable);
} catch (error) {
print("ERROR: migrateDB: $error");
}
return db; return db;
} }
@ -80,12 +84,13 @@ Future<void> migrateDB(
List<Map<String, dynamic>> migrated = []; List<Map<String, dynamic>> migrated = [];
// go through each row and add missing keys or delete non existing keys
await Future.forEach<Map<String, Object?>>(originalRows, (original) async { await Future.forEach<Map<String, Object?>>(originalRows, (original) async {
bool migrationRequired = keys.any((key) => !original.containsKey(key) || original[key] == null); bool migrationRequired = keys.any((key) => !original.containsKey(key) || original[key] == null);
if (migrationRequired) { if (migrationRequired) {
print("INFO: Migrating $table"); print("INFO: Migrating $table");
var copy = Map<String, dynamic>.from(original); var copy = Map<String, Object?>.from(original);
// Fill missing columns // Fill missing columns
for (var key in keys) { for (var key in keys) {
@ -104,13 +109,14 @@ Future<void> migrateDB(
} }
}); });
// replace the old table with the migrated one
if (migrated.isNotEmpty) { if (migrated.isNotEmpty) {
// Delete table // Delete table
await db.execute("drop table $table"); await db.execute("drop table $table");
// Recreate table // Recreate table
await create(db); await create(db);
await Future.forEach(migrated, (Map<String, dynamic> copy) async { await Future.forEach(migrated, (Map<String, Object?> copy) async {
await db.insert(table, copy); await db.insert(table, copy);
}); });

View File

@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST}) foreach(plugin ${FLUTTER_PLUGIN_LIST})
@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>) list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin) endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

@ -1 +1 @@
Subproject commit 7190dd5d0b46a4f38cb502df6f90b8570fc83c7f Subproject commit 132581180c76fd10960abe49f073629e772cfc66