tree: cdd65f7967dd3ea2d08f7e466c3a3bcea1dc38d5 [path history] [tgz]
  1. analysis.md
  2. fidl.md
  3. ides.md
  4. logging.md
  5. mod_integration_testing.md
  6. mods.md
  7. README.md
  8. style.md
  9. testing.md
  10. third_party.md
docs/development/languages/dart/README.md

Dart

Overview

Dart artifacts are not built the same way in Fuchsia as they are on other platforms.

Instead of relying on pub to manage dependencies, sources of third-party packages we depend on are checked into the tree under [//third_party/dart-pkg][dart-3p]. This is to ensure we use consistent versions of our dependencies across multiple builds.

Likewise, no build output is placed in the source tree as everything goes under out/. That includes .packages files which are generated as part of the build based on a target's dependency.

Targets

There are five gn targets for building Dart:

See the definitions of each of these targets for how to use them.

Package layout

We use a layout very similar to the standard layout.

my_package/
  |
  |-- pubspec.yaml           # Empty, used as a marker [mandatory]
  |-- BUILD.gn               # Contains all targets
  |-- analysis_options.yaml  # Analysis configuration [mandatory]
  |-- lib/                   # dart_library contents
  |-- bin/                   # dart_binary's (target) or dart_tool's (host)
  |-- test/                  # dart_test contents

Going further