a75c2b7458
Review URL: https://codereview.chromium.org//474883002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39241 260f80e4-7a28-3924-810f-c04153c831b5
43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
// Copyright (c) 2014, 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.
|
|
|
|
library check.all;
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:path/path.dart';
|
|
|
|
import 'codegen_tools.dart';
|
|
import 'generate_all.dart';
|
|
|
|
/**
|
|
* Check that all targets have been code generated. If they haven't tell the
|
|
* user to run generate_all.dart.
|
|
*/
|
|
main() {
|
|
String script = Platform.script.toFilePath(windows: Platform.isWindows);
|
|
Directory.current = new Directory(dirname(script));
|
|
bool generateAllNeeded = false;
|
|
for (GeneratedContent generatedContent in allTargets) {
|
|
if (!generatedContent.check()) {
|
|
print(
|
|
'${generatedContent.outputFile.absolute} does not have expected contents.');
|
|
generateAllNeeded = true;
|
|
}
|
|
}
|
|
if (generateAllNeeded) {
|
|
print('Please regenerate using:');
|
|
String executable = Platform.executable;
|
|
String packageRoot = '';
|
|
if (Platform.packageRoot.isNotEmpty) {
|
|
packageRoot = ' --package-root=${Platform.packageRoot}';
|
|
}
|
|
String generateScript = join(dirname(script), 'generate_all.dart');
|
|
print(' $executable$packageRoot $generateScript');
|
|
exit(1);
|
|
} else {
|
|
print('All generated files up to date.');
|
|
}
|
|
}
|