File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
pkgs/hooks_runner/test_data/treeshaking_native_libs/hook Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,14 @@ import 'package:native_toolchain_c/native_toolchain_c.dart';
9
9
10
10
void main (List <String > arguments) async {
11
11
await link (arguments, (input, output) async {
12
+ final asset = input.assets.code.single;
13
+ final packageName = asset.id.split ('/' ).first.replaceAll ('package:' , '' );
14
+ final assetName = asset.id.split ('/' ).skip (1 ).join ('/' );
12
15
final linker = CLinker .library (
13
- name: input. packageName,
14
- assetName: input.assets.code.single.id. split ( '/' ). skip ( 1 ). join ( '/' ) ,
16
+ name: packageName,
17
+ assetName: assetName ,
15
18
linkerOptions: LinkerOptions .treeshake (symbolsToKeep: ['add' ]),
16
- sources: [input.assets.code.single .file! .toFilePath ()],
19
+ sources: [asset .file! .toFilePath ()],
17
20
);
18
21
await linker.run (
19
22
input: input,
You can’t perform that action at this time.
0 commit comments