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

Side by Side Diff: runtime/bin/vmservice/client/build_.dart

Issue 199633007: Switch to using pub build instead of custom build_.dart script (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:polymer/builder.dart';
6 import 'dart:io';
7
8 main() {
9 lint()
10 .then((_) => deploy()).then(compileToJs);
11 }
12
13 String findDart2JS() {
14 var dartPath = Platform.executable;
15 var lastIndex = dartPath.lastIndexOf(Platform.pathSeparator);
16 if (lastIndex != -1) {
17 var binPath = dartPath.substring(0, lastIndex);
18 return '$binPath${Platform.pathSeparator}dart2js';
19 }
20 return 'dart2js';
21 }
22
23 void runDart2JS(String input, String output) {
24 var dart2js_path = findDart2JS();
25 var result =
26 Process.runSync(dart2js_path,
27 [ '--minify', '-o', output, input], runInShell: true);
28 print(result.stdout);
29 print(result.stderr);
30 if (result.exitCode != 0) {
31 print("Running dart2js failed.");
32 exit(result.exitCode);
33 }
34 }
35
36 compileToJs(_) {
37 print("Running dart2js");
38 runDart2JS('out/web/index.html_bootstrap.dart',
39 'out/web/index.html_bootstrap.dart.js');
40 runDart2JS('out/web/index_devtools.html_bootstrap.dart',
41 'out/web/index_devtools.html_bootstrap.dart.js');
42 print("Done");
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698