Skip to content

Commit 5332e69

Browse files
authored
Migrate generate_synthetic_packages_test.dart to explicit-package-dependencies. (#160267)
Work towards flutter/flutter#160257. Unlike some of the other PRs, this test explicitly _opts-out_ of the flag, as the test itself is testing whether the now deprecated feature works.
1 parent 47403e3 commit 5332e69

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/flutter_tools/test/general.shard/dart/generate_synthetic_packages_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ import '../../src/fakes.dart';
2121
import '../../src/test_build_system.dart';
2222

2323
void main() {
24+
// TODO(matanlurey): Remove after support for flutter_gen is removed.
25+
// See https://github.com/flutter/flutter/issues/102983 for details.
26+
FeatureFlags disableExplicitPackageDependencies() {
27+
// ignore: avoid_redundant_argument_values
28+
return TestFeatureFlags(isExplicitPackageDependenciesEnabled: false);
29+
}
30+
2431
testUsingContext('calls buildSystem.build with blank l10n.yaml file', () async {
2532
// Project directory setup for gen_l10n logic
2633
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
@@ -68,6 +75,8 @@ void main() {
6875
),
6976
);
7077
await completer.future;
78+
}, overrides: <Type, Generator>{
79+
FeatureFlags: disableExplicitPackageDependencies,
7180
});
7281

7382
testUsingContext('calls buildSystem.build with l10n.yaml synthetic-package: true', () async {
@@ -118,6 +127,8 @@ void main() {
118127
),
119128
);
120129
await completer.future;
130+
}, overrides: <Type, Generator>{
131+
FeatureFlags: disableExplicitPackageDependencies,
121132
});
122133

123134
testUsingContext('calls buildSystem.build with l10n.yaml synthetic-package: null', () async {
@@ -166,6 +177,8 @@ void main() {
166177
),
167178
);
168179
await completer.future;
180+
}, overrides: <Type, Generator>{
181+
FeatureFlags: disableExplicitPackageDependencies,
169182
});
170183

171184
testUsingContext('does not call buildSystem.build when l10n.yaml is not present', () async {
@@ -305,6 +318,8 @@ void main() {
305318
mockBufferLogger.warningText,
306319
contains('https://flutter.dev/to/flutter-gen-deprecation'),
307320
);
321+
}, overrides: <Type, Generator>{
322+
FeatureFlags: disableExplicitPackageDependencies,
308323
});
309324

310325
testUsingContext('synthetic-package: true (explicit) logs a deprecation warning', () async {
@@ -340,6 +355,8 @@ void main() {
340355
mockBufferLogger.warningText,
341356
contains('https://flutter.dev/to/flutter-gen-deprecation'),
342357
);
358+
}, overrides: <Type, Generator>{
359+
FeatureFlags: disableExplicitPackageDependencies,
343360
});
344361

345362
testUsingContext('synthetic-package: false has no deprecation warning', () async {

0 commit comments

Comments
 (0)