Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: packages/usage/tool/grind.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/usage/test/web_test.dart ('k') | packages/usage/tool/travis.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/usage/tool/grind.dart
diff --git a/packages/usage/tool/grind.dart b/packages/usage/tool/grind.dart
index da63dc2e34f4f7b274b7a8e56bf81f8629975ab4..f1d8121abe7a5b798bbb6bb6fff49d5b028c9880 100644
--- a/packages/usage/tool/grind.dart
+++ b/packages/usage/tool/grind.dart
@@ -8,40 +8,35 @@ import 'dart:io';
import 'package:grinder/grinder.dart';
-final Directory BUILD_DIR = new Directory('build');
-final Directory BUILD_TEST_DIR = new Directory('build/test');
+final Directory _buildExampleDir = new Directory('build/example');
-void main(List<String> args) {
- task('init', init);
- task('build', build, ['init']);
- task('clean', clean);
+main(List<String> args) => grind(args);
- startGrinder(args);
-}
-
-/// Do any necessary build set up.
-void init(GrinderContext context) {
+@Task('Do any necessary build set up')
+void init() {
// Verify we're running in the project root.
if (!getDir('lib').existsSync() || !getFile('pubspec.yaml').existsSync()) {
context.fail('This script must be run from the project root.');
}
- BUILD_TEST_DIR.createSync(recursive: true);
+ _buildExampleDir.createSync(recursive: true);
}
-void build(GrinderContext context) {
+@Task()
+@Depends(init)
+void build() {
// Compile `test/web_test.dart` to the `build/test` dir; measure its size.
- File srcFile = new File('test/web_test.dart');
- Dart2js.compile(context, srcFile, outDir: BUILD_TEST_DIR, minify: true);
- File outFile = joinFile(BUILD_TEST_DIR, ['web_test.dart.js']);
+ File srcFile = new File('example/example.dart');
+ Dart2js.compile(srcFile, outDir: _buildExampleDir, minify: true);
+ File outFile = joinFile(_buildExampleDir, ['example.dart.js']);
context.log('${outFile.path} compiled to ${_printSize(outFile)}');
}
-/// Delete all generated artifacts.
-void clean(GrinderContext context) {
+@Task('Delete all generated artifacts')
+void clean() {
// Delete the build/ dir.
- deleteEntity(BUILD_DIR, context);
+ delete(buildDir);
}
String _printSize(File file) => '${(file.lengthSync() + 1023) ~/ 1024}k';
« no previous file with comments | « packages/usage/test/web_test.dart ('k') | packages/usage/tool/travis.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698