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

Side by Side Diff: pkg/analyzer/lib/options.dart

Issue 469673005: Get the version file from the correct location compated to the snapshot we generate for the analyzer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 options; 5 library options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:args/args.dart'; 9 import 'package:args/args.dart';
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 static _showUsage(parser) { 185 static _showUsage(parser) {
186 print('Usage: $_BINARY_NAME [options...] <libraries to analyze...>'); 186 print('Usage: $_BINARY_NAME [options...] <libraries to analyze...>');
187 print(parser.getUsage()); 187 print(parser.getUsage());
188 print(''); 188 print('');
189 print('For more information, see http://www.dartlang.org/tools/analyzer.'); 189 print('For more information, see http://www.dartlang.org/tools/analyzer.');
190 } 190 }
191 191
192 static String _getVersion() { 192 static String _getVersion() {
193 try { 193 try {
194 String versionPath = Platform.script.resolve('../version').toFilePath(); 194 // This is relative to bin/snapshot, so ../..
195 String versionPath =
196 Platform.script.resolve('../../version').toFilePath();
195 File versionFile = new File(versionPath); 197 File versionFile = new File(versionPath);
196 return versionFile.readAsStringSync().trim(); 198 return versionFile.readAsStringSync().trim();
197 } catch (_) { 199 } catch (_) {
198 // This happens when the script is not running in the context of an SDK. 200 // This happens when the script is not running in the context of an SDK.
199 return "<unknown>"; 201 return "<unknown>";
200 } 202 }
201 } 203 }
202 } 204 }
203 205
204 /** 206 /**
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 314
313 _getNextFlagIndex(args, i) { 315 _getNextFlagIndex(args, i) {
314 for ( ; i < args.length; ++i) { 316 for ( ; i < args.length; ++i) {
315 if (args[i].startsWith('--')) { 317 if (args[i].startsWith('--')) {
316 return i; 318 return i;
317 } 319 }
318 } 320 }
319 return i; 321 return i;
320 } 322 }
321 } 323 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698