refactor(shorebird_code_push): upgrade analysis_options (#269)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include: package:very_good_analysis/analysis_options.5.0.0.yaml
|
||||
include: package:very_good_analysis/analysis_options.7.0.0.yaml
|
||||
|
||||
analyzer:
|
||||
exclude:
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/// Get info about your Shorebird code push app
|
||||
library shorebird_code_push;
|
||||
|
||||
export 'src/shorebird_updater.dart'
|
||||
show
|
||||
Patch,
|
||||
|
||||
@@ -54,6 +54,8 @@ class UpdateException implements Exception {
|
||||
/// Log message when the Shorebird updater is unavailable in the current
|
||||
/// environment.
|
||||
void logShorebirdEngineUnavailableMessage() {
|
||||
// Printing to the console is intentional here since we want it to be obvious
|
||||
// that the app is running in an environment where the updater is unavailable.
|
||||
// ignore: avoid_print
|
||||
print('''
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,6 +31,9 @@ class ShorebirdUpdaterImpl implements ShorebirdUpdater {
|
||||
// time the underlying Rust code could block getting the config lock.
|
||||
_updater.currentPatchNumber();
|
||||
_isAvailable = true;
|
||||
// We explicitly catch all errors and exceptions to ensure we notify users
|
||||
// when the Shorebird Updater is unavailable.
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (_) {
|
||||
logShorebirdEngineUnavailableMessage();
|
||||
_isAvailable = false;
|
||||
@@ -91,6 +94,8 @@ class ShorebirdUpdaterImpl implements ShorebirdUpdater {
|
||||
|
||||
try {
|
||||
result = await _run(() => _updater.update(track: track));
|
||||
// Explicitly catch all errors/exceptions to ensure we gracefully fallback.
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (_) {
|
||||
return _legacyFallback();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
||||
ffigen: ">=8.0.2 <17.0.0"
|
||||
mocktail: ^1.0.0
|
||||
test: ^1.19.2
|
||||
very_good_analysis: ">=6.0.0 <8.0.0"
|
||||
very_good_analysis: ^7.0.0
|
||||
|
||||
ffigen:
|
||||
output: "lib/src/generated/updater_bindings.g.dart"
|
||||
|
||||
Reference in New Issue
Block a user