Skip to content

Commit

Permalink
Add floor_common to the .sh scripts, and add the getDatabasePath to d…
Browse files Browse the repository at this point in the history
…atabase_factory.dart
  • Loading branch information
hendrikvdkaaden committed Mar 22, 2024
1 parent 08821b3 commit 056977d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:

- name: Run generator
run: flutter packages pub run build_runner build --delete-conflicting-outputs
working-directory: floor
working-directory: floor_common

- name: Analyze
run: flutter analyze
Expand Down
8 changes: 8 additions & 0 deletions floor_common/test/test_util/database_factory.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:path/path.dart';
import 'package:sqflite_common/sqlite_api.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';

Expand All @@ -6,3 +7,10 @@ final DatabaseFactory sqfliteDatabaseFactory = () {
sqfliteFfiInit();
return databaseFactoryFfi;
}();

extension DatabaseFactoryExtension on DatabaseFactory {
Future<String> getDatabasePath(final String name) async {
final databasesPath = await this.getDatabasesPath();
return join(databasesPath, name);
}
}
2 changes: 1 addition & 1 deletion tool/generate_test_database.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cd ../floor
cd ../floor_common
flutter packages pub run build_runner build --delete-conflicting-outputs
4 changes: 4 additions & 0 deletions tool/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ cd floor
flutter packages pub upgrade
cd ..

cd floor_common
flutter packages pub upgrade
cd ..

cd floor_annotation
flutter packages pub upgrade
cd ..
Expand Down

0 comments on commit 056977d

Please sign in to comment.