From bfc92e912a166c094940ee456469ed452be2e22e Mon Sep 17 00:00:00 2001 From: limasdf Date: Sun, 9 Mar 2014 10:46:24 -0700 Subject: [PATCH] make ./grind deploy work --- .gitignore | 2 +- pubspec.lock | 2 +- tool/grind.dart | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e3c7643..bacbfa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /build /packages -pubspec.lock /tool/packages +pubspec.lock diff --git a/pubspec.lock b/pubspec.lock index c2f1ced..2a06f94 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,7 +8,7 @@ packages: browser: description: browser source: hosted - version: "0.10.0" + version: "0.9.1" chrome: description: chrome source: hosted diff --git a/tool/grind.dart b/tool/grind.dart index 70d2e3a..b44ee7e 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -13,11 +13,26 @@ void main([List args]) { startGrinder(args); } -void deploy(GrinderContext context) { +void _compile([GrindContext context]) { + // Generate dart.js (doens't support eval), but actually use precompiled + // version(support eval) from chrome-dart bootstrap. + ProcessResult result = + Process.runSync('dart2js', ['nikes.dart', '--out=nikes.dart.js'], + workingDirectory: BUILD_DIR.path); + if (result.stdout != null && !result.stdout.isEmpty) { + context.log(result.stdout); + } + + // TODO(sunglim) : Remove deps, map and js output. +} + +void deploy([GrinderContext context]) { if (context != null) { context.log("Copy App directory to BUILD directory"); } BUILD_DIR.deleteSync(recursive: true); BUILD_DIR.createSync(); copyDirectory(APP_DIR, BUILD_DIR); + + _compile(context); }