Dart

The following Dart versions are available to your build:

The DART_SDK environment variable is available and included in the PATH:

export DART_SDK=/usr/local/dart-sdk
export PATH=$PATH:$DART_SDK/bin

The following Dart command line tools are available:

  • Dart-to-JavaScript compiler (dart2js)
  • Dart VM (dart)
  • Dart package manager (pub)
  • Dart Analyzer (dart_analyzer)

Dependencies

The Dart SDK includes a package management utility called Pub. Executing pub install will download all dependencies defined in the pubspec.yaml file.

pub install

Testing

At this time, Dart does not have a standard build management tool (ie maven). So you will probably need to modify the default build script to ensure your tests are executed correctly.

For further instruction, please see the build Script documentation.

Headless Browser Tests

A headless verion of webkit, DumpRenderTree, it also available for testing your client-side code. To use DumpRenderTree you will need to start xvfb (a virtual xwindows system) in your build script:

sudo start xvfb

For an example project using DumpRenderTree, see the Dart team’s web-ui project.

Handling Dart Releases

The Dart team releases a new version of the SDK about once every week. Drone offers a feature called Triggers to proactively build and test your project every time a new version of the dart-sdk is released.

To enable this Trigger, go to your Project Settings > Triggers:

Proactive Dart Builds

Examples

Example build script for the html5lib project maintained by Google’s Dart team:

pub install
test/run.sh

Real-world Dart projects using drone.io: