It is now safe to call getBuildMode().release (#163712)

... because this function is no longer called in a context where it
_isn't_ safe. Yay!
This commit is contained in:
Matan Lurey 2025-02-20 07:38:55 -08:00 committed by GitHub
parent 90d7ced2e7
commit 47640aa0e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1963,17 +1963,9 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
return;
}
releaseMode ??= getBuildMode().isRelease;
await project.regeneratePlatformSpecificTooling(
// TODO(matanlurey): Move this up, i.e. releaseMode ??= getBuildMode().release.
//
// As it stands, this is a breaking change until https://github.com/flutter/flutter/issues/162704 is
// implemented, as the build_ios_framework command (and similar) will start querying
// for getBuildMode(), causing an error (meta-build commands like build ios-framework do not have
// a single build mode). Once ios-framework and macos-framework are migrated, then this can be
// cleaned up.
releaseMode:
featureFlags.isExplicitPackageDependenciesEnabled &&
(releaseMode ?? getBuildMode().isRelease),
releaseMode: featureFlags.isExplicitPackageDependenciesEnabled && releaseMode,
);
}