Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Created April 28, 2018 21:21
Show Gist options
  • Save thosakwe/a4834837cb46351957a926f3a238aae7 to your computer and use it in GitHub Desktop.
Save thosakwe/a4834837cb46351957a926f3a238aae7 to your computer and use it in GitHub Desktop.
DIG
import 'package:dig/delegate.dart';
import 'package:path/path.dart' as p;
main(_, SendPort sendPort) {
return Dig.run(sendPort, (Dig dig) async {
var dig = await Dig.create(sendPort);
// Wait for these tasks to finish, or run them if they have not been completed.
await dig.depend(['string_scanner', 'source_span:some_task']);
// Run CMake.
await dig.cmakeBuild();
await dig.cmakeBuild('lib', workingDirectory: 'foo');
// Run a command.
await dig.run('echo', ['foo', 'bar'], workingDirectory: 'foo', expectedExitCode: 0);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment