-
Notifications
You must be signed in to change notification settings - Fork 90
Build hook spec #955
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
Build hook spec #955
Changes from 1 commit
43950e2
d75f6ab
13e9ed6
6f59908
4bc8cbd
5e01f81
f745db4
be58730
e1e8754
7fb1fce
ac5a7da
746a74d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,10 @@ An asset must have a link mode. Currently, the only supported link mode is dynam | |
|
|
||
| An asset must specify a path type for dynamic linking. | ||
|
|
||
| * `absolute` paths are absolute paths in the output dir (see below). | ||
| * `system` paths are expected to resolve on the target machine PATH. In this case the asset is not a file but only metadata. | ||
| * `process` "paths" have no path, symbols are resolved in the current process. In this case the asset is not a file but only metadata. | ||
| * `executable` "paths" have no path, symbols are resolved in the current executable. In this case the asset is not a file but only metadata. | ||
| * An `absolute` path is an absolute path in the output dir (see below). | ||
| * A `system` path is expected to resolve on the target machine PATH. In this case the asset is not a file but only metadata. | ||
| * A `process` "path" has no path, symbols are resolved in the current process. In this case the asset is not a file but only metadata. | ||
| * An `executable` "path" has no path, symbols are resolved in the current executable. In this case the asset is not a file but only metadata. | ||
|
|
||
| #### AssetId | ||
| An asset must have an `assetId`. Dart code that uses an asset, references the asset using the `assetId`. | ||
|
|
@@ -37,30 +37,30 @@ A target specifies the operating system and architecture of the targeted platfor | |
|
|
||
| ### `build.dart` | ||
| To bundle native assets with a package, that package must define a `build.dart` | ||
| script which accepts a `--config` option as follows: | ||
| script which accepts a `--config <path>` command line option as follows: | ||
|
|
||
| ```console | ||
| $ dart build.dart --config <build_config.yaml> | ||
| ``` | ||
|
|
||
| The `--config` option specifies location of the `build_config.yaml` file. | ||
| The `--config` option specifies the location of the `build_config.yaml` file as an absolute path. | ||
|
|
||
| The `build.dart` file MUST: | ||
| * Read the `build_config.yaml` file, | ||
| * Build assets using configuration from `build_config.yaml`. | ||
| * If `dry_run: true` in `build_config.yaml`, then this may be skipped. | ||
| * Write assets into `out_dir` from `build_config.yaml`. | ||
| * If `dry_run: true` in `build_config.yaml`, then this may be skipped. | ||
| * Filename are unrelated to `assetId`. | ||
| * Build assets using the configuration from `build_config.yaml`. | ||
| * If the boolean parameter `dry_run` is set to true in the build configuration, then this may be skipped. | ||
| * Write asset files into output dir that was provided by `build_config.yaml`. | ||
| * If the boolean parameter `dry_run` is set to true in the build configuration, then this may be skipped. | ||
| * The file name inside `out_dir` doesn't really matter, because in Dart code you'll always access things by `assetId`. So in some sense the file name is irrelevant. | ||
| * Arbitrary file names are fine, `build_output.yaml` will map `assetId` to files. | ||
| * MUST avoid file name `build_output.yaml`. | ||
|
||
| * Write `build_output.yaml` into `out_dir` (from `build_config.yaml`). | ||
| * This maps `assetId` to assets previous written in `out_dir`. | ||
| * This maps the `assetId`s to assets previously written into `out_dir`. | ||
| * There may be multiple assets for a given `assetId` depending on | ||
|
||
| characteristics like `target`, `link_mode`, etc. | ||
| * If `dry_run: true` in `build_config.yaml`, the list of assets that would be | ||
| generated must this be enumerated. Mapping `assetId`s to non-existing files | ||
| is expected. | ||
| * If the boolean parameter `dry_run` is set to true in the build configuration, | ||
| the list of assets must be output, but the asset files must not be written. | ||
| The asset file urls are expected to refer to non-existing files. | ||
|
|
||
|
|
||
| ### `build_config.yaml` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file names of the assets don't really matter. It could be file1.foo, file2.foo, file3.foo. Because the only way assets are accessed from Dart code is through their assetId.
However, we do want to have to files written to disk rather than having a buffer of bytes for files, because quite often the files are produces by an external
Processcall or for data assets already in your package.