[native_assets_builder] Separate `KernelAsset`s from `Asset`s (#964)

There are multiple differences between the `native_assets.yaml` that is embedded in the kernel file and the `build_output.yaml -> assets`. 

* Based on the discussions on https://github.com/dart-lang/native/pull/955 and https://github.com/dart-lang/native/pull/946, it is clear that the `path` for assets should be in `Asset`, not in `AssetPath` for the file-path the asset has after the `build.dart` run. When the embedders (Flutter/Dart) embed the native assets mapping then the `path`s start representing the path on the system where the Dart/Flutter app is running. This should be embedded in the path-type there.
* The kernel info does not contain link mode (currently), as static linking is not supported. It's not clear that if we support static linking whether any information should be embedded in the kernel info at all.
* The native_assets.yaml for the kernel file is laid out for easy lookup at runtime (keyed on Target).
* We want to change the `Asset`s to output OS and Architecture instead of Target.

Therefore we should not share the data structure between `Asset`s and `KernelAsset`s (new name for the entries that are embedded via native_assets.yaml in a kernel file.)

This means that `dartdev` and `flutter_tools` will have to start converting `Asset`s to `KernelAsset`s when making the `native_assets.yaml` file. Therefore this is a breaking change and will have to be rolled into Dart and flutter/flutter manually.
6 files changed
tree: 8a3c99ef98108d153d9fd1fc1e124427d6cc876f
  1. .github/
  2. pkgs/
  3. AUTHORS
  4. CONTRIBUTING.md
  5. LICENSE
  6. README.md
README.md

Coverage Status

Overview

This repository is home to Dart packages related to FFI and native assets building and bundling.

Packages

PackageDescriptionVersion
ffiUtilities for working with Foreign Function Interface (FFI) code.pub package
ffigenGenerator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.pub package
jniA library to access JNI from Dart and Flutter that acts as a support library for package:jnigen.pub package
jnigenA Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.pub package
native_assets_builderThis package is the backend that invokes top-level build.dart scripts.pub package
native_assets_cliA library that contains the argument and file formats for implementing a native assets CLI.pub package
native_toolchain_cA library to invoke the native C compiler installed on the host machine.pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.