OLD | NEW |
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 /// Operations relative to the user's installed Dart SDK. | 5 /// Operations relative to the user's installed Dart SDK. |
6 library sdk; | 6 library sdk; |
7 | 7 |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import '../../pkg/path/lib/path.dart' as path; | 10 import '../../pkg/pathos/lib/path.dart' as path; |
11 | 11 |
12 import 'io.dart'; | 12 import 'io.dart'; |
13 import 'log.dart' as log; | 13 import 'log.dart' as log; |
14 import 'version.dart'; | 14 import 'version.dart'; |
15 | 15 |
16 /// Matches an Eclipse-style SDK version number. This is four dotted numbers | 16 /// Matches an Eclipse-style SDK version number. This is four dotted numbers |
17 /// (major, minor, patch, build) with an optional suffix attached to the build | 17 /// (major, minor, patch, build) with an optional suffix attached to the build |
18 /// number. | 18 /// number. |
19 final _versionPattern = new RegExp(r'^(\d+)\.(\d+)\.(\d+)\.(\d+.*)$'); | 19 final _versionPattern = new RegExp(r'^(\d+)\.(\d+)\.(\d+)\.(\d+.*)$'); |
20 | 20 |
(...skipping 29 matching lines...) Expand all Loading... |
50 "format pub could recognize. Found: $version"); | 50 "format pub could recognize. Found: $version"); |
51 } | 51 } |
52 | 52 |
53 // Semantic versions cannot use "_". | 53 // Semantic versions cannot use "_". |
54 var build = match[4].replaceAll('_', '.'); | 54 var build = match[4].replaceAll('_', '.'); |
55 | 55 |
56 return new Version( | 56 return new Version( |
57 int.parse(match[1]), int.parse(match[2]), int.parse(match[3]), | 57 int.parse(match[1]), int.parse(match[2]), int.parse(match[3]), |
58 build: build); | 58 build: build); |
59 } | 59 } |
OLD | NEW |