Skip to content

[code_assets] Code Assets depending on other code assets #3248

@dcharkes

Description

@dcharkes

We added support for code assets depending on code assets in:

However, once we start adding support for tree-shaking we will need to also tell the Dart/Flutter SDK to not tree-shake dylibs that are used by other dylibs. Something along the lines of:

void main(List<String> args) async {
  await build(args, (input, output) async {
    if (input.config.buildCodeAssets) {
      output.assets.code.add(
        CodeAsset(
          package: packageName,
          name: '...',
          linkMode: DynamicLoadingBundled(),
          file: assetPathInPackage,
          // something like this:
          runtimeDependencies: [
            CodeAsset(
              package: 'android_libcpp_shared',
              name: 'libc++_shared.so',
            ),
          ],
        ),
      );
    }
  });
}

Related:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions