BuildOutputBuilder class final

The builder for BuildOutput.

There are various Dart extensions on this BuildOutputBuilder that allow adding specific asset types - which should be used by normal hook authors. For example

import 'package:code_assets/code_assets.dart';
import 'package:data_assets/data_assets.dart';
import 'package:hooks/hooks.dart';

void main(List<String> arguments) async {
  await build(arguments, (input, output) async {
    output.assets.code.add(
      CodeAsset(
        name: 'my_code',
        file: Uri.file('path/to/file'),
        package: input.packageName,
        linkMode: DynamicLoadingBundled(),
      ),
    );
    output.assets.data.add(
      DataAsset(
        name: 'my_data',
        file: Uri.file('path/to/file'),
        package: input.packageName,
      ),
    );
  });
}

The builder for BuildOutput.

Inheritance

Constructors

BuildOutputBuilder()

Properties

assets BuildOutputAssetsBuilder
The assets builder for this build output.
no setter
dependencies HookOutputDependenciesBuilder
The dependencies builder for this hook output.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
json Map<String, Object?>
The JSON representation of this hook output builder.
no setterinherited
metadata BuildOutputMetadataBuilder
The metadata builder for this build output.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDependencies(Iterable<Uri> uris) → void
Adds files used by this build.
inherited
addDependency(Uri uri) → void
Adds file used by this build.
inherited
build() BuildOutput
Builds the BuildOutput.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setFailure(FailureType value) → void
Sets the failure of this output.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited