flutter/dev/integration_tests/link_hook/hook/link.dart
Daco Harkes dec31cbab6
[native_assets] Roll dependencies (#166282)
Updating the dart-lang/native dependencies to the ones published today.

No functional changes, but `CodeAsset` does not expose an `architecture`
and `os ` anymore (https://github.com/dart-lang/native/issues/2127).
Instead these should be taken from what is passed in for the
`CodeConfig`. This PR refactors the `DartBuildResult` to carry around
the `Target` with `CodeAsset`s as `FlutterCodeAsset`s.

(This PR avoid refactoring relevant code due to
https://github.com/flutter/flutter/pull/164094 already refactoring this
code.)
2025-04-03 05:42:31 +00:00

27 lines
865 B
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:native_assets_cli/code_assets.dart';
void main(List<String> args) async {
await link(args, (LinkInput input, LinkOutputBuilder output) async {
if (!input.config.buildCodeAssets) {
return;
}
final CodeAsset asset = input.assets.code.single;
final String packageName = input.packageName;
output.assets.code.add(
CodeAsset(
package: packageName,
// Change the asset id to something that is used.
name: '${packageName}_bindings_generated.dart',
linkMode: asset.linkMode,
os: input.config.code.targetOS,
architecture: input.config.code.targetArchitecture,
file: asset.file,
),
);
});
}