Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link.dart hook #827

Merged
merged 202 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
5424b7e
Initial commit
mosuem Nov 6, 2023
4993919
Merge branch 'main' into addLinkingScript
mosuem Nov 20, 2023
86108c4
Fixes
mosuem Nov 24, 2023
a739eb8
Merge branch 'main' into addLinkingScript
mosuem Nov 24, 2023
3025ce5
Works now
mosuem Nov 27, 2023
4f77986
Start writing tests
mosuem Nov 27, 2023
f5aef83
Fixing test
mosuem Nov 27, 2023
f8d7498
Merge branch 'main' into addLinkingScript
mosuem Nov 29, 2023
ed23630
Fix merge errors
mosuem Nov 29, 2023
470e356
Fix issues
mosuem Nov 29, 2023
ded78ff
Fix path
mosuem Nov 29, 2023
5ff082f
Fix paths
mosuem Nov 29, 2023
4755b64
Fix paths
mosuem Nov 29, 2023
b376ae1
Rename asset
mosuem Nov 29, 2023
5c205b7
Format
mosuem Nov 29, 2023
30e639f
Add buildType
mosuem Nov 29, 2023
cd92f28
Rename
mosuem Nov 29, 2023
217a340
Remove asset type
mosuem Nov 30, 2023
d7bae1a
Add step serialization
mosuem Nov 30, 2023
e4c5793
Merge branch 'main' into addLinkingScript
mosuem Dec 6, 2023
f916a26
Fix overrides
mosuem Dec 6, 2023
c2f8ecb
Don't check web coverage
mosuem Dec 6, 2023
f0668f1
Merge fixes
mosuem Dec 6, 2023
83c6cdc
Switch to const constructors
mosuem Dec 6, 2023
6bfa254
Don't fail fast
mosuem Dec 6, 2023
e710239
Add override to link
mosuem Dec 6, 2023
a8651cc
Small fixes
mosuem Dec 7, 2023
9d6c1fb
Working on it
mosuem Dec 12, 2023
3edfc66
Merge branch 'main' into addLinkingScript
mosuem Jan 16, 2024
a9967d1
Fixes
mosuem Jan 16, 2024
ffd28a4
More fixes
mosuem Jan 16, 2024
3e68ba5
sort deps
mosuem Jan 16, 2024
137aaed
refactor test
mosuem Jan 17, 2024
3ba833f
Fix bugs
mosuem Jan 17, 2024
771d547
Works now, but ugly
mosuem Jan 18, 2024
5837168
Remove noise
mosuem Jan 18, 2024
13384f8
Fix build.dart
mosuem Jan 18, 2024
43de992
Remove list of assets
mosuem Jan 18, 2024
275ce4c
Add error message
mosuem Jan 19, 2024
fa50a91
Refactorings
mosuem Jan 19, 2024
a5b98cf
Remove step from assets
mosuem Jan 19, 2024
fec0e77
Refactorings
mosuem Jan 19, 2024
aa547cb
Adapt build.dart to existing link.dart
mosuem Jan 19, 2024
7b9dfd9
Merge branch 'main' into addLinkingScript
mosuem Jan 19, 2024
8ed8aa5
Add dep
mosuem Jan 19, 2024
b985808
Adapt docs
mosuem Jan 19, 2024
b3d1d36
Run pub get
mosuem Jan 19, 2024
ee29a5f
Move simple link data
mosuem Jan 19, 2024
5f890f5
Rev versions
mosuem Jan 19, 2024
94a5d42
Add breaking flag to CI
mosuem Jan 19, 2024
6392e45
ignore example
mosuem Jan 19, 2024
e6fed1f
Revert ignore example
mosuem Jan 19, 2024
9aea59c
Add copy flag
mosuem Jan 22, 2024
ab2005e
Fix CLI tests
mosuem Jan 22, 2024
e6091e8
Fix resources
mosuem Jan 22, 2024
e29da52
Fix resources file read
mosuem Jan 22, 2024
84c5335
Add docs
mosuem Jan 22, 2024
f3d82cc
Adapt build.dart and link.dart in the example
mosuem Jan 22, 2024
5da55a0
Don't fail fast
mosuem Jan 22, 2024
dadb61b
Merge branch 'main' into addLinkingScript
mosuem Feb 8, 2024
74e8670
Refactor
mosuem Feb 8, 2024
9cc7330
Merge branch 'main' into addLinkingScript
mosuem Mar 6, 2024
8d1728e
Rename
mosuem Mar 7, 2024
f8f33d6
More rename
mosuem Mar 7, 2024
0b119f3
Cleaning up
mosuem Mar 7, 2024
bf970a9
Simplify
mosuem Mar 7, 2024
b379d40
Give only correct assets
mosuem Mar 7, 2024
2e7c1b4
Simplify even more
mosuem Mar 7, 2024
026f99f
Simplify even more!
mosuem Mar 7, 2024
e7ee258
Simplify even more!!
mosuem Mar 7, 2024
91ec917
Fix
mosuem Mar 7, 2024
9efb650
Works now!
mosuem Mar 7, 2024
e3e71df
Change as per review
mosuem Mar 8, 2024
0016825
Fixes
mosuem Mar 8, 2024
91be8d0
Switch to wip version
mosuem Mar 8, 2024
77aad91
Skip link test for now
mosuem Mar 8, 2024
d46741a
Fix warnings
mosuem Mar 8, 2024
6611f5e
Add publish_to: none
mosuem Mar 8, 2024
bbf64b6
Fix example
mosuem Mar 8, 2024
f5a3feb
Fix issues
mosuem Mar 8, 2024
a280e4d
Fix tests
mosuem Mar 8, 2024
6abb07a
Fix build.dart
mosuem Mar 8, 2024
09beb27
Merge branch 'main' into addLinkingScript
mosuem Mar 21, 2024
86c4ee3
Fix cli_config version
mosuem Mar 21, 2024
50f77fc
Fix issues
mosuem Mar 21, 2024
5ca2b56
Fixes
mosuem Mar 22, 2024
0459384
Fix analyze issues
mosuem Mar 22, 2024
193161c
use build version for link config
mosuem Mar 22, 2024
bea90bb
Fixes
mosuem Mar 22, 2024
c61a18b
Test runs now!
mosuem Mar 22, 2024
136a1a0
Fix tests
mosuem Mar 22, 2024
1dd66ed
Merge branch 'main' into addLinkingScript
mosuem Mar 22, 2024
46afccb
Fix versions
mosuem Mar 22, 2024
5126a60
Fix tests again
mosuem Mar 22, 2024
627d6da
Fix file null test
mosuem Mar 22, 2024
b7e2dd9
Merge branch 'main' into addLinkingScript
mosuem Mar 25, 2024
facf256
Fix tests for windows
mosuem Mar 25, 2024
3e31906
Fix example deps
mosuem Mar 25, 2024
e465564
Remove skip
mosuem Mar 25, 2024
9e22a2d
Fix tests for windows 2
mosuem Mar 25, 2024
d978f11
Fix paths
mosuem Mar 25, 2024
8ab3152
Read uri as files
mosuem Mar 25, 2024
dddab2a
Fix file
mosuem Mar 25, 2024
c27dc43
Fix example
mosuem Mar 25, 2024
858f62e
First changes as per review
mosuem Mar 26, 2024
4530a1a
Merge branch 'main' into addLinkingScript
mosuem Mar 26, 2024
be3965a
Second changes as per review
mosuem Mar 26, 2024
7e6f2cf
Third changes as per review
mosuem Mar 26, 2024
4515729
Fix test
mosuem Mar 26, 2024
9faa86e
Merge branch 'main' into addLinkingScript
mosuem Mar 26, 2024
4df6f2d
Fix link script
mosuem Mar 26, 2024
5c6937d
Works
mosuem Mar 26, 2024
561fcaf
Different classes for different results
mosuem Mar 26, 2024
b193ce0
Add new test
mosuem Mar 27, 2024
8e7de31
Fix analysis issues
mosuem Mar 27, 2024
6670db5
More changes as per review
mosuem Mar 27, 2024
06bb6ca
Remove example
mosuem Mar 27, 2024
dcc81c5
Fix tests
mosuem Mar 27, 2024
762c2d3
Fix workflow
mosuem Mar 27, 2024
ff7696b
Refactor `BuildResult`
mosuem Mar 27, 2024
3e1d50b
Rewire linkoutput
mosuem Mar 27, 2024
da9fda7
Fix pubspecs of examples
mosuem Mar 27, 2024
b868be6
Move examples
mosuem Mar 28, 2024
f1514e5
Fix workflow
mosuem Mar 28, 2024
723b76b
Rename in workflow
mosuem Mar 28, 2024
1481bb0
Fix id
mosuem Mar 28, 2024
364f477
Fix example
mosuem Mar 28, 2024
3ff9396
Do not serialize empty fields
mosuem Mar 28, 2024
e21d1fa
pathseparator helper
mosuem Mar 28, 2024
a4486c5
Add helper to toolchain c
mosuem Mar 28, 2024
3c6ddf9
Resolve nits
mosuem Apr 4, 2024
9bff0b7
Show output when throwing
mosuem Apr 4, 2024
0302ac1
Add example
mosuem Apr 4, 2024
e1979e5
Add dependencies to linkoutput
mosuem Apr 4, 2024
c9f9e30
Adapt cbuilder to linking static libraries
mosuem Apr 4, 2024
1d61a35
Add to workflow
mosuem Apr 4, 2024
348adba
Remove example SDK constraint
mosuem Apr 4, 2024
628b76a
Small changes
mosuem Apr 8, 2024
9d380ec
Fix error
mosuem Apr 8, 2024
90bdc30
Fix error
mosuem Apr 8, 2024
35ce8c8
Fix paths for windows
mosuem Apr 8, 2024
e4c7274
Comment out CI for linking
mosuem Apr 8, 2024
d59ac14
Add docs
mosuem Apr 9, 2024
63bf1fa
Restrict linking assets
mosuem Apr 9, 2024
9ba15f2
Sort into separate file
mosuem Apr 9, 2024
d223fb0
Changes as per review
mosuem Apr 9, 2024
6133521
Address comments
mosuem Apr 9, 2024
103945d
Fix issue
mosuem Apr 9, 2024
f84fa17
Changes as per review
mosuem Apr 10, 2024
c882ee9
Fix tests
mosuem Apr 10, 2024
e3dfa21
Add test
mosuem Apr 10, 2024
b248d3c
Do not delete asset file
mosuem Apr 10, 2024
6800853
Merge branch 'main' into addLinkingScript
mosuem Apr 10, 2024
0f8eb1f
Add licenses
mosuem Apr 10, 2024
0f3e9c3
Add common config
mosuem Apr 11, 2024
58ba0c0
Export HookConfig
mosuem Apr 11, 2024
218bfa6
Fix issues
mosuem Apr 12, 2024
21402dc
Fix API
mosuem Apr 12, 2024
4b0df6a
Make arguments optional
mosuem Apr 12, 2024
c19dc83
Revert linkable assets
mosuem Apr 12, 2024
3955ea9
Export ResourceIdentifiers
mosuem Apr 12, 2024
3d8ed4a
Fix import
mosuem Apr 12, 2024
b88c152
Fix dep
mosuem Apr 12, 2024
c33d5dd
Fix linking id check
mosuem Apr 15, 2024
95a6479
Copy over more files
mosuem Apr 15, 2024
53ab489
Changes as per review
mosuem Apr 16, 2024
c24e422
Unify `configFile`
mosuem Apr 16, 2024
725bdd7
Make resources nullable
mosuem Apr 16, 2024
4903e37
Only expose iterable
mosuem Apr 17, 2024
b9e6c40
Make HookConfig implement the API
mosuem Apr 17, 2024
54d4d4c
Fix testdata
mosuem Apr 17, 2024
451fcd8
Inline linkconfigargs
mosuem Apr 17, 2024
986b9c7
Revert "Inline linkconfigargs"
mosuem Apr 17, 2024
6d1a7ac
Rename resources
mosuem Apr 17, 2024
8515785
Format docs
mosuem Apr 17, 2024
c07cf26
Reduce config usage
mosuem Apr 17, 2024
e569edb
Fixing up buildconfig
mosuem Apr 17, 2024
4a5ad33
Fix args
mosuem Apr 17, 2024
74c7471
Add tests
mosuem Apr 19, 2024
61e70dc
Fix analyze issues
mosuem Apr 19, 2024
2b12373
Fix imports
mosuem Apr 19, 2024
542466a
Add some debugging info to exceptions
mosuem Apr 25, 2024
334a6ce
Add linkModePreference to link config as well
mosuem May 2, 2024
e21c5f0
More changes as per review
mosuem May 2, 2024
9b4855f
Add version to linkoutput
mosuem May 2, 2024
ed4628b
Squashed commit of the following:
mosuem May 2, 2024
2b0272c
Merge branch 'main' into addLinkingScript
mosuem May 2, 2024
987296c
Fix analyzer issues
mosuem May 2, 2024
49914d7
Fix tests
mosuem May 2, 2024
3f5bd87
Remove resources from protocol
mosuem May 2, 2024
bf76046
Add another example
mosuem May 3, 2024
0950ec6
Remove wrong example from CI
mosuem May 3, 2024
49ec442
Add to manifest
mosuem May 3, 2024
884c505
Fix test
mosuem May 3, 2024
14a856c
Move resource test
mosuem May 6, 2024
9e55614
Add argument to drop dylib testcase
mosuem May 6, 2024
50ecb95
Add test project adding assets in link
mosuem May 7, 2024
4e7ba0e
Add to manifest
mosuem May 7, 2024
2532c8b
Rename
mosuem May 7, 2024
12076be
Add todo
mosuem May 7, 2024
60604a2
Refactor add link asset test
mosuem May 8, 2024
e3d9b0e
Adapt casing
mosuem May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const packageName = 'treeshaking_native_assets';

void main(List<String> arguments) async {
await link(arguments, (config, output) async {
final usedSymbols = config.treeshakingInformation
?.map((resource) => resource.metadata.toString());
final List<String>? usedSymbols = [];
final dynamicLibrary = config.assets.firstWhere((asset) =>
asset.id == 'package:$packageName/src/${packageName}_bindings.dart');
final staticLibrary = config.assets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import 'package:native_assets_cli/native_assets_cli.dart';

void main(List<String> args) async {
await link(args, (config, output) async {
final assetsWithResource = config.assets.whereType<DataAsset>().where(
(asset) =>
config.treeshakingInformation
?.any((resource) => resource.metadata == asset.name) ??
true);
output.addAssets(assetsWithResource);
final dataAssets = config.assets.whereType<DataAsset>();
mosuem marked this conversation as resolved.
Show resolved Hide resolved
output.addAssets(dataAssets);
});
}
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/native_assets_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ export 'src/api/link.dart';
export 'src/api/link_config.dart' show LinkConfig;
export 'src/api/link_mode_preference.dart' show LinkModePreference;
export 'src/api/os.dart' show OS;
export 'src/api/resource.dart';
1 change: 0 additions & 1 deletion pkgs/native_assets_cli/lib/native_assets_cli_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export 'src/api/ios_sdk.dart' show IOSSdkImpl;
export 'src/api/link_config.dart' show LinkConfigImpl;
export 'src/api/link_mode_preference.dart' show LinkModePreferenceImpl;
export 'src/api/os.dart' show OSImpl;
export 'src/api/resource.dart';
export 'src/model/dependencies.dart';
export 'src/model/hook.dart';
export 'src/model/metadata.dart';
Expand Down
13 changes: 3 additions & 10 deletions pkgs/native_assets_cli/lib/src/api/link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@ import 'link_config.dart';
/// through [LinkConfig.assets]. They will only be bundled with the final
/// application if included in the [LinkOutput].
///
/// As the linking runs after kernel compilation, you can use treeshaking
/// information provided through [LinkConfig.treeshakingInformation] to decide
/// which assets to include. The resources are only collected in AOT mode,
/// therefore the field is null in JIT mode.
///
///
/// ```dart
/// import 'package:native_assets_cli/native_assets_cli.dart';
///
/// void main(List<String> args) async {
/// await link(args, (config, output) async {
/// final assetsWithResource = config.assets
/// .whereType<DataAsset>()
/// .where((asset) => config.resources
/// .any((resource) => resource.metadata == asset.name));
/// output.addAssets(assetsWithResource);
/// final dataAssets = config.assets
/// .whereType<DataAsset>();
/// output.addAssets(dataAssets);
/// });
/// }
/// ```
Expand Down
17 changes: 1 addition & 16 deletions pkgs/native_assets_cli/lib/src/api/link_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:collection/collection.dart';
import 'package:pub_semver/pub_semver.dart';

import '../model/hook.dart';
import '../model/resource_identifiers.dart';
import '../utils/map.dart';
import 'architecture.dart';
import 'asset.dart';
Expand All @@ -20,28 +19,18 @@ import 'hook_config.dart';
import 'ios_sdk.dart';
import 'link_mode_preference.dart';
import 'os.dart';
import 'resource.dart';

part '../model/link_config.dart';

/// The configuration for a link hook (`hook/link.dart`) invocation.
///
/// It consists of a subset of the fields from the [BuildConfig] already passed
/// to the build hook, the [assets] from the build step, and the
/// [treeshakingInformation] generated during the kernel compilation.
/// to the build hook and the [assets] from the build step.
abstract class LinkConfig implements HookConfig {
/// The list of assets to be linked. These are the assets generated by a
/// `build.dart` script destined for this packages `link.dart`.
Iterable<Asset> get assets;

/// A collection of methods annotated with `@ResourceIdentifier`, which are
/// called in the tree-shaken Dart code. This information can be used to
/// dispose unused [assets].
///
/// This is `null` in JIT mode, where no resources are collected, or in a dry
/// run.
Iterable<Resource>? get treeshakingInformation;

/// Generate the [LinkConfig] from the input arguments to the linking script.
factory LinkConfig.fromArguments(List<String> arguments) =>
LinkConfigImpl.fromArguments(arguments);
Expand All @@ -58,14 +47,12 @@ abstract class LinkConfig implements HookConfig {
List<String>? supportedAssetTypes,
int? targetAndroidNdkApi,
required Iterable<Asset> assets,
Uri? resourceIdentifierUri,
required LinkModePreference linkModePreference,
bool? dryRun,
Version? version,
}) =>
LinkConfigImpl(
assets: assets.cast(),
resourceIdentifierUri: resourceIdentifierUri,
outputDirectory: outputDirectory,
packageName: packageName,
packageRoot: packageRoot,
Expand All @@ -88,13 +75,11 @@ abstract class LinkConfig implements HookConfig {
required OS targetOS,
List<String>? supportedAssetTypes,
required Iterable<Asset> assets,
Uri? resourceIdentifierUri,
required LinkModePreference linkModePreference,
Version? version,
}) =>
LinkConfigImpl.dryRun(
assets: assets.cast(),
resourceIdentifierUri: resourceIdentifierUri,
outputDirectory: outputDirectory,
packageName: packageName,
packageRoot: packageRoot,
Expand Down
45 changes: 0 additions & 45 deletions pkgs/native_assets_cli/lib/src/api/resource.dart

This file was deleted.

27 changes: 4 additions & 23 deletions pkgs/native_assets_cli/lib/src/model/link_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,10 @@

part of '../api/link_config.dart';

List<Resource>? fromIdentifiers(ResourceIdentifiers resourceIdentifiers) =>
resourceIdentifiers.identifiers
.map((e) => Resource(name: e.name, metadata: e.id))
.toList();

/// The input to the linking script.
///
/// It consists of the fields inherited from the [HookConfig], the [assets] from
/// the build step, and the [treeshakingInformation] generated during the kernel
/// compilation.
/// It consists of the fields inherited from the [HookConfig] and the [assets]
/// from the build step.
class LinkConfigImpl extends HookConfigImpl implements LinkConfig {
static const resourceIdentifierKey = 'resource_identifiers';

Expand All @@ -22,17 +16,8 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig {
@override
final Iterable<AssetImpl> assets;

Iterable<Resource>? _treeshakingInformation;

@override
Iterable<Resource>? get treeshakingInformation {
if (_resourceIdentifierUri != null && _treeshakingInformation == null) {
_treeshakingInformation = fromIdentifiers(
ResourceIdentifiers.fromFile(_resourceIdentifierUri.toFilePath()));
}
return _treeshakingInformation;
}

// TODO: Placeholder for the resources.json file URL. We don't want to change
// native_assets_builder when implementing the parsing.
final Uri? _resourceIdentifierUri;
mosuem marked this conversation as resolved.
Show resolved Hide resolved

LinkConfigImpl({
Expand Down Expand Up @@ -69,10 +54,6 @@ class LinkConfigImpl extends HookConfigImpl implements LinkConfig {
required super.linkModePreference,
required super.targetOS,
}) : _resourceIdentifierUri = resourceIdentifierUri,
_treeshakingInformation = resourceIdentifierUri != null
? fromIdentifiers(ResourceIdentifiers.fromFile(
resourceIdentifierUri.toFilePath()))
: null,
super.dryRun(
hook: Hook.link,
version: version ?? HookConfigImpl.latestVersion,
Expand Down
6 changes: 0 additions & 6 deletions pkgs/native_assets_cli/test/api/resource_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
// for details. 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/src/api/resource.dart';
import 'package:native_assets_cli/src/model/resource_identifiers.dart';
mosuem marked this conversation as resolved.
Show resolved Hide resolved

final resourceList = [
Resource(name: 'methodName1', metadata: 'someMetadata'),
Resource(name: 'methodName2', metadata: 'someOtherMetadata'),
];

const resourceFile = '''{
"_comment": "Resources referenced by annotated resource identifiers",
"AppTag": "TBD",
Expand Down
14 changes: 0 additions & 14 deletions pkgs/native_assets_cli/test/api/resource_test.dart

This file was deleted.

27 changes: 1 addition & 26 deletions pkgs/native_assets_cli/test/model/link_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:convert';
import 'dart:io';

import 'package:native_assets_cli/native_assets_cli.dart';
import 'package:native_assets_cli/native_assets_cli_internal.dart';
import 'package:native_assets_cli/src/api/asset.dart';
import 'package:test/test.dart';

import '../api/resource_data.dart';

void main() async {
late Uri tempUri;
late Uri outDirUri;
Expand Down Expand Up @@ -59,8 +56,7 @@ void main() async {
fakeVcVars = tempUri.resolve('vcvarsall.bat');
await File.fromUri(fakeVcVars).create();
resources = tempUri.resolve('resources.json');
final file = File.fromUri(resources)..createSync();
file.writeAsStringSync(jsonEncode(resourceIdentifiers));
File.fromUri(resources).createSync();
});

tearDown(() async {
Expand Down Expand Up @@ -115,8 +111,6 @@ void main() async {
true);
expect(config1.cCompiler != config2.cCompiler, true);
expect(config1.assets != config2.assets, true);
expect(
config1.treeshakingInformation != config2.treeshakingInformation, true);
});

test('LinkConfig fromConfig', () {
Expand Down Expand Up @@ -196,25 +190,6 @@ void main() async {
final fromConfig = LinkConfigImpl.fromJson(configFile);
expect(fromConfig, equals(buildConfig1));
});
test('LinkConfig fetch treeshaking information', () {
final buildConfig1 = LinkConfigImpl(
outputDirectory: outDirUri,
packageName: packageName,
packageRoot: packageRootUri,
targetArchitecture: ArchitectureImpl.arm64,
targetOS: OSImpl.iOS,
targetIOSSdk: IOSSdkImpl.iPhoneOS,
cCompiler: CCompilerConfigImpl(
compiler: fakeClang,
linker: fakeLd,
),
buildMode: BuildModeImpl.release,
assets: assets,
resourceIdentifierUri: resources,
linkModePreference: LinkModePreferenceImpl.preferStatic,
);
expect(buildConfig1.treeshakingInformation, resourceList);
});

test('LinkConfig toJson fromJson', () {
final outDir = outDirUri;
Expand Down