Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(aft): Package aft should not have pubspec_overrides.yaml #3733

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/aft/lib/src/commands/link_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,29 @@ Map<String, String> _collectDependencies(
return dependencyPaths;
}

/// Removes the `pubspec_overrides.yaml` file for [package].
Future<void> _removePubspecOverride(PackageInfo package) async {
final pubspecOverrides = File(
path.join(package.path, 'pubspec_overrides.yaml'),
);
if (await pubspecOverrides.exists()) {
await pubspecOverrides.delete();
}
}

/// Creates a `pubspec_overrides.yaml` file for [package].
Future<void> _createPubspecOverride(
PackageInfo package,
Map<String, String> dependencyPaths,
// To be merged in
Map<String, Dependency> existingDependencyOverrides,
) async {
// Unlike every other package, aft must work without pubspec_overrides.
// It's counter productive to generate it and its presence can interfere
// with local development.
if (package.name == 'aft') {
return _removePubspecOverride(package);
}
final mergedOverrides = SplayTreeMap.of({
// Merge in existing dependency overrides since `pub` will only use the
// pubspec_overrides file if it exists.
Expand Down