Files
sdk/pkg/dev_compiler/tool/sdk_version_check.dart
T
Jenny Messerly 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler
This uses optional new/const and `=` in named argument defaults.

All changes are automated, except for:

- utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2
- pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't
  supporting implicit const in libraries.dart
- pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due
  to the aforementioned Analyzer bug
- tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode
- pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode

Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3
Reviewed-on: https://dart-review.googlesource.com/60402
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2018-06-15 00:28:13 +00:00

26 lines
903 B
Dart
Executable File

#!/usr/bin/env dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Checks that the Dart VM is at least the requested version
import 'dart:io' show Platform, exit;
import 'package:pub_semver/pub_semver.dart' show Version;
void main(List<String> argv) {
if (argv.length == 0 || argv[0] == '--help') {
print('usage: sdk_version_check.dart <minimum-version>');
print('for example: sdk_version_check.dart 1.9.0-dev.4.0');
exit(2);
}
var minVersion = Version.parse(argv[0]);
var vmStr = Platform.version;
vmStr = vmStr.substring(0, vmStr.indexOf(' '));
var vmVersion = Version.parse(vmStr);
if (vmVersion < minVersion) {
print('Requires VM $minVersion but actual version $vmVersion');
exit(1);
}
}