hooks library
A library that contains the protocol for implementing hooks.
The main entrypoint for build hooks (hook/build.dart
) is build. The main
entrypoint for link hooks (hook/link.dart
) is link.
Classes
- AssetRouting
- The destination for assets in the BuildOutput.
- BuildConfig
- The configuration in BuildInput.config.
- BuildConfigBuilder
- The builder for BuildConfig.
- Builder
-
A builder to be run in build in
hook/build.dart
. - BuildInput
-
The input for
hook/build.dart
. - BuildInputAssets
- The assets in BuildInput.assets.
- BuildInputBuilder
- The builder for BuildInput.
- BuildInputMetadata
- The metadata in BuildInput.metadata.
- BuildOutput
-
The output from a
hook/build.dart
on success. - BuildOutputAssets
- The assets in BuildOutput.assets.
- BuildOutputAssetsBuilder
- The builder for BuildOutputAssets.
- BuildOutputBuilder
- The builder for BuildOutput.
- BuildOutputFailure
-
The output from a
hook/build.dart
on failure. - BuildOutputMaybeFailure
- Either a successful BuildOutput or a BuildOutputFailure.
- BuildOutputMetadataBuilder
- The builder for BuildOutputBuilder.metadata.
- EncodedAsset
- An encoded asset.
- FailureType
- A type of failure that occurred during a hook execution.
- HookConfig
- The configuration in HookInput.config.
- HookConfigBuilder
- The builder for HookConfig.
- HookInput
-
The input for
hook/build.dart
orhook/link.dart
. - HookInputBuilder
- The builder for HookInput.
- HookInputUserDefines
- The user-defines in HookInput.userDefines.
- HookOutput
-
The output from a
hook/build.dart
orhook/link.dart
. - HookOutputBuilder
- The builder for HookOutput.
- HookOutputFailure
- The output of a hook that has failed.
- LinkAssetRouting
- The destination for assets in the LinkOutput.
- LinkConfig
- The configuration in LinkInput.config.
- LinkConfigBuilder
- The builder for BuildConfig.
- Linker
-
A builder to be run in link in
hook/link.dart
. - LinkInput
-
The input for a
hook/link.dart
. - LinkInputAssets
- The assets in LinkInput.assets;
- LinkInputBuilder
- The builder for LinkInput.
- LinkOutput
-
The output for a
hook/link.dart
on success. - LinkOutputAssets
- The assets in LinkOutput.assets.
- LinkOutputAssetsBuilder
- The builder for LinkOutput.assets in LinkOutputBuilder.
- LinkOutputBuilder
- The builder for LinkOutput.
- LinkOutputFailure
-
The output from a
hook/link.dart
on failure. - LinkOutputMaybeFailure
- Either a successful LinkOutput or a LinkOutputFailure.
- LinkOutputMetadataBuilder
- The builder for LinkOutputBuilder.metadata.
- PackageMetadata
- The metadata from a specific package, available in BuildInput.metadata.
- PackageUserDefines
- The user-defines for HookInputBuilder.setupShared.
- PackageUserDefinesSource
- A source of user-defines in a PackageUserDefines.
- ProtocolBase
-
The base protocol for
hook/build.dart
andhook/link.dart
which can be extended with ProtocolExtensions. - ProtocolExtension
-
An extension to the ProtocolBase for
hook/build.dart
andhook/link.dart
. - ToAppBundle
- Assets with this AssetRouting in the HookOutput will be sent to the SDK to be bundled with the app.
- ToBuildHooks
- Assets with this AssetRouting in the BuildOutput will be sent to build hooks.
- ToLinkHook
- Assets with this AssetRouting in the HookOutput will be sent to the link hook of packageName.
Functions
-
build(
List< String> arguments, Future<void> builder(BuildInput input, BuildOutputBuilder output)) → Future<void> -
Builds assets in a
hook/build.dart
. -
link(
List< String> arguments, Future<void> linker(LinkInput input, LinkOutputBuilder output)) → Future<void> -
Links assets in a
hook/link.dart
. -
testBuildHook(
{required FutureOr< void> mainMethod(List<String> arguments), required FutureOr<void> check(BuildInput input, BuildOutput output), bool? linkingEnabled, required List<ProtocolExtension> extensions, PackageUserDefines? userDefines, Map<String, List< ? assets}) → Future<EncodedAsset> >void> -
Tests the main function of a
hook/build.dart
.
Typedefs
-
ValidationErrors
= List<
String> - A list of error messages from validation.
Exceptions / Errors
- BuildError
- An error indicating a problem with the build logic within a hook.
- HookError
- Base class for errors that can be thrown during a build or link invocation.
- InfraError
- An error indicating an infrastructure-related problem during hook execution.