This was an exercise to understand how to use Dart's build
package.
https://pub.dartlang.org/packages/build https://github.com/dart-lang/build
Basically, what needs to be done is:
- Add the needed dependencies in
pubspec.yaml
. We will need packagesbuild
andbuild_runner
. - Create a builder class. Then create a factory function that will instantiate the class. See file
/lib/builder.dart
- Create a
build.yaml
file that specifies the targets and builders. - Run the build using pub and build_runner, with command
pub run build_runner build
. - You will then see the generated files located in
.dart_tool
directory.