From 883ef854134c55470cb437a7cb93749cf8825f5d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 21 Jan 2025 00:04:38 +0100 Subject: [PATCH] [native assets] Cleanup dead code (#161913) This PR deletes dead code. Testing: No new use cases covered, all existing use cases covered by existing tests. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --- .../lib/src/build_system/targets/native_assets.dart | 1 - .../lib/src/isolated/native_assets/native_assets.dart | 8 -------- .../src/isolated/native_assets/test/native_assets.dart | 1 - .../general.shard/isolated/linux/native_assets_test.dart | 1 - .../general.shard/isolated/macos/native_assets_test.dart | 1 - .../isolated/windows/native_assets_test.dart | 1 - 6 files changed, 13 deletions(-) diff --git a/packages/flutter_tools/lib/src/build_system/targets/native_assets.dart b/packages/flutter_tools/lib/src/build_system/targets/native_assets.dart index cfe7f6aac2..4187324d65 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/native_assets.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/native_assets.dart @@ -42,7 +42,6 @@ abstract class DartBuild extends Target { final FlutterNativeAssetsBuildRunner buildRunner = _buildRunner ?? FlutterNativeAssetsBuildRunnerImpl( - projectUri, environment.packageConfigPath, packageConfig, fileSystem, diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart index a63fcc4bc3..275ac73209 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart @@ -193,14 +193,12 @@ abstract interface class FlutterNativeAssetsBuildRunner { /// Uses `package:native_assets_builder` for its implementation. class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunner { FlutterNativeAssetsBuildRunnerImpl( - this.projectUri, this.packageConfigPath, this.packageConfig, this.fileSystem, this.logger, ); - final Uri projectUri; final String packageConfigPath; final PackageConfig packageConfig; final FileSystem fileSystem; @@ -235,14 +233,8 @@ class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunn logger: _logger, dartExecutable: _dartExecutable, fileSystem: fileSystem, - hookEnvironment: filteredEnvironment(NativeAssetsBuildRunner.hookEnvironmentVariablesFilter), ); - static Map filteredEnvironment(Set allowList) => { - for (final MapEntry entry in const LocalPlatform().environment.entries) - if (allowList.contains(entry.key.toUpperCase())) entry.key: entry.value, - }; - @override Future hasPackageConfig() { return fileSystem.file(packageConfigPath).exists(); diff --git a/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart b/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart index a09a057bcc..1120555fdd 100644 --- a/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart +++ b/packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart @@ -30,7 +30,6 @@ Future testCompilerBuildNativeAssets(BuildInfo buildInfo) async { } final Uri projectUri = FlutterProject.current().directory.uri; final FlutterNativeAssetsBuildRunner buildRunner = FlutterNativeAssetsBuildRunnerImpl( - projectUri, buildInfo.packageConfigPath, buildInfo.packageConfig, globals.fs, diff --git a/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart index d08b8331f1..29b114ab17 100644 --- a/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/linux/native_assets_test.dart @@ -112,7 +112,6 @@ void main() { logger: environment.logger, ); final FlutterNativeAssetsBuildRunner runner = FlutterNativeAssetsBuildRunnerImpl( - projectUri, packageConfigFile.path, packageConfig, fileSystem, diff --git a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart index c978a5bc3b..1f46e769f8 100644 --- a/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart @@ -397,7 +397,6 @@ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault logger: environment.logger, ); final FlutterNativeAssetsBuildRunner runner = FlutterNativeAssetsBuildRunnerImpl( - projectUri, packageConfigFile.path, packageConfig, fileSystem, diff --git a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart index 61612dae0c..d768db9b3b 100644 --- a/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart +++ b/packages/flutter_tools/test/general.shard/isolated/windows/native_assets_test.dart @@ -264,7 +264,6 @@ void main() { logger: environment.logger, ); final FlutterNativeAssetsBuildRunner runner = FlutterNativeAssetsBuildRunnerImpl( - projectUri, packageConfigFile.path, packageConfig, fileSystem,