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

Side by Side Diff: samples/build_dart/build.dart

Issue 14259002: Fix dartc tests and pub after IOSink change. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | samples/build_dart_simple/build.dart » ('j') | utils/pub/io.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library build_dart; 5 library build_dart;
6 6
7 import "dart:io"; 7 import "dart:io";
8 import "package:args/args.dart"; 8 import "package:args/args.dart";
9 9
10 bool cleanBuild; 10 bool cleanBuild;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void _processFile(String arg) { 111 void _processFile(String arg) {
112 if (arg.endsWith(".foo")) { 112 if (arg.endsWith(".foo")) {
113 print("processing: ${arg}"); 113 print("processing: ${arg}");
114 114
115 File file = new File(arg); 115 File file = new File(arg);
116 116
117 String contents = file.readAsStringSync(); 117 String contents = file.readAsStringSync();
118 118
119 File outFile = new File("${arg}bar"); 119 File outFile = new File("${arg}bar");
120 120
121 IOSink<File> out = outFile.openWrite(); 121 IOSink out = outFile.openWrite();
122 out.writeln("// processed from ${file.path}:"); 122 out.writeln("// processed from ${file.path}:");
123 if (contents != null) { 123 if (contents != null) {
124 out.write(contents); 124 out.write(contents);
125 } 125 }
126 out.close(); 126 out.close();
127 127
128 _findErrors(arg); 128 _findErrors(arg);
129 129
130 print("wrote: ${outFile.path}"); 130 print("wrote: ${outFile.path}");
131 } 131 }
(...skipping 16 matching lines...) Expand all
148 } 148 }
149 149
150 /** 150 /**
151 * If this file is a generated file (based on the extension), delete it. 151 * If this file is a generated file (based on the extension), delete it.
152 */ 152 */
153 void _maybeClean(File file) { 153 void _maybeClean(File file) {
154 if (file.path.endsWith(".foobar")) { 154 if (file.path.endsWith(".foobar")) {
155 file.delete(); 155 file.delete();
156 } 156 }
157 } 157 }
OLDNEW
« no previous file with comments | « no previous file | samples/build_dart_simple/build.dart » ('j') | utils/pub/io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698