···3838}
3939```
40404141+### Running executables from dev_dependencies {#ssec-dart-applications-build-tools}
4242+4343+Many Dart applications require executables from the `dev_dependencies` section in `pubspec.yaml` to be run before building them.
4444+4545+This can be done in `preBuild`, in one of two ways:
4646+4747+1. Packaging the tool with `buildDartApplication`, adding it to Nixpkgs, and running it like any other application
4848+2. Running the tool from the Pub cache
4949+5050+Of these methods, the first is recommended when using a tool that does not need
5151+to be of a specific version.
5252+5353+To use the second method, first make the derivation accessible within itself (e.g. `let self = ...; in self`), and then run it from the Pub cache in `preBuild`.
5454+5555+e.g., for `build_runner`:
5656+5757+```bash
5858+dart --packages=.dart_tool/package_config.json ${self.pubspecLock.dependencySources.build_runner.packagePath}/bin/build_runner.dart build
5959+```
6060+6161+Do _not_ use `dart run <package_name>`, as this will attempt to download dependencies with Pub.
6262+4163### Usage with nix-shell {#ssec-dart-applications-nix-shell}
42644365As `buildDartApplication` provides dependencies instead of `pub get`, Dart needs to be explicitly told where to find them.