Skip to content

Commit 0dd69bd

Browse files
authored
[hooks] Clarify that a build/link hook *must* call build/link. (#2313)
1 parent d29392e commit 0dd69bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkgs/hooks/lib/src/api/build_and_link.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import '../validation.dart';
1111

1212
/// Builds assets in a `hook/build.dart`.
1313
///
14-
/// Meant to be used in build hooks (`hook/build.dart`).
14+
/// If a build hook is defined (`hook/build.dart`) then `build` must be called
15+
/// by that hook, to write the [BuildInput.outputFile], even if the [builder]
16+
/// function has no work to do.
1517
///
1618
/// Can build native assets which are not already available, or expose existing
1719
/// files. Each individual asset is assigned a unique asset ID.
@@ -134,7 +136,9 @@ Future<void> build(
134136

135137
/// Links assets in a `hook/link.dart`.
136138
///
137-
/// Meant to be used in link hooks (`hook/link.dart`).
139+
/// If a link hook is defined (`hook/link.dart`) then `link` must be called
140+
/// by that hook, to write the [BuildInput.outputFile], even if the [linker]
141+
/// function has no work to do.
138142
///
139143
/// Can link native assets which are not already available, or expose existing
140144
/// files. Each individual asset is assigned a unique asset ID.

0 commit comments

Comments
 (0)