Skip to content

Commit

Permalink
make ./grind deploy work
Browse files Browse the repository at this point in the history
  • Loading branch information
limasdf committed Mar 9, 2014
1 parent 1c8df3c commit bfc92e9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/build
/packages
pubspec.lock
/tool/packages
pubspec.lock
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ packages:
browser:
description: browser
source: hosted
version: "0.10.0"
version: "0.9.1"
chrome:
description: chrome
source: hosted
Expand Down
17 changes: 16 additions & 1 deletion tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@ void main([List<String> 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);
}

0 comments on commit bfc92e9

Please sign in to comment.