sdk.dart 849 Bytes
Newer Older
1 2 3 4
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import '../base/file_system.dart';
6
import '../base/platform.dart';
7
import '../cache.dart';
8 9 10

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

14 15 16
/// The required Dart language flags
const List<String> dartVmFlags = const <String>['--assert-initializer'];

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