Unverified Commit 634b326e authored by Daco Harkes's avatar Daco Harkes Committed by GitHub

Reapply "Native assets: roll deps" (#141748) (#141864)

Fixes https://github.com/flutter/flutter/issues/141827

Reland: https://dart-review.googlesource.com/c/sdk/+/346960 has rolled into g3, so the imports should now resolve in g3 as well.

> [!CAUTION]
> _Do NOT merge if "Google Testing" bot didn't run!_

Rolls the packages from https://github.com/dart-lang/native in the native assets implementation.

Most notable we're refactoring `package:native_assets_cli` for `build.dart` use.
Therefore, all imports to that package for Flutter/Dart should be to the implementation internals that are no longer visible for `build.dart` writers. Hence all the import updates.

No behavior in Flutter apps should change.

This PR also updates the template to use the latests version of `package:native_assets_cli` which no longer exposes all the implementation details.
parent ce97e34d
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
import 'package:native_assets_builder/native_assets_builder.dart' import 'package:native_assets_builder/native_assets_builder.dart'
show BuildResult, DryRunResult; show BuildResult, DryRunResult;
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:native_assets_cli/native_assets_cli.dart' show Asset; import 'package:native_assets_cli/native_assets_cli_internal.dart' show Asset;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../android/gradle_utils.dart'; import '../../android/gradle_utils.dart';
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
import 'package:native_assets_builder/native_assets_builder.dart' import 'package:native_assets_builder/native_assets_builder.dart'
show BuildResult, DryRunResult; show BuildResult, DryRunResult;
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../build_info.dart'; import '../build_info.dart';
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
hide BuildMode;
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
import 'package:native_assets_builder/native_assets_builder.dart' import 'package:native_assets_builder/native_assets_builder.dart'
show BuildResult, DryRunResult; show BuildResult, DryRunResult;
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../build_info.dart'; import '../build_info.dart';
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
// Shared logic between iOS and macOS implementations of native assets. // Shared logic between iOS and macOS implementations of native assets.
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
hide BuildMode;
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import 'package:logging/logging.dart' as logging; import 'package:logging/logging.dart' as logging;
import 'package:native_assets_builder/native_assets_builder.dart' hide NativeAssetsBuildRunner; import 'package:native_assets_builder/native_assets_builder.dart' hide NativeAssetsBuildRunner;
import 'package:native_assets_builder/native_assets_builder.dart' as native_assets_builder show NativeAssetsBuildRunner; import 'package:native_assets_builder/native_assets_builder.dart' as native_assets_builder show NativeAssetsBuildRunner;
import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart';
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import 'android/native_assets.dart'; import 'android/native_assets.dart';
......
...@@ -28,6 +28,4 @@ const Map<String, String> kManuallyPinnedDependencies = <String, String>{ ...@@ -28,6 +28,4 @@ const Map<String, String> kManuallyPinnedDependencies = <String, String>{
'test_api': '0.6.1', // https://github.com/flutter/flutter/issues/140169 'test_api': '0.6.1', // https://github.com/flutter/flutter/issues/140169
'test_core': '0.5.9', // https://github.com/flutter/flutter/issues/140169 'test_core': '0.5.9', // https://github.com/flutter/flutter/issues/140169
'test': '1.24.9', // https://github.com/flutter/flutter/issues/140169 'test': '1.24.9', // https://github.com/flutter/flutter/issues/140169
'native_assets_builder': '0.3.0', // https://github.com/flutter/flutter/pull/141814
'native_assets_cli': '0.3.2', // https://github.com/flutter/flutter/pull/141814
}; };
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode; import 'package:native_assets_cli/native_assets_cli_internal.dart'
hide BuildMode;
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../build_info.dart'; import '../build_info.dart';
......
...@@ -55,8 +55,8 @@ dependencies: ...@@ -55,8 +55,8 @@ dependencies:
cli_config: 0.1.2 cli_config: 0.1.2
graphs: 2.3.1 graphs: 2.3.1
native_assets_builder: 0.3.0 native_assets_builder: 0.3.2
native_assets_cli: 0.3.2 native_assets_cli: 0.4.1
# We depend on very specific internal implementation details of the # We depend on very specific internal implementation details of the
# 'test' package, which change between versions, so when upgrading # 'test' package, which change between versions, so when upgrading
...@@ -118,4 +118,4 @@ dartdoc: ...@@ -118,4 +118,4 @@ dartdoc:
# Exclude this package from the hosted API docs. # Exclude this package from the hosted API docs.
nodoc: true nodoc: true
# PUBSPEC CHECKSUM: cf69 # PUBSPEC CHECKSUM: 9e6b
...@@ -9,8 +9,8 @@ environment: ...@@ -9,8 +9,8 @@ environment:
dependencies: dependencies:
cli_config: ^0.1.2 cli_config: ^0.1.2
logging: ^1.2.0 logging: ^1.2.0
native_assets_cli: ^0.3.2 native_assets_cli: ^0.4.1
native_toolchain_c: ^0.3.2 native_toolchain_c: ^0.3.4+1
dev_dependencies: dev_dependencies:
ffi: ^2.1.0 ffi: ^2.1.0
......
...@@ -15,8 +15,10 @@ import 'package:flutter_tools/src/build_info.dart'; ...@@ -15,8 +15,10 @@ import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/build_system/build_system.dart'; import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; as native_assets_cli;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
hide BuildMode, Target;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../src/common.dart'; import '../../src/common.dart';
......
...@@ -13,7 +13,8 @@ import 'package:flutter_tools/src/build_system/exceptions.dart'; ...@@ -13,7 +13,8 @@ import 'package:flutter_tools/src/build_system/exceptions.dart';
import 'package:flutter_tools/src/build_system/targets/native_assets.dart'; import 'package:flutter_tools/src/build_system/targets/native_assets.dart';
import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config.dart' show Package; import 'package:package_config/package_config.dart' show Package;
import '../../../src/common.dart'; import '../../../src/common.dart';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/native_assets.dart';
import 'package:native_assets_builder/native_assets_builder.dart' import 'package:native_assets_builder/native_assets_builder.dart'
as native_assets_builder; as native_assets_builder;
import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart';
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
/// Mocks all logic instead of using `package:native_assets_builder`, which /// Mocks all logic instead of using `package:native_assets_builder`, which
......
...@@ -21,8 +21,10 @@ import 'package:flutter_tools/src/resident_devtools_handler.dart'; ...@@ -21,8 +21,10 @@ import 'package:flutter_tools/src/resident_devtools_handler.dart';
import 'package:flutter_tools/src/resident_runner.dart'; import 'package:flutter_tools/src/resident_runner.dart';
import 'package:flutter_tools/src/run_hot.dart'; import 'package:flutter_tools/src/run_hot.dart';
import 'package:flutter_tools/src/vmservice.dart'; import 'package:flutter_tools/src/vmservice.dart';
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config.dart'; import 'package:package_config/package_config.dart';
import 'package:test/fake.dart'; import 'package:test/fake.dart';
import 'package:unified_analytics/unified_analytics.dart'; import 'package:unified_analytics/unified_analytics.dart';
......
...@@ -14,8 +14,10 @@ import 'package:flutter_tools/src/build_system/build_system.dart'; ...@@ -14,8 +14,10 @@ import 'package:flutter_tools/src/build_system/build_system.dart';
import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/ios/native_assets.dart'; import 'package:flutter_tools/src/ios/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../src/common.dart'; import '../../src/common.dart';
......
...@@ -17,8 +17,10 @@ import 'package:flutter_tools/src/features.dart'; ...@@ -17,8 +17,10 @@ import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/linux/native_assets.dart'; import 'package:flutter_tools/src/linux/native_assets.dart';
import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../src/common.dart'; import '../../src/common.dart';
......
...@@ -15,8 +15,10 @@ import 'package:flutter_tools/src/features.dart'; ...@@ -15,8 +15,10 @@ import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/macos/native_assets.dart'; import 'package:flutter_tools/src/macos/native_assets.dart';
import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../src/common.dart'; import '../../src/common.dart';
......
...@@ -36,9 +36,10 @@ import 'package:flutter_tools/src/run_cold.dart'; ...@@ -36,9 +36,10 @@ import 'package:flutter_tools/src/run_cold.dart';
import 'package:flutter_tools/src/run_hot.dart'; import 'package:flutter_tools/src/run_hot.dart';
import 'package:flutter_tools/src/version.dart'; import 'package:flutter_tools/src/version.dart';
import 'package:flutter_tools/src/vmservice.dart'; import 'package:flutter_tools/src/vmservice.dart';
import 'package:native_assets_cli/native_assets_cli.dart' import 'package:native_assets_cli/native_assets_cli_internal.dart'
hide BuildMode, Target; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config.dart'; import 'package:package_config/package_config.dart';
import 'package:test/fake.dart'; import 'package:test/fake.dart';
import 'package:unified_analytics/src/enums.dart'; import 'package:unified_analytics/src/enums.dart';
......
...@@ -16,8 +16,10 @@ import 'package:flutter_tools/src/features.dart'; ...@@ -16,8 +16,10 @@ import 'package:flutter_tools/src/features.dart';
import 'package:flutter_tools/src/globals.dart' as globals; import 'package:flutter_tools/src/globals.dart' as globals;
import 'package:flutter_tools/src/native_assets.dart'; import 'package:flutter_tools/src/native_assets.dart';
import 'package:flutter_tools/src/windows/native_assets.dart'; import 'package:flutter_tools/src/windows/native_assets.dart';
import 'package:native_assets_cli/native_assets_cli.dart' hide BuildMode, Target; import 'package:native_assets_cli/native_assets_cli_internal.dart'
import 'package:native_assets_cli/native_assets_cli.dart' as native_assets_cli; hide BuildMode, Target;
import 'package:native_assets_cli/native_assets_cli_internal.dart'
as native_assets_cli;
import 'package:package_config/package_config_types.dart'; import 'package:package_config/package_config_types.dart';
import '../../src/common.dart'; import '../../src/common.dart';
......
...@@ -19,7 +19,7 @@ import 'package:file/file.dart'; ...@@ -19,7 +19,7 @@ import 'package:file/file.dart';
import 'package:file_testing/file_testing.dart'; import 'package:file_testing/file_testing.dart';
import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/base/os.dart'; import 'package:flutter_tools/src/base/os.dart';
import 'package:native_assets_cli/native_assets_cli.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart';
import '../src/common.dart'; import '../src/common.dart';
import 'test_utils.dart' show ProcessResultMatcher, fileSystem, platform; import 'test_utils.dart' show ProcessResultMatcher, fileSystem, platform;
...@@ -230,7 +230,7 @@ void main() { ...@@ -230,7 +230,7 @@ void main() {
// Overrides the build to output static libraries. // Overrides the build to output static libraries.
final String buildDotDartContentsNew = buildDotDartContents.replaceFirst( final String buildDotDartContentsNew = buildDotDartContents.replaceFirst(
'final buildConfig = await BuildConfig.fromArgs(args);', 'final buildConfig = await BuildConfig.fromArgs(args);',
r''' '''
final buildConfig = await BuildConfig.fromArgs([ final buildConfig = await BuildConfig.fromArgs([
'-D${LinkModePreference.configKey}=${LinkModePreference.static}', '-D${LinkModePreference.configKey}=${LinkModePreference.static}',
...args, ...args,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment