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

Side by Side Diff: tools/release/version.dart

Issue 11312203: "Reverting 14829-14832" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « tests/language/reg_exp_test.dart ('k') | tools/testing/dart/multitest.dart » ('j') | 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) 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 /** 5 /**
6 * This file contains functionality for getting dart version numbers using 6 * This file contains functionality for getting dart version numbers using
7 * our standard version construction method. Systems that does not include this 7 * our standard version construction method. Systems that does not include this
8 * file should emulate the structure for revision numbers that we have here. 8 * file should emulate the structure for revision numbers that we have here.
9 * 9 *
10 * The version number of a dart build is constructed as follows: 10 * The version number of a dart build is constructed as follows:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 String getExecutableSuffix() { 115 String getExecutableSuffix() {
116 if (Platform.operatingSystem == 'windows') { 116 if (Platform.operatingSystem == 'windows') {
117 return '.bat'; 117 return '.bat';
118 } 118 }
119 return ''; 119 return '';
120 } 120 }
121 121
122 int getRevisionFromSvnInfo(String info) { 122 int getRevisionFromSvnInfo(String info) {
123 if (info == null || info == '') return 0; 123 if (info == null || info == '') return 0;
124 var lines = info.split("\n"); 124 var lines = info.split("\n");
125 RegExp exp = new RegExp(r"Last Changed Rev: (\d*)"); 125 RegExp exp = const RegExp(r"Last Changed Rev: (\d*)");
126 for (var line in lines) { 126 for (var line in lines) {
127 if (exp.hasMatch(line)) { 127 if (exp.hasMatch(line)) {
128 String revisionString = (exp.firstMatch(line).group(1)); 128 String revisionString = (exp.firstMatch(line).group(1));
129 try { 129 try {
130 return int.parse(revisionString); 130 return int.parse(revisionString);
131 } catch(e) { 131 } catch(e) {
132 return 0; 132 return 0;
133 } 133 }
134 } 134 }
135 } 135 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 static RepositoryType guessType() { 195 static RepositoryType guessType() {
196 if (new Directory(".svn").existsSync()) return RepositoryType.SVN; 196 if (new Directory(".svn").existsSync()) return RepositoryType.SVN;
197 if (new Directory(".git").existsSync()) return RepositoryType.GIT; 197 if (new Directory(".git").existsSync()) return RepositoryType.GIT;
198 return RepositoryType.UNKNOWN; 198 return RepositoryType.UNKNOWN;
199 } 199 }
200 200
201 String toString() => name; 201 String toString() => name;
202 202
203 final String name; 203 final String name;
204 } 204 }
OLDNEW
« no previous file with comments | « tests/language/reg_exp_test.dart ('k') | tools/testing/dart/multitest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698