diff --git a/packages/flutter_tools/lib/src/android/android_studio.dart b/packages/flutter_tools/lib/src/android/android_studio.dart index 0049f781ff..0ad239389c 100644 --- a/packages/flutter_tools/lib/src/android/android_studio.dart +++ b/packages/flutter_tools/lib/src/android/android_studio.dart @@ -249,7 +249,7 @@ class AndroidStudio implements Comparable { static List _allMacOS() { final List candidatePaths = []; - void _checkForStudio(String path) { + void checkForStudio(String path) { if (!globals.fs.isDirectorySync(path)) { return; } @@ -264,7 +264,7 @@ class AndroidStudio implements Comparable { if (name.startsWith('Android Studio') && name.endsWith('.app')) { candidatePaths.add(directory); } else if (!directory.path.endsWith('.app')) { - _checkForStudio(directory.path); + checkForStudio(directory.path); } } } on Exception catch (e) { @@ -272,10 +272,10 @@ class AndroidStudio implements Comparable { } } - _checkForStudio('/Applications'); + checkForStudio('/Applications'); final String? homeDirPath = globals.fsUtils.homeDirPath; if (homeDirPath != null) { - _checkForStudio(globals.fs.path.join( + checkForStudio(globals.fs.path.join( homeDirPath, 'Applications', )); @@ -321,7 +321,7 @@ class AndroidStudio implements Comparable { static List _allLinuxOrWindows() { final List studios = []; - bool _hasStudioAt(String path, { Version? newerThan }) { + bool hasStudioAt(String path, { Version? newerThan }) { return studios.any((AndroidStudio studio) { if (studio.directory != path) { return false; @@ -363,7 +363,7 @@ class AndroidStudio implements Comparable { for (final Directory entity in entities) { final AndroidStudio? studio = AndroidStudio.fromHomeDot(entity); - if (studio != null && !_hasStudioAt(studio.directory, newerThan: studio.version)) { + if (studio != null && !hasStudioAt(studio.directory, newerThan: studio.version)) { studios.removeWhere((AndroidStudio other) => other.directory == studio.directory); studios.add(studio); } @@ -394,7 +394,7 @@ class AndroidStudio implements Comparable { version: Version.parse(version), studioAppName: title, ); - if (studio != null && !_hasStudioAt(studio.directory, newerThan: studio.version)) { + if (studio != null && !hasStudioAt(studio.directory, newerThan: studio.version)) { studios.removeWhere((AndroidStudio other) => other.directory == studio.directory); studios.add(studio); } @@ -405,21 +405,21 @@ class AndroidStudio implements Comparable { } final String? configuredStudioDir = globals.config.getValue('android-studio-dir') as String?; - if (configuredStudioDir != null && !_hasStudioAt(configuredStudioDir)) { + if (configuredStudioDir != null && !hasStudioAt(configuredStudioDir)) { studios.add(AndroidStudio(configuredStudioDir, configured: configuredStudioDir)); } if (globals.platform.isLinux) { - void _checkWellKnownPath(String path) { - if (globals.fs.isDirectorySync(path) && !_hasStudioAt(path)) { + void checkWellKnownPath(String path) { + if (globals.fs.isDirectorySync(path) && !hasStudioAt(path)) { studios.add(AndroidStudio(path)); } } // Add /opt/android-studio and $HOME/android-studio, if they exist. - _checkWellKnownPath('/opt/android-studio'); - _checkWellKnownPath('${globals.fsUtils.homeDirPath}/android-studio'); + checkWellKnownPath('/opt/android-studio'); + checkWellKnownPath('${globals.fsUtils.homeDirPath}/android-studio'); } return studios; } diff --git a/packages/flutter_tools/lib/src/android/android_workflow.dart b/packages/flutter_tools/lib/src/android/android_workflow.dart index 7d6de454f7..04a80d99d6 100644 --- a/packages/flutter_tools/lib/src/android/android_workflow.dart +++ b/packages/flutter_tools/lib/src/android/android_workflow.dart @@ -366,7 +366,7 @@ class AndroidLicenseValidator extends DoctorValidator { Future get licensesAccepted async { LicensesAccepted? status; - void _handleLine(String line) { + void handleLine(String line) { if (licenseCounts.hasMatch(line)) { final Match? match = licenseCounts.firstMatch(line); if (match?.group(1) != match?.group(2)) { @@ -399,12 +399,12 @@ class AndroidLicenseValidator extends DoctorValidator { final Future output = process.stdout .transform(const Utf8Decoder(reportErrors: false)) .transform(const LineSplitter()) - .listen(_handleLine) + .listen(handleLine) .asFuture(null); final Future errors = process.stderr .transform(const Utf8Decoder(reportErrors: false)) .transform(const LineSplitter()) - .listen(_handleLine) + .listen(handleLine) .asFuture(null); await Future.wait(>[output, errors]); return status ?? LicensesAccepted.unknown; diff --git a/packages/flutter_tools/lib/src/ios/bitcode.dart b/packages/flutter_tools/lib/src/ios/bitcode.dart index e07d89219d..1914ee258f 100644 --- a/packages/flutter_tools/lib/src/ios/bitcode.dart +++ b/packages/flutter_tools/lib/src/ios/bitcode.dart @@ -46,21 +46,21 @@ Future validateBitcode(BuildMode buildMode, TargetPlatform targetPlatform, Version _parseVersionFromClang(String? clangVersion) { final RegExp pattern = RegExp(r'Apple (LLVM|clang) version (\d+\.\d+\.\d+) '); - Never _invalid() { + Never invalid() { throwToolExit('Unable to parse Clang version from "$clangVersion". ' 'Expected a string like "Apple (LLVM|clang) #.#.# (clang-####.#.##.#)".'); } if (clangVersion == null || clangVersion.isEmpty) { - _invalid(); + invalid(); } final RegExpMatch? match = pattern.firstMatch(clangVersion); if (match == null || match.groupCount != 2) { - _invalid(); + invalid(); } final Version? version = Version.parse(match.group(2)); if (version == null) { - _invalid(); + invalid(); } return version; } diff --git a/packages/flutter_tools/lib/src/ios/xcodeproj.dart b/packages/flutter_tools/lib/src/ios/xcodeproj.dart index 47f8575740..9625f32ef0 100644 --- a/packages/flutter_tools/lib/src/ios/xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/xcodeproj.dart @@ -301,7 +301,7 @@ class XcodeProjectInterpreter { const int missingProjectExitCode = 66; // The exit code returned by 'xcodebuild -list' when the project is corrupted. const int corruptedProjectExitCode = 74; - bool _allowedFailures(int c) => c == missingProjectExitCode || c == corruptedProjectExitCode; + bool allowedFailures(int c) => c == missingProjectExitCode || c == corruptedProjectExitCode; final RunResult result = await _processUtils.run( [ ...xcrunCommand(), @@ -310,10 +310,10 @@ class XcodeProjectInterpreter { if (projectFilename != null) ...['-project', projectFilename], ], throwOnError: true, - allowedFailures: _allowedFailures, + allowedFailures: allowedFailures, workingDirectory: projectPath, ); - if (_allowedFailures(result.exitCode)) { + if (allowedFailures(result.exitCode)) { // User configuration error, tool exit instead of crashing. throwToolExit('Unable to get Xcode project information:\n ${result.stderr}'); } diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart index 3a82a98a47..0e8434a45e 100644 --- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart +++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart @@ -254,7 +254,7 @@ class WebAssetServer implements AssetReader { // Return a version string for all active modules. This is populated // along with the `moduleProvider` update logic. - Future> _digestProvider() async => digests; + Future> digestProvider() async => digests; // Ensure dwds is present and provide middleware to avoid trying to // load the through the isolate APIs. @@ -295,7 +295,7 @@ class WebAssetServer implements AssetReader { loadStrategy: FrontendServerRequireStrategyProvider( ReloadConfiguration.none, server, - _digestProvider, + digestProvider, ).strategy, expressionCompiler: expressionCompiler, spawnDds: enableDds, diff --git a/packages/flutter_tools/lib/src/localizations/gen_l10n_types.dart b/packages/flutter_tools/lib/src/localizations/gen_l10n_types.dart index 9be9b8d875..9034f88860 100644 --- a/packages/flutter_tools/lib/src/localizations/gen_l10n_types.dart +++ b/packages/flutter_tools/lib/src/localizations/gen_l10n_types.dart @@ -358,7 +358,7 @@ class Message { if (attributes == null) { - void _throwEmptyAttributes(final RegExp regExp, final String type) { + void throwEmptyAttributes(final RegExp regExp, final String type) { final RegExpMatch? match = regExp.firstMatch(_value(bundle, resourceId)); final bool isMatch = match != null && match.groupCount == 1; if (isMatch) { @@ -369,8 +369,8 @@ class Message { } } - _throwEmptyAttributes(_pluralRE, 'plural'); - _throwEmptyAttributes(_selectRE, 'select'); + throwEmptyAttributes(_pluralRE, 'plural'); + throwEmptyAttributes(_selectRE, 'select'); } return attributes as Map?; diff --git a/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart index 35f63cafcd..93f7e363e0 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart @@ -55,7 +55,7 @@ void main() { }); - void _createSampleProject(Directory directory, { bool brokenCode = false }) { + void createSampleProject(Directory directory, { bool brokenCode = false }) { final File pubspecFile = fileSystem.file(fileSystem.path.join(directory.path, 'pubspec.yaml')); pubspecFile.writeAsStringSync(''' name: foo_project @@ -75,7 +75,7 @@ void main() { group('analyze --watch', () { testUsingContext('AnalysisServer success', () async { - _createSampleProject(tempDir); + createSampleProject(tempDir); final Pub pub = Pub( fileSystem: fileSystem, @@ -113,7 +113,7 @@ void main() { }); testUsingContext('AnalysisServer errors', () async { - _createSampleProject(tempDir, brokenCode: true); + createSampleProject(tempDir, brokenCode: true); final Pub pub = Pub( fileSystem: fileSystem, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart index 071f0f4b5c..d18c63bc22 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart @@ -72,25 +72,25 @@ void main() { }); // Sets up the minimal mock project files necessary to look like a Flutter project. - void _createCoreMockProjectFiles() { + void createCoreMockProjectFiles() { fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); } // Sets up the minimal mock project files necessary for iOS builds to succeed. - void _createMinimalMockProjectFiles() { + void createMinimalMockProjectFiles() { fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcodeproj')).createSync(recursive: true); fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcworkspace')).createSync(recursive: true); fileSystem.file(fileSystem.path.join('ios', 'Runner.xcodeproj', 'project.pbxproj')).createSync(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); } const FakeCommand xattrCommand = FakeCommand(command: [ 'xattr', '-r', '-d', 'com.apple.FinderInfo', '/', ]); - FakeCommand _setUpRsyncCommand({void Function() onRun}) { + FakeCommand setUpRsyncCommand({void Function() onRun}) { return FakeCommand( command: const [ 'rsync', @@ -104,7 +104,7 @@ void main() { ); } - FakeCommand _setUpXCResultCommand({String stdout = '', void Function() onRun}) { + FakeCommand setUpXCResultCommand({String stdout = '', void Function() onRun}) { return FakeCommand( command: const [ 'xcrun', @@ -122,7 +122,7 @@ void main() { // Creates a FakeCommand for the xcodebuild call to build the app // in the given configuration. - FakeCommand _setUpFakeXcodeBuildHandler({ + FakeCommand setUpFakeXcodeBuildHandler({ bool verbose = false, bool simulator = false, String deviceId, @@ -179,7 +179,7 @@ void main() { testUsingContext('ios build fails when there is no ios project', () async { final BuildCommand command = BuildCommand(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); expect(createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub'] @@ -193,7 +193,7 @@ void main() { testUsingContext('ios build fails in debug with code analysis', () async { final BuildCommand command = BuildCommand(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); expect(createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub', '--debug', '--analyze-size'] @@ -225,7 +225,7 @@ void main() { testUsingContext('ios build invokes xcode build', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub'] @@ -235,10 +235,10 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(onRun: () { + setUpFakeXcodeBuildHandler(onRun: () { fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true); }), - _setUpRsyncCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -246,7 +246,7 @@ void main() { testUsingContext('ios build invokes xcode build with device ID', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub', '--device-id', '1234'] @@ -256,10 +256,10 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(deviceId: '1234', onRun: () { + setUpFakeXcodeBuildHandler(deviceId: '1234', onRun: () { fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true); }), - _setUpRsyncCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -267,7 +267,7 @@ void main() { testUsingContext('ios simulator build invokes xcode build', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ios', '--simulator', '--no-pub'] @@ -276,10 +276,10 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(simulator: true, onRun: () { + setUpFakeXcodeBuildHandler(simulator: true, onRun: () { fileSystem.directory('build/ios/Debug-iphonesimulator/Runner.app').createSync(recursive: true); }), - _setUpRsyncCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -287,7 +287,7 @@ void main() { testUsingContext('ios build invokes xcode build with verbosity', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub', '-v'] @@ -296,10 +296,10 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(verbose: true, onRun: () { + setUpFakeXcodeBuildHandler(verbose: true, onRun: () { fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true); }), - _setUpRsyncCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -307,7 +307,7 @@ void main() { testUsingContext('Performs code size analysis and sends analytics', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ios', '--no-pub', '--analyze-size'] @@ -322,7 +322,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(onRun: () { + setUpFakeXcodeBuildHandler(onRun: () { fileSystem.directory('build/ios/Release-iphoneos/Runner.app').createSync(recursive: true); fileSystem.file('build/flutter_size_01/snapshot.arm64.json') ..createSync(recursive: true) @@ -339,7 +339,7 @@ void main() { ..createSync(recursive: true) ..writeAsStringSync('{}'); }), - _setUpRsyncCommand(onRun: () => fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App') + setUpRsyncCommand(onRun: () => fileSystem.file('build/ios/iphoneos/Runner.app/Frameworks/App.framework/App') ..createSync(recursive: true) ..writeAsBytesSync(List.generate(10000, (int index) => 0))), ]), @@ -352,7 +352,7 @@ void main() { testUsingContext('Trace error if xcresult is empty.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -364,11 +364,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(), - _setUpRsyncCommand(), + setUpXCResultCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -377,7 +377,7 @@ void main() { testUsingContext('Display xcresult issues on console if parsed.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -390,11 +390,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -403,7 +403,7 @@ void main() { testUsingContext('Do not display xcresult issues that needs to be discarded.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -418,11 +418,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -431,7 +431,7 @@ void main() { testUsingContext('Trace if xcresult bundle does not exist.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -443,9 +443,9 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), - _setUpRsyncCommand(), + setUpFakeXcodeBuildHandler(exitCode: 1), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -454,7 +454,7 @@ void main() { testUsingContext('Extra error message for provision profile issue in xcresult bundle.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -470,11 +470,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -483,7 +483,7 @@ void main() { testUsingContext('Default bundle identifier error should be hidden if there is another xcresult issue.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -497,11 +497,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, EnvironmentType: () => EnvironmentType.physical, @@ -511,7 +511,7 @@ void main() { testUsingContext('Show default bundle identifier error if there are no other errors.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -523,11 +523,11 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonNoIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonNoIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, EnvironmentType: () => EnvironmentType.physical, @@ -538,7 +538,7 @@ void main() { testUsingContext('Display xcresult issues with no provisioning profile.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -551,14 +551,14 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -567,7 +567,7 @@ void main() { testUsingContext('Failed to parse xcresult but display missing provisioning profile issue from stdout.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -579,7 +579,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, stdout: ''' Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor @@ -588,8 +588,8 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -598,7 +598,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('Failed to parse xcresult but detected no development team issue.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -610,14 +610,14 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(developmentTeam: null), @@ -627,7 +627,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('xcresult did not detect issue but detected by stdout.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -639,7 +639,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, stdout: ''' Runner requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor @@ -648,8 +648,8 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonNoIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonNoIssues), + setUpRsyncCommand(), ]), EnvironmentType: () => EnvironmentType.physical, Platform: () => macosPlatform, @@ -659,7 +659,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('xcresult did not detect issue, no development team is detected from build setting.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -671,14 +671,14 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonInvalidIssuesMap), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(developmentTeam: null), @@ -687,7 +687,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('No development team issue error message is not displayed if no provisioning profile issue is detected from xcresult first.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -700,14 +700,14 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithNoProvisioningProfileIssue), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(developmentTeam: null), @@ -716,7 +716,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('General provisioning profile issue error message is not displayed if no development team issue is detected first.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--no-pub']), @@ -729,14 +729,14 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); } ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(developmentTeam: null), @@ -747,7 +747,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('Trace error if xcresult is empty.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--simulator', '--no-pub']), @@ -759,15 +759,15 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( simulator: true, exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }, ), - _setUpXCResultCommand(), - _setUpRsyncCommand(), + setUpXCResultCommand(), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -776,7 +776,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('Display xcresult issues on console if parsed.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--simulator', '--no-pub']), @@ -789,15 +789,15 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( simulator: true, exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }, ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -806,7 +806,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('Do not display xcresult issues that needs to be discarded.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--simulator', '--no-pub']), @@ -821,15 +821,15 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( simulator: true, exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }, ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), @@ -838,7 +838,7 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig testUsingContext('Trace if xcresult bundle does not exist.', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ios', '--simulator', '--no-pub']), @@ -850,12 +850,12 @@ Runner requires a provisioning profile. Select a provisioning profile in the Sig FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.list([ xattrCommand, - _setUpFakeXcodeBuildHandler( + setUpFakeXcodeBuildHandler( simulator: true, exitCode: 1, ), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), - _setUpRsyncCommand(), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpRsyncCommand(), ]), Platform: () => macosPlatform, XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(), diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart index 6f31be3079..07d755d7b1 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart @@ -68,25 +68,25 @@ void main() { }); // Sets up the minimal mock project files necessary to look like a Flutter project. - void _createCoreMockProjectFiles() { + void createCoreMockProjectFiles() { fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('.packages').createSync(); fileSystem.file(fileSystem.path.join('lib', 'main.dart')).createSync(recursive: true); } // Sets up the minimal mock project files necessary for iOS builds to succeed. - void _createMinimalMockProjectFiles() { + void createMinimalMockProjectFiles() { fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcodeproj')).createSync(recursive: true); fileSystem.directory(fileSystem.path.join('ios', 'Runner.xcworkspace')).createSync(recursive: true); fileSystem.file(fileSystem.path.join('ios', 'Runner.xcodeproj', 'project.pbxproj')).createSync(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); } const FakeCommand xattrCommand = FakeCommand(command: [ 'xattr', '-r', '-d', 'com.apple.FinderInfo', '/', ]); - FakeCommand _setUpXCResultCommand({String stdout = '', void Function() onRun}) { + FakeCommand setUpXCResultCommand({String stdout = '', void Function() onRun}) { return FakeCommand( command: const [ 'xcrun', @@ -104,7 +104,7 @@ void main() { // Creates a FakeCommand for the xcodebuild call to build the app // in the given configuration. - FakeCommand _setUpFakeXcodeBuildHandler({ bool verbose = false, int exitCode = 0, void Function() onRun }) { + FakeCommand setUpFakeXcodeBuildHandler({ bool verbose = false, int exitCode = 0, void Function() onRun }) { return FakeCommand( command: [ 'xcrun', @@ -132,7 +132,7 @@ void main() { ); } - FakeCommand _exportArchiveCommand({ + FakeCommand exportArchiveCommand({ String exportOptionsPlist = '/ExportOptions.plist', File cachePlist, }) { @@ -162,7 +162,7 @@ void main() { testUsingContext('ipa build fails when there is no ios project', () async { final BuildCommand command = BuildCommand(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); expect(createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub'] @@ -176,7 +176,7 @@ void main() { testUsingContext('ipa build fails in debug with code analysis', () async { final BuildCommand command = BuildCommand(); - _createCoreMockProjectFiles(); + createCoreMockProjectFiles(); expect(createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub', '--debug', '--analyze-size'] @@ -209,7 +209,7 @@ void main() { testUsingContext('ipa build fails when export plist does not exist', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectToolExitLater( createTestCommandRunner(command).run([ @@ -232,7 +232,7 @@ void main() { testUsingContext('ipa build fails when export plist is not a file', () async { final Directory bogus = fileSystem.directory('bogus')..createSync(); final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectToolExitLater( createTestCommandRunner(command).run([ @@ -254,7 +254,7 @@ void main() { testUsingContext('ipa build fails when --export-options-plist and --export-method are used together', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectToolExitLater( createTestCommandRunner(command).run([ @@ -280,7 +280,7 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), + setUpFakeXcodeBuildHandler(), const FakeCommand( command: [ 'xcrun', @@ -299,7 +299,7 @@ void main() { stderr: 'error: exportArchive: "Runner.app" requires a provisioning profile.', ), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub'] @@ -322,10 +322,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), + setUpFakeXcodeBuildHandler(), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub'] @@ -364,10 +364,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), + setUpFakeXcodeBuildHandler(), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub', '--export-method', 'ad-hoc'] @@ -407,10 +407,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), + setUpFakeXcodeBuildHandler(), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub', '--export-method', 'enterprise'] @@ -450,10 +450,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), + setUpFakeXcodeBuildHandler(), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub',] @@ -485,10 +485,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(verbose: true), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist), + setUpFakeXcodeBuildHandler(verbose: true), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub', '-v'] @@ -530,7 +530,7 @@ void main() { ], ), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( const ['build', 'ipa', '--no-pub', '--no-codesign'] @@ -546,7 +546,7 @@ void main() { testUsingContext('code size analysis fails when app not found', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectToolExitLater( createTestCommandRunner(command).run( @@ -564,14 +564,14 @@ void main() { testUsingContext('Performs code size analysis and sends analytics', () async { final BuildCommand command = BuildCommand(); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); fileSystem.file('build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Frameworks/App.framework/App') ..createSync(recursive: true) ..writeAsBytesSync(List.generate(10000, (int index) => 0)); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(onRun: () { + setUpFakeXcodeBuildHandler(onRun: () { fileSystem.file('build/flutter_size_01/snapshot.arm64.json') ..createSync(recursive: true) ..writeAsStringSync(''' @@ -587,7 +587,7 @@ void main() { ..createSync(recursive: true) ..writeAsStringSync('{}'); }), - _exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist), + exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist), ]); await createTestCommandRunner(command).run( @@ -617,10 +617,10 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(), - _exportArchiveCommand(), + setUpFakeXcodeBuildHandler(), + exportArchiveCommand(), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await createTestCommandRunner(command).run( [ @@ -646,12 +646,12 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(), + setUpXCResultCommand(), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ipa', '--no-pub']), @@ -671,12 +671,12 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssues), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ipa', '--no-pub']), @@ -697,12 +697,12 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), + setUpXCResultCommand(stdout: kSampleResultJsonWithIssuesToBeDiscarded), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ipa', '--no-pub']), @@ -725,9 +725,9 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1), + setUpFakeXcodeBuildHandler(exitCode: 1), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ipa', '--no-pub']), @@ -748,12 +748,12 @@ void main() { final BuildCommand command = BuildCommand(); fakeProcessManager.addCommands([ xattrCommand, - _setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { + setUpFakeXcodeBuildHandler(exitCode: 1, onRun: () { fileSystem.systemTempDirectory.childDirectory(_xcBundleFilePath).createSync(); }), - _setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), + setUpXCResultCommand(stdout: kSampleResultJsonWithProvisionIssue), ]); - _createMinimalMockProjectFiles(); + createMinimalMockProjectFiles(); await expectLater( createTestCommandRunner(command).run(const ['build', 'ipa', '--no-pub']), diff --git a/packages/flutter_tools/test/commands.shard/hermetic/ide_config_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/ide_config_test.dart index cdee1e2a5f..dcd7c484dd 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/ide_config_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/ide_config_test.dart @@ -22,7 +22,7 @@ void main() { Directory intellijDir; Directory toolsDir; - Map _getFilesystemContents([ Directory root ]) { + Map getFilesystemContents([ Directory root ]) { final String tempPath = tempDir.absolute.path; final List paths = (root ?? tempDir).listSync(recursive: true).map((FileSystemEntity entity) { @@ -41,7 +41,7 @@ void main() { return contents; } - Map _getManifest(Directory base, String marker, { bool isTemplate = false }) { + Map getManifest(Directory base, String marker, { bool isTemplate = false }) { final String basePath = globals.fs.path.relative(base.path, from: tempDir.absolute.path); final String suffix = isTemplate ? Template.copyTemplateExtension : ''; return { @@ -57,7 +57,7 @@ void main() { }; } - void _populateDir(Map manifest) { + void populateDir(Map manifest) { for (final String key in manifest.keys) { if (manifest[key] == 'dir') { tempDir.childDirectory(key).createSync(recursive: true); @@ -72,12 +72,12 @@ void main() { } } - bool _fileOrDirectoryExists(String path) { + bool fileOrDirectoryExists(String path) { final String absPath = globals.fs.path.join(tempDir.absolute.path, path); return globals.fs.file(absPath).existsSync() || globals.fs.directory(absPath).existsSync(); } - Future _updateIdeConfig({ + Future updateIdeConfig({ Directory dir, List args = const [], Map expectedContents = const {}, @@ -94,7 +94,7 @@ void main() { for (final String path in expectedContents.keys) { final String absPath = globals.fs.path.join(tempDir.absolute.path, path); - expect(_fileOrDirectoryExists(globals.fs.path.join(dir.path, path)), true, + expect(fileOrDirectoryExists(globals.fs.path.join(dir.path, path)), true, reason: "$path doesn't exist"); if (globals.fs.file(absPath).existsSync()) { expect(globals.fs.file(absPath).readAsStringSync(), equals(expectedContents[path]), @@ -102,7 +102,7 @@ void main() { } } for (final String path in unexpectedPaths) { - expect(_fileOrDirectoryExists(globals.fs.path.join(dir.path, path)), false, reason: '$path exists'); + expect(fileOrDirectoryExists(globals.fs.path.join(dir.path, path)), false, reason: '$path exists'); } } @@ -123,56 +123,56 @@ void main() { }); testUsingContext("doesn't touch existing files without --overwrite", () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - final Map flutterManifest = _getManifest( + final Map flutterManifest = getManifest( tempDir, 'existing', ); - _populateDir(templateManifest); - _populateDir(flutterManifest); - final Map expectedContents = _getFilesystemContents(); - return _updateIdeConfig( + populateDir(templateManifest); + populateDir(flutterManifest); + final Map expectedContents = getFilesystemContents(); + return updateIdeConfig( expectedContents: expectedContents, ); }); testUsingContext('creates non-existent files', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - final Map flutterManifest = _getManifest( + final Map flutterManifest = getManifest( tempDir, 'template', ); - _populateDir(templateManifest); + populateDir(templateManifest); final Map expectedContents = { ...templateManifest, ...flutterManifest, }; - return _updateIdeConfig( + return updateIdeConfig( expectedContents: expectedContents, ); }); testUsingContext('overwrites existing files with --overwrite', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - final Map flutterManifest = _getManifest( + final Map flutterManifest = getManifest( tempDir, 'existing', ); - _populateDir(templateManifest); - _populateDir(flutterManifest); - final Map overwrittenManifest = _getManifest( + populateDir(templateManifest); + populateDir(flutterManifest); + final Map overwrittenManifest = getManifest( tempDir, 'template', ); @@ -180,14 +180,14 @@ void main() { ...templateManifest, ...overwrittenManifest, }; - return _updateIdeConfig( + return updateIdeConfig( args: ['--overwrite'], expectedContents: expectedContents, ); }); testUsingContext('only adds new templates without --overwrite', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, @@ -200,36 +200,36 @@ void main() { 'flutter.iml${Template.copyTemplateExtension}', ); templateManifest.remove(flutterIml); - _populateDir(templateManifest); + populateDir(templateManifest); templateManifest[flutterIml] = 'flutter existing'; - final Map flutterManifest = _getManifest( + final Map flutterManifest = getManifest( tempDir, 'existing', ); - _populateDir(flutterManifest); + populateDir(flutterManifest); final Map expectedContents = { ...flutterManifest, ...templateManifest, }; - return _updateIdeConfig( + return updateIdeConfig( args: ['--update-templates'], expectedContents: expectedContents, ); }); testUsingContext('update all templates with --overwrite', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - _populateDir(templateManifest); - final Map flutterManifest = _getManifest( + populateDir(templateManifest); + final Map flutterManifest = getManifest( tempDir, 'existing', ); - _populateDir(flutterManifest); - final Map updatedTemplates = _getManifest( + populateDir(flutterManifest); + final Map updatedTemplates = getManifest( intellijDir, 'existing', isTemplate: true, @@ -238,26 +238,26 @@ void main() { ...flutterManifest, ...updatedTemplates, }; - return _updateIdeConfig( + return updateIdeConfig( args: ['--update-templates', '--overwrite'], expectedContents: expectedContents, ); }); testUsingContext('removes deleted imls with --overwrite', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - _populateDir(templateManifest); - final Map flutterManifest = _getManifest( + populateDir(templateManifest); + final Map flutterManifest = getManifest( tempDir, 'existing', ); flutterManifest.remove('flutter.iml'); - _populateDir(flutterManifest); - final Map updatedTemplates = _getManifest( + populateDir(flutterManifest); + final Map updatedTemplates = getManifest( intellijDir, 'existing', isTemplate: true, @@ -274,26 +274,26 @@ void main() { ...flutterManifest, ...updatedTemplates, }; - return _updateIdeConfig( + return updateIdeConfig( args: ['--update-templates', '--overwrite'], expectedContents: expectedContents, ); }); testUsingContext('removes deleted imls with --overwrite, including empty parent dirs', () async { - final Map templateManifest = _getManifest( + final Map templateManifest = getManifest( intellijDir, 'template', isTemplate: true, ); - _populateDir(templateManifest); - final Map flutterManifest = _getManifest( + populateDir(templateManifest); + final Map flutterManifest = getManifest( tempDir, 'existing', ); flutterManifest.remove(globals.fs.path.join('packages', 'new', 'deep.iml')); - _populateDir(flutterManifest); - final Map updatedTemplates = _getManifest( + populateDir(flutterManifest); + final Map updatedTemplates = getManifest( intellijDir, 'existing', isTemplate: true, @@ -315,7 +315,7 @@ void main() { ...flutterManifest, ...updatedTemplates, }; - return _updateIdeConfig( + return updateIdeConfig( args: ['--update-templates', '--overwrite'], expectedContents: expectedContents, ); diff --git a/packages/flutter_tools/test/general.shard/base/user_messages_test.dart b/packages/flutter_tools/test/general.shard/base/user_messages_test.dart index b67302013c..862fb2a08e 100644 --- a/packages/flutter_tools/test/general.shard/base/user_messages_test.dart +++ b/packages/flutter_tools/test/general.shard/base/user_messages_test.dart @@ -14,7 +14,7 @@ void main() { final FakePlatform linuxPlatform = FakePlatform(); final FakePlatform windowsPlatform = FakePlatform(operatingSystem: 'windows'); - void _checkInstallationURL(_InstallationMessage message) { + void checkInstallationURL(_InstallationMessage message) { expect(message(macPlatform), contains('https://flutter.dev/docs/get-started/install/macos#android-setup')); expect(message(linuxPlatform), contains('https://flutter.dev/docs/get-started/install/linux#android-setup')); expect(message(windowsPlatform), contains('https://flutter.dev/docs/get-started/install/windows#android-setup')); @@ -23,11 +23,11 @@ void main() { testWithoutContext('Android installation instructions', () { final UserMessages userMessages = UserMessages(); - _checkInstallationURL((Platform platform) => userMessages.androidMissingSdkInstructions(platform)); - _checkInstallationURL((Platform platform) => userMessages.androidSdkInstallHelp(platform)); - _checkInstallationURL((Platform platform) => userMessages.androidMissingSdkManager('/', platform)); - _checkInstallationURL((Platform platform) => userMessages.androidCannotRunSdkManager('/', '', platform)); - _checkInstallationURL((Platform platform) => userMessages.androidSdkBuildToolsOutdated(0, '', platform)); - _checkInstallationURL((Platform platform) => userMessages.androidStudioInstallation(platform)); + checkInstallationURL((Platform platform) => userMessages.androidMissingSdkInstructions(platform)); + checkInstallationURL((Platform platform) => userMessages.androidSdkInstallHelp(platform)); + checkInstallationURL((Platform platform) => userMessages.androidMissingSdkManager('/', platform)); + checkInstallationURL((Platform platform) => userMessages.androidCannotRunSdkManager('/', '', platform)); + checkInstallationURL((Platform platform) => userMessages.androidSdkBuildToolsOutdated(0, '', platform)); + checkInstallationURL((Platform platform) => userMessages.androidStudioInstallation(platform)); }); } diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart index f8050347cb..4eab81ff44 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart @@ -35,7 +35,7 @@ void main() { late String fontSubsetPath; late List fontSubsetArgs; - List _getConstFinderArgs(String appDillPath) => [ + List getConstFinderArgs(String appDillPath) => [ dartPath, '--disable-dart-dev', constFinderPath, @@ -44,21 +44,21 @@ void main() { '--class-name', 'IconData', ]; - void _addConstFinderInvocation( + void addConstFinderInvocation( String appDillPath, { int exitCode = 0, String stdout = '', String stderr = '', }) { processManager.addCommand(FakeCommand( - command: _getConstFinderArgs(appDillPath), + command: getConstFinderArgs(appDillPath), exitCode: exitCode, stdout: stdout, stderr: stderr, )); } - void _resetFontSubsetInvocation({ + void resetFontSubsetInvocation({ int exitCode = 0, String stdout = '', String stderr = '', @@ -99,7 +99,7 @@ void main() { ..writeAsBytesSync(_kTtfHeaderBytes); }); - Environment _createEnvironment(Map defines) { + Environment createEnvironment(Map defines) { return Environment.test( fileSystem.directory('/icon_test')..createSync(recursive: true), defines: defines, @@ -111,7 +111,7 @@ void main() { } testWithoutContext('Prints error in debug mode environment', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'debug', }); @@ -142,7 +142,7 @@ void main() { }); testWithoutContext('Does not get enabled without font manifest', () { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -165,7 +165,7 @@ void main() { }); testWithoutContext('Gets enabled', () { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -188,7 +188,7 @@ void main() { }); test('No app.dill throws exception', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -214,7 +214,7 @@ void main() { }); testWithoutContext('Can subset a font', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -231,8 +231,8 @@ void main() { ); final CompleterIOSink stdinSink = CompleterIOSink(); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); - _resetFontSubsetInvocation(stdinSink: stdinSink); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + resetFontSubsetInvocation(stdinSink: stdinSink); bool subsetted = await iconTreeShaker.subsetFont( input: fileSystem.file(inputPath), @@ -240,7 +240,7 @@ void main() { relativePath: relativePath, ); expect(stdinSink.getAndClear(), '59470\n'); - _resetFontSubsetInvocation(stdinSink: stdinSink); + resetFontSubsetInvocation(stdinSink: stdinSink); expect(subsetted, true); subsetted = await iconTreeShaker.subsetFont( @@ -254,7 +254,7 @@ void main() { }); testWithoutContext('Does not subset a non-supported font', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -271,8 +271,8 @@ void main() { ); final CompleterIOSink stdinSink = CompleterIOSink(); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); - _resetFontSubsetInvocation(stdinSink: stdinSink); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + resetFontSubsetInvocation(stdinSink: stdinSink); final File notAFont = fileSystem.file('input/foo/bar.txt') ..createSync(recursive: true) @@ -286,7 +286,7 @@ void main() { }); testWithoutContext('Does not subset an invalid ttf font', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -303,8 +303,8 @@ void main() { ); final CompleterIOSink stdinSink = CompleterIOSink(); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); - _resetFontSubsetInvocation(stdinSink: stdinSink); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + resetFontSubsetInvocation(stdinSink: stdinSink); final File notAFont = fileSystem.file(inputPath) ..writeAsBytesSync([0, 1, 2]); @@ -318,7 +318,7 @@ void main() { }); testWithoutContext('Non-constant instances', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -334,7 +334,7 @@ void main() { artifacts: artifacts, ); - _addConstFinderInvocation(appDill.path, stdout: constFinderResultWithInvalid); + addConstFinderInvocation(appDill.path, stdout: constFinderResultWithInvalid); await expectLater( () => iconTreeShaker.subsetFont( @@ -352,7 +352,7 @@ void main() { }); testWithoutContext('Non-zero font-subset exit code', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -370,8 +370,8 @@ void main() { ); final CompleterIOSink stdinSink = CompleterIOSink(); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); - _resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink); await expectLater( () => iconTreeShaker.subsetFont( @@ -385,7 +385,7 @@ void main() { }); testWithoutContext('font-subset throws on write to sdtin', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -402,8 +402,8 @@ void main() { ); final CompleterIOSink stdinSink = CompleterIOSink(throwOnAdd: true); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); - _resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + resetFontSubsetInvocation(exitCode: -1, stdinSink: stdinSink); await expectLater( () => iconTreeShaker.subsetFont( @@ -417,7 +417,7 @@ void main() { }); testWithoutContext('Invalid font manifest', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -435,7 +435,7 @@ void main() { artifacts: artifacts, ); - _addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); + addConstFinderInvocation(appDill.path, stdout: validConstFinderResult); await expectLater( () => iconTreeShaker.subsetFont( @@ -449,7 +449,7 @@ void main() { }); testWithoutContext('ConstFinder non-zero exit', () async { - final Environment environment = _createEnvironment({ + final Environment environment = createEnvironment({ kIconTreeShakerFlag: 'true', kBuildMode: 'release', }); @@ -467,7 +467,7 @@ void main() { artifacts: artifacts, ); - _addConstFinderInvocation(appDill.path, exitCode: -1); + addConstFinderInvocation(appDill.path, exitCode: -1); await expectLater( () async => iconTreeShaker.subsetFont( diff --git a/packages/flutter_tools/test/general.shard/ios/xcresult_test.dart b/packages/flutter_tools/test/general.shard/ios/xcresult_test.dart index 0d8d637645..72b78681c8 100644 --- a/packages/flutter_tools/test/general.shard/ios/xcresult_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/xcresult_test.dart @@ -15,7 +15,7 @@ import 'xcresult_test_data.dart'; void main() { // Creates a FakeCommand for the xcresult get call to build the app // in the given configuration. - FakeCommand _setUpFakeXCResultGetCommand({ + FakeCommand setUpFakeXCResultGetCommand({ required String stdout, required String tempResultPath, required Xcode xcode, @@ -54,7 +54,7 @@ void main() { exitCode: 1, ); - XCResultGenerator _setupGenerator({ + XCResultGenerator setupGenerator({ required String resultJson, int exitCode = 0, String stderr = '', @@ -73,7 +73,7 @@ void main() { ); fakeProcessManager.addCommands( [ - _setUpFakeXCResultGetCommand( + setUpFakeXCResultGetCommand( stdout: resultJson, tempResultPath: _tempResultPath, xcode: xcode, @@ -95,7 +95,7 @@ void main() { testWithoutContext( 'correctly parse sample result json when there are issues.', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResult result = await generator.generate(); expect(result.issues.length, 2); expect(result.issues.first.type, XCResultIssueType.error); @@ -112,7 +112,7 @@ void main() { testWithoutContext( 'correctly parse sample result json when there are issues but invalid url.', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssuesAndInvalidUrl); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssuesAndInvalidUrl); final XCResult result = await generator.generate(); expect(result.issues.length, 2); expect(result.issues.first.type, XCResultIssueType.error); @@ -130,7 +130,7 @@ void main() { testWithoutContext( 'correctly parse sample result json and discard all warnings', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResultIssueDiscarder discarder = XCResultIssueDiscarder(typeMatcher: XCResultIssueType.warning); final XCResult result = await generator.generate(issueDiscarders: [discarder]); expect(result.issues.length, 1); @@ -144,7 +144,7 @@ void main() { testWithoutContext( 'correctly parse sample result json and discard base on subType', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResultIssueDiscarder discarder = XCResultIssueDiscarder(subTypeMatcher: RegExp(r'^Warning$')); final XCResult result = await generator.generate(issueDiscarders: [discarder]); expect(result.issues.length, 1); @@ -158,7 +158,7 @@ void main() { testWithoutContext( 'correctly parse sample result json and discard base on message', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResultIssueDiscarder discarder = XCResultIssueDiscarder(messageMatcher: RegExp(r"^The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.$")); final XCResult result = await generator.generate(issueDiscarders: [discarder]); expect(result.issues.length, 1); @@ -172,7 +172,7 @@ void main() { testWithoutContext( 'correctly parse sample result json and discard base on location', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResultIssueDiscarder discarder = XCResultIssueDiscarder(locationMatcher: RegExp(r'/Users/m/Projects/test_create/ios/Runner/AppDelegate.m')); final XCResult result = await generator.generate(issueDiscarders: [discarder]); expect(result.issues.length, 1); @@ -186,7 +186,7 @@ void main() { testWithoutContext( 'correctly parse sample result json with multiple discarders.', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonWithIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonWithIssues); final XCResultIssueDiscarder discardWarnings = XCResultIssueDiscarder(typeMatcher: XCResultIssueType.warning); final XCResultIssueDiscarder discardSemanticIssues = XCResultIssueDiscarder(subTypeMatcher: RegExp(r'^Semantic Issue$')); final XCResult result = await generator.generate(issueDiscarders: [discardWarnings, discardSemanticIssues]); @@ -197,7 +197,7 @@ void main() { testWithoutContext('correctly parse sample result json when no issues.', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonNoIssues); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonNoIssues); final XCResult result = await generator.generate(); expect(result.issues.length, 0); expect(result.parseSuccess, isTrue); @@ -208,7 +208,7 @@ void main() { 'error: `xcresulttool get` process fail should return an `XCResult` with stderr as `parsingErrorMessage`.', () async { const String fakeStderr = 'Fake: fail to parse result json.'; - final XCResultGenerator generator = _setupGenerator( + final XCResultGenerator generator = setupGenerator( resultJson: '', exitCode: 1, stderr: fakeStderr, @@ -221,7 +221,7 @@ void main() { }); testWithoutContext('error: `xcresulttool get` no stdout', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: ''); + final XCResultGenerator generator = setupGenerator(resultJson: ''); final XCResult result = await generator.generate(); expect(result.issues.length, 0); @@ -231,7 +231,7 @@ void main() { }); testWithoutContext('error: wrong top level json format.', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: '[]'); + final XCResultGenerator generator = setupGenerator(resultJson: '[]'); final XCResult result = await generator.generate(); expect(result.issues.length, 0); @@ -241,7 +241,7 @@ void main() { }); testWithoutContext('error: fail to parse issue map', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: '{}'); + final XCResultGenerator generator = setupGenerator(resultJson: '{}'); final XCResult result = await generator.generate(); expect(result.issues.length, 0); @@ -251,7 +251,7 @@ void main() { }); testWithoutContext('error: invalid issue map', () async { - final XCResultGenerator generator = _setupGenerator(resultJson: kSampleResultJsonInvalidIssuesMap); + final XCResultGenerator generator = setupGenerator(resultJson: kSampleResultJsonInvalidIssuesMap); final XCResult result = await generator.generate(); expect(result.issues.length, 0); diff --git a/packages/flutter_tools/test/general.shard/plugins_test.dart b/packages/flutter_tools/test/general.shard/plugins_test.dart index 521795cbc2..f17dfe5765 100644 --- a/packages/flutter_tools/test/general.shard/plugins_test.dart +++ b/packages/flutter_tools/test/general.shard/plugins_test.dart @@ -1557,7 +1557,7 @@ flutter: tryToDelete(tempDir); }); - void _createPubspecFile(String yamlString) { + void createPubspecFile(String yamlString) { projectDir.childFile('pubspec.yaml')..createSync(recursive: true)..writeAsStringSync(yamlString); } @@ -1581,7 +1581,7 @@ flutter: pluginClass: SomePlugin package: AndroidPackage '''; - _createPubspecFile(pluginYaml); + createPubspecFile(pluginYaml); validatePubspecForPlugin(projectDir: projectDir.absolute.path, pluginClass: 'SomePlugin', expectedPlatforms: [ 'ios', 'macos', 'windows', 'linux', 'android', 'web', ], androidIdentifier: 'AndroidPackage', webFileName: 'lib/SomeFile.dart'); diff --git a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart index 0bf8dcdebb..ef59776651 100644 --- a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart @@ -134,7 +134,7 @@ void main() { fileSystem.file('.packages').writeAsStringSync('\n'); }); - void _setupMocks() { + void setupMocks() { fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('web/index.html').createSync(recursive: true); @@ -180,7 +180,7 @@ void main() { testUsingContext('runner with web server device supports debugging with --start-paused', () { fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); flutterDevice.device = WebServerDevice( logger: BufferLogger.test(), ); @@ -239,7 +239,7 @@ void main() { final BufferLogger logger = BufferLogger.test(); final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice, logger: logger); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( @@ -261,7 +261,7 @@ void main() { ); final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice, debuggingOptions: debuggingOptions); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); residentWebRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC'); final Completer connectionInfoCompleter = Completer(); @@ -279,7 +279,7 @@ void main() { testUsingContext('WebRunner copies compiled app.dill to cache during startup with track-widget-creation', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); residentWebRunner.artifactDirectory.childFile('app.dill').writeAsStringSync('ABC'); final Completer connectionInfoCompleter = Completer(); @@ -297,7 +297,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/60613 testUsingContext('ResidentWebRunner calls appFailedToStart if initial compilation fails', () async { fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fileSystem.file(globals.fs.path.join('lib', 'main.dart')) .createSync(recursive: true); @@ -314,7 +314,7 @@ void main() { testUsingContext('Can successfully run without an index.html including status warning', () async { final BufferLogger logger = BufferLogger.test(); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); fileSystem.file(fileSystem.path.join('web', 'index.html')) .deleteSync(); final ResidentWebRunner residentWebRunner = ResidentWebRunner( @@ -340,7 +340,7 @@ void main() { testUsingContext('Can successfully run and disconnect with --no-resident', () async { fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); final ResidentRunner residentWebRunner = ResidentWebRunner( flutterDevice, flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), @@ -383,7 +383,7 @@ void main() { ), ...kAttachIsolateExpectations, ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -443,7 +443,7 @@ void main() { ), ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -471,7 +471,7 @@ void main() { systemClock: globals.systemClock, ); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( @@ -507,7 +507,7 @@ void main() { }, ), ]); - _setupMocks(); + setupMocks(); final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher(); final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher); chromiumLauncher.setInstance(chrome); @@ -564,7 +564,7 @@ void main() { } ), ]); - _setupMocks(); + setupMocks(); final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher(); final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher); chromiumLauncher.setInstance(chrome); @@ -616,7 +616,7 @@ void main() { systemClock: SystemClock.fixed(DateTime(2001)), ); fakeVmServiceHost = FakeVmServiceHost(requests :kAttachExpectations); - _setupMocks(); + setupMocks(); flutterDevice.device = webServerDevice; webDevFS.report = UpdateFSReport(success: true); @@ -652,7 +652,7 @@ void main() { testUsingContext('Exits when initial compile fails', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.report = UpdateFSReport(); final Completer connectionInfoCompleter = Completer(); @@ -686,7 +686,7 @@ void main() { ), ...kAttachIsolateExpectations, ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -704,7 +704,7 @@ void main() { testUsingContext('Fails on compilation errors in hot restart', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: kAttachExpectations.toList()); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -735,7 +735,7 @@ void main() { }, ), ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -760,7 +760,7 @@ void main() { errorCode: RPCErrorCodes.kInternalError, ), ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -793,7 +793,7 @@ void main() { fakeVmServiceHost = FakeVmServiceHost(requests: [ ...kAttachExpectations, ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -815,7 +815,7 @@ void main() { fakeVmServiceHost = FakeVmServiceHost(requests: [ ...kAttachExpectations, ]); - _setupMocks(); + setupMocks(); final Completer connectionInfoCompleter = Completer(); final Future result = residentWebRunner.run( connectionInfoCompleter: connectionInfoCompleter, @@ -836,7 +836,7 @@ void main() { fakeVmServiceHost = FakeVmServiceHost(requests: [ ...kAttachExpectations, ]); - _setupMocks(); + setupMocks(); mockDevice.name = 'Chromez'; final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( @@ -860,7 +860,7 @@ void main() { ...kAttachLogExpectations, ...kAttachIsolateExpectations, ]); - _setupMocks(); + setupMocks(); final FakeChromeConnection chromeConnection = FakeChromeConnection(); final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher(); final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher); @@ -915,7 +915,7 @@ void main() { testUsingContext('Sends unlaunched app.webLaunchUrl event for Web Server device', () async { final BufferLogger logger = BufferLogger.test(); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); flutterDevice.device = WebServerDevice( logger: logger, ); @@ -1000,7 +1000,7 @@ void main() { final BufferLogger logger = BufferLogger.test(); final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice, logger: logger); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.exception = const WebSocketException(); await expectLater(residentWebRunner.run, throwsToolExit()); @@ -1014,7 +1014,7 @@ void main() { testUsingContext('Successfully turns AppConnectionException into ToolExit', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.exception = AppConnectionException(''); await expectLater(residentWebRunner.run, throwsToolExit()); @@ -1027,7 +1027,7 @@ void main() { testUsingContext('Successfully turns ChromeDebugError into ToolExit', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.exception = ChromeDebugException({}); @@ -1041,7 +1041,7 @@ void main() { testUsingContext('Rethrows unknown Exception type from dwds', () async { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.exception = Exception(); await expectLater(residentWebRunner.run, throwsException); @@ -1055,7 +1055,7 @@ void main() { final BufferLogger logger = BufferLogger.test(); final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice, logger: logger); fakeVmServiceHost = FakeVmServiceHost(requests: []); - _setupMocks(); + setupMocks(); webDevFS.exception = StateError(''); await expectLater(residentWebRunner.run, throwsStateError); diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index 61395bd443..41c60867a2 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -274,7 +274,7 @@ void main() { }); group('$VersionCheckStamp for $channel', () { - void _expectDefault(VersionCheckStamp stamp) { + void expectDefault(VersionCheckStamp stamp) { expect(stamp.lastKnownRemoteVersion, isNull); expect(stamp.lastTimeVersionWasChecked, isNull); expect(stamp.lastTimeWarningWasPrinted, isNull); @@ -283,19 +283,19 @@ void main() { testWithoutContext('loads blank when stamp file missing', () async { cache.versionStamp = null; - _expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); + expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); }); testWithoutContext('loads blank when stamp file is malformed JSON', () async { cache.versionStamp = '<'; - _expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); + expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); }); testWithoutContext('loads blank when stamp file is well-formed but invalid JSON', () async { cache.versionStamp = '[]'; - _expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); + expectDefault(await VersionCheckStamp.load(cache, BufferLogger.test())); }); testWithoutContext('loads valid JSON', () async { diff --git a/packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart b/packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart index f96bf58421..4e3272f7e0 100644 --- a/packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart @@ -21,7 +21,7 @@ void main() { }); // Assigns default values for a complete VS installation with necessary components. - void _configureMockVisualStudioAsInstalled() { + void configureMockVisualStudioAsInstalled() { fakeVisualStudio.isPrerelease = false; fakeVisualStudio.isRebootRequired = false; fakeVisualStudio.fullVersion = '16.2'; @@ -30,7 +30,7 @@ void main() { } // Assigns default values for a complete VS installation that is too old. - void _configureMockVisualStudioAsTooOld() { + void configureMockVisualStudioAsTooOld() { fakeVisualStudio.isAtLeastMinimumVersion = false; fakeVisualStudio.isPrerelease = false; fakeVisualStudio.isRebootRequired = false; @@ -40,7 +40,7 @@ void main() { } // Assigns default values for a missing VS installation. - void _configureMockVisualStudioAsNotInstalled() { + void configureMockVisualStudioAsNotInstalled() { fakeVisualStudio.isInstalled = false; fakeVisualStudio.isAtLeastMinimumVersion = false; fakeVisualStudio.isPrerelease = false; @@ -56,7 +56,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.isPrerelease = true; final ValidationResult result = await validator.validate(); @@ -70,7 +70,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.isComplete = false; final ValidationResult result = await validator.validate(); @@ -85,7 +85,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.isRebootRequired = true; final ValidationResult result = await validator.validate(); @@ -100,7 +100,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.isLaunchable = false; final ValidationResult result = await validator.validate(); @@ -115,7 +115,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsTooOld(); + configureMockVisualStudioAsTooOld(); final ValidationResult result = await validator.validate(); final ValidationMessage expectedMessage = ValidationMessage.error( @@ -134,7 +134,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.hasNecessaryComponents = false; final ValidationResult result = await validator.validate(); @@ -146,7 +146,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); fakeVisualStudio.windows10SDKVersion = null; final ValidationResult result = await validator.validate(); @@ -158,7 +158,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsInstalled(); + configureMockVisualStudioAsInstalled(); final ValidationResult result = await validator.validate(); final ValidationMessage expectedDisplayNameMessage = ValidationMessage( @@ -173,7 +173,7 @@ void main() { userMessages: userMessages, visualStudio: fakeVisualStudio, ); - _configureMockVisualStudioAsNotInstalled(); + configureMockVisualStudioAsNotInstalled(); final ValidationResult result = await validator.validate(); final ValidationMessage expectedMessage = ValidationMessage.error( diff --git a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart index 21c2c67743..7fa3a6638b 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart @@ -36,7 +36,7 @@ void main() { expect(result.stderr, contains(exitMessageContains)); } - void _createDotPackages(String projectPath, [bool nullSafe = false]) { + void createDotPackages(String projectPath, [bool nullSafe = false]) { final StringBuffer flutterRootUri = StringBuffer('file://'); final String canonicalizedFlutterRootPath = fileSystem.path.canonicalize(getFlutterRoot()); if (platform.isWindows) { @@ -84,7 +84,7 @@ void main() { fileSystem.file(fileSystem.path.join(projectPath, 'pubspec.yaml')) ..createSync(recursive: true) ..writeAsStringSync(pubspecYamlSrc); - _createDotPackages(projectPath); + createDotPackages(projectPath); libMain = fileSystem.file(fileSystem.path.join(projectPath, 'lib', 'main.dart')) ..createSync(recursive: true) ..writeAsStringSync(mainDartSrc); diff --git a/packages/flutter_tools/test/integration.shard/flutter_build_android_app_project_builddir_test.dart b/packages/flutter_tools/test/integration.shard/flutter_build_android_app_project_builddir_test.dart index 4053072eea..375f34b45c 100644 --- a/packages/flutter_tools/test/integration.shard/flutter_build_android_app_project_builddir_test.dart +++ b/packages/flutter_tools/test/integration.shard/flutter_build_android_app_project_builddir_test.dart @@ -44,7 +44,7 @@ void main() { tryToDelete(tempDir); }); - void _checkBuildDir() { + void checkBuildDir() { // The android/app/build directory should not exists final Directory appBuildDir = fileSystem.directory(fileSystem.path.join( exampleAppDir.path, @@ -65,7 +65,7 @@ void main() { 'apk', '--target-platform=android-arm', ], workingDirectory: exampleAppDir.path); - _checkBuildDir(); + checkBuildDir(); }, ); @@ -79,7 +79,7 @@ void main() { 'appbundle', '--target-platform=android-arm', ], workingDirectory: exampleAppDir.path); - _checkBuildDir(); + checkBuildDir(); }, ); } diff --git a/packages/flutter_tools/test/integration.shard/forbidden_imports_test.dart b/packages/flutter_tools/test/integration.shard/forbidden_imports_test.dart index 31e3d91c1d..13f9f5d85e 100644 --- a/packages/flutter_tools/test/integration.shard/forbidden_imports_test.dart +++ b/packages/flutter_tools/test/integration.shard/forbidden_imports_test.dart @@ -17,12 +17,12 @@ void main() { fileSystem.path.join(flutterTools, 'lib', 'src', 'commands'), fileSystem.path.join(flutterTools, 'lib', 'src', 'test'), ]; - bool _isNotSkipped(FileSystemEntity entity) => skippedPaths.every((String path) => !entity.path.startsWith(path)); + bool isNotSkipped(FileSystemEntity entity) => skippedPaths.every((String path) => !entity.path.startsWith(path)); final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, 'lib', 'src')) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotSkipped) + .where(isNotSkipped) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -41,13 +41,13 @@ void main() { test('no imports of globals without a global prefix', () { final List skippedPaths = []; - bool _isNotSkipped(FileSystemEntity entity) => skippedPaths.every((String path) => !entity.path.startsWith(path)); + bool isNotSkipped(FileSystemEntity entity) => skippedPaths.every((String path) => !entity.path.startsWith(path)); final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, 'lib', 'src')) .listSync(recursive: true) .followedBy(fileSystem.directory(fileSystem.path.join(flutterTools, 'test',)).listSync(recursive: true)) .where(_isDartFile) - .where(_isNotSkipped) + .where(isNotSkipped) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -70,13 +70,13 @@ void main() { fileSystem.path.join(flutterTools, 'lib', 'src', 'base', 'error_handling_io.dart'), fileSystem.path.join(flutterTools, 'lib', 'src', 'base', 'multi_root_file_system.dart'), ]; - bool _isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); + bool isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); for (final String dirName in ['lib', 'bin']) { final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, dirName)) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotAllowed) + .where(isNotAllowed) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -95,13 +95,13 @@ void main() { // Used only for multi-part file uploads, which are non-trivial to reimplement. fileSystem.path.join(flutterTools, 'lib', 'src', 'reporting', 'crash_reporting.dart'), ]; - bool _isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); + bool isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); for (final String dirName in ['lib', 'bin']) { final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, dirName)) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotAllowed) + .where(isNotAllowed) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -121,13 +121,13 @@ void main() { fileSystem.path.join(flutterTools, 'lib', 'src', 'test', 'flutter_web_platform.dart'), fileSystem.path.join(flutterTools, 'lib', 'src', 'test', 'test_wrapper.dart'), ]; - bool _isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); + bool isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); for (final String dirName in ['lib']) { final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, dirName)) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotAllowed) + .where(isNotAllowed) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -191,13 +191,13 @@ void main() { fileSystem.path.join(flutterTools, 'lib', 'src', 'convert.dart'), fileSystem.path.join(flutterTools, 'lib', 'src', 'base', 'error_handling_io.dart'), ]; - bool _isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); + bool isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => path != entity.path); for (final String dirName in ['lib']) { final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, dirName)) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotAllowed) + .where(isNotAllowed) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) { @@ -219,13 +219,13 @@ void main() { fileSystem.path.join(flutterTools, 'lib', 'devfs_web.dart'), fileSystem.path.join(flutterTools, 'lib', 'resident_web_runner.dart'), ]; - bool _isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => !entity.path.contains(path)); + bool isNotAllowed(FileSystemEntity entity) => allowedPaths.every((String path) => !entity.path.contains(path)); for (final String dirName in ['lib']) { final Iterable files = fileSystem.directory(fileSystem.path.join(flutterTools, dirName)) .listSync(recursive: true) .where(_isDartFile) - .where(_isNotAllowed) + .where(isNotAllowed) .map(_asFile); for (final File file in files) { for (final String line in file.readAsLinesSync()) {