| 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 pub.sdk; | 6 library pub.sdk; |
| 7 | 7 |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
| 11 import 'package:pub_semver/pub_semver.dart'; |
| 11 | 12 |
| 12 import 'io.dart'; | 13 import 'io.dart'; |
| 13 import 'version.dart'; | |
| 14 | 14 |
| 15 /// Gets the path to the root directory of the SDK. | 15 /// Gets the path to the root directory of the SDK. |
| 16 /// | 16 /// |
| 17 /// When running from the actual built SDK, this will be the SDK that contains | 17 /// When running from the actual built SDK, this will be the SDK that contains |
| 18 /// the running Dart executable. When running from the repo, it will be the | 18 /// the running Dart executable. When running from the repo, it will be the |
| 19 /// "sdk" directory in the Dart repository itself. | 19 /// "sdk" directory in the Dart repository itself. |
| 20 final String rootDirectory = | 20 final String rootDirectory = |
| 21 runningFromSdk ? _rootDirectory : path.join(repoRoot, "sdk"); | 21 runningFromSdk ? _rootDirectory : path.join(repoRoot, "sdk"); |
| 22 | 22 |
| 23 /// Gets the path to the root directory of the SDK, assuming that the currently | 23 /// Gets the path to the root directory of the SDK, assuming that the currently |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 var version = "$major.$minor.$patch"; | 65 var version = "$major.$minor.$patch"; |
| 66 if (channel == "be") { | 66 if (channel == "be") { |
| 67 // TODO(rnystrom): tools/utils.py includes the svn commit here. Should we? | 67 // TODO(rnystrom): tools/utils.py includes the svn commit here. Should we? |
| 68 version += "-edge"; | 68 version += "-edge"; |
| 69 } else if (channel == "dev") { | 69 } else if (channel == "dev") { |
| 70 version += "-dev.$prerelease.$prereleasePatch"; | 70 version += "-dev.$prerelease.$prereleasePatch"; |
| 71 } | 71 } |
| 72 | 72 |
| 73 return new Version.parse(version); | 73 return new Version.parse(version); |
| 74 } | 74 } |
| OLD | NEW |