| Index: pkg/compiler/lib/src/dart2js.dart
|
| diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
|
| index fa7aeb734416f54622013c9333148631401373e8..bc511e44b00d580dbc1c9953cf09a0022737466c 100644
|
| --- a/pkg/compiler/lib/src/dart2js.dart
|
| +++ b/pkg/compiler/lib/src/dart2js.dart
|
| @@ -19,6 +19,7 @@ import 'filenames.dart';
|
| import 'util/uri_extras.dart';
|
| import 'util/util.dart' show stackTraceFilePrefix;
|
| import 'util/command_line.dart';
|
| +import 'package:sdk_library_metadata/libraries.dart';
|
| import 'package:package_config/discovery.dart' show findPackages;
|
|
|
| const String LIBRARY_ROOT = '../../../../../sdk';
|
| @@ -245,13 +246,21 @@ Future<api.CompilationResult> compile(List<String> argv) {
|
|
|
| setCategories(String argument) {
|
| List<String> categories = extractParameter(argument).split(',');
|
| + Set<String> allowedCategories =
|
| + LIBRARIES.values.map((x) => x.category).toSet();
|
| + allowedCategories.remove('Shared');
|
| + allowedCategories.remove('Internal');
|
| + List<String> allowedCategoriesList =
|
| + new List<String>.from(allowedCategories);
|
| + allowedCategoriesList.sort();
|
| if (categories.contains('all')) {
|
| - categories = ["Client", "Server"];
|
| + categories = allowedCategoriesList;
|
| } else {
|
| + String allowedCategoriesString = allowedCategoriesList.join(', ');
|
| for (String category in categories) {
|
| - if (!["Client", "Server"].contains(category)) {
|
| + if (!allowedCategories.contains(category)) {
|
| fail('Unsupported library category "$category", '
|
| - 'supported categories are: Client, Server, all');
|
| + 'supported categories are: $allowedCategoriesString');
|
| }
|
| }
|
| }
|
|
|