sdk.dart 826 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import '../cache.dart';
6
import '../globals.dart' as globals;
7 8 9

/// Locate the Dart SDK.
String get dartSdkPath {
10
  return globals.fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'dart-sdk');
11
}
12

13
/// The required Dart language flags
14
const List<String> dartVmFlags = <String>[];
15

16
/// Return the platform specific name for the given Dart SDK binary. So, `pub`
17
/// ==> `pub.bat`. The default SDK location can be overridden with a specified
18 19
/// [sdkLocation].
String sdkBinaryName(String name, { String sdkLocation }) {
20 21
  return globals.fs.path.absolute(
    globals.fs.path.join(sdkLocation ?? dartSdkPath, 'bin', globals.platform.isWindows ? '$name.bat' : name));
22
}