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

Side by Side Diff: lib/src/flutter.dart

Issue 2165423002: Add support for Flutter SDK constraints. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 5 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
« no previous file with comments | « lib/src/entrypoint.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:io';
6
7 import 'package:path/path.dart' as p;
8 import 'package:pub_semver/pub_semver.dart';
9
10 import 'io.dart';
11
12 /// Whether the Flutter SDK is available.
13 final bool isAvailable = Platform.environment.containsKey("FLUTTER_ROOT");
14
15 /// The path to the root directory of the Flutter SDK.
16 final String rootDirectory = Platform.environment["FLUTTER_ROOT"];
17
18 /// The Flutter SDK's version number, or `null` if the Flutter SDK is
19 /// unavailable.
20 final version = () {
21 if (!isAvailable) return null;
22
23 return new Version.parse(
24 readTextFile(p.join(rootDirectory, "version")).trim());
25 }();
OLDNEW
« no previous file with comments | « lib/src/entrypoint.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698