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

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

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months 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/tool/drone.sh ('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 f1d8121abe7a5b798bbb6bb6fff49d5b028c9880..f93261b41d895f34a32515a442e51c8adce8b20b 100644
--- a/packages/usage/tool/grind.dart
+++ b/packages/usage/tool/grind.dart
@@ -12,31 +12,24 @@ final Directory _buildExampleDir = new Directory('build/example');
main(List<String> args) => grind(args);
-@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.');
- }
-
- _buildExampleDir.createSync(recursive: true);
-}
+@Task()
+void init() => _buildExampleDir.createSync(recursive: true);
@Task()
@Depends(init)
void build() {
// Compile `test/web_test.dart` to the `build/test` dir; measure its size.
File srcFile = new File('example/example.dart');
- Dart2js.compile(srcFile, outDir: _buildExampleDir, minify: true);
+ Dart2js.compile(srcFile,
+ outDir: _buildExampleDir,
+ minify: true,
+ extraArgs: ['--conditional-directives']);
File outFile = joinFile(_buildExampleDir, ['example.dart.js']);
- context.log('${outFile.path} compiled to ${_printSize(outFile)}');
+ log('${outFile.path} compiled to ${_printSize(outFile)}');
}
-@Task('Delete all generated artifacts')
-void clean() {
- // Delete the build/ dir.
- delete(buildDir);
-}
+@Task()
+void clean() => delete(buildDir);
String _printSize(File file) => '${(file.lengthSync() + 1023) ~/ 1024}k';
« no previous file with comments | « packages/usage/tool/drone.sh ('k') | packages/usage/tool/travis.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698