Skip to content

Latest commit

 

History

History
129 lines (97 loc) · 6.46 KB

build_yaml_format.md

File metadata and controls

129 lines (97 loc) · 6.46 KB

Build.yaml format

A build.yaml file is described by the BuildConfig object.

This is a more technical doc of the exact build.yaml format, if you would like to see examples or goal oriented docs you may want to look at the build_config/README.md.

BuildConfig

key value default
targets Map<String, BuildTarget> a single target with the same name as the package
builders Map<String, BuilderDefinition> empty
post_process_builders Map<String, PostProcessBuilderDefinition> empty
global_options Map<String, GlobalBuilderOptions> empty
additional_public_assets List empty

BuildTarget

key value default
auto_apply_builders bool true
builders Map<BuilderKey, TargetBuilderConfig> empty
dependencies List<TargetKey> all default targets from all dependencies in your pubspec
sources InputSet all defaults sources

BuilderDefinition

key value default
builder_factories List none
import String none
build_extensions Map<String, List> none
auto_apply AutoApply AutoApply.none
required_inputs List none
runs_before List<BuilderKey> none
applies_builders List<BuilderKey> none
is_optional bool false
build_to BuildTo BuildTo.cache
defaults TargetBuilderConfigDefaults none

PostProcessBuilderDefinition

key value default
builder_factory String none
import String none
input_extensions List none
defaults TargetBuilderConfigDefaults none

InputSet

Note that in addition to the following structure, you can provide a List<String> and that will be inferred to mean the include key below.

key value default
include List **
exclude List none

TargetBuilderConfig

key value default
enabled bool true
generate_for InputSet **
options BuilderOptions none
dev_options BuilderOptions none
release_options BuilderOptions none

TargetBuilderConfigDefaults

key value default
generate_for InputSet **
options BuilderOptions none
dev_options BuilderOptions none
release_options BuilderOptions none

GlobalBuilderOptions

key value default
options BuilderOptions none
dev_options BuilderOptions none
release_options BuilderOptions none
runs_before List<BuilderKey> none

BuilderOptions

An arbitrary Map<String, dynamic> of configuration options exposed by the individual builders. See the documentation for the builder you are configuring for guidance.

AutoApply

value meaning
none Doesn't apply by default to any package, must be explicitly enabled.
dependents Applies to all packages with a direct dependency on this package.
all_packages Applies to all packages in the graph.
root_package Applies to only the root (application) package.

BuildTo

value meaning
cache Writes all files to the cache directory
source Writes all files directly to the source directory

TargetKey

An identifier for a target. A target key has two parts, a package and a name.

To construct a key, you join the package and name with a :, so for instance the bar target in the foo package would be referenced like this foo:bar.

There is one special alias, which is the $default target. This refers to the default target in the current package (which has the same name as the package).

BuilderKey

An identifier for a builder. A builder has two parts, a package and a name.

To construct a key, you join the package and name with a :, so for instance the bar builder in the foo package would be referenced like this foo:bar.