| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 library kernel.target.targets; | 4 library kernel.target.targets; |
| 5 | 5 |
| 6 import '../ast.dart'; | 6 import '../ast.dart'; |
| 7 | 7 import '../core_types.dart'; |
| 8 import 'flutter.dart'; |
| 8 import 'vm.dart'; | 9 import 'vm.dart'; |
| 9 import 'vmcc.dart'; | 10 import 'vmcc.dart'; |
| 10 import 'flutter.dart'; | |
| 11 | 11 |
| 12 final List<String> targetNames = targets.keys.toList(); | 12 final List<String> targetNames = targets.keys.toList(); |
| 13 | 13 |
| 14 class TargetFlags { | 14 class TargetFlags { |
| 15 bool strongMode; | 15 bool strongMode; |
| 16 bool treeShake; | 16 bool treeShake; |
| 17 | 17 |
| 18 TargetFlags({this.strongMode: false, this.treeShake: false}); | 18 TargetFlags({this.strongMode: false, this.treeShake: false}); |
| 19 } | 19 } |
| 20 | 20 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 /// Libraries will be loaded in order. | 42 /// Libraries will be loaded in order. |
| 43 List<String> get extraRequiredLibraries => <String>[]; | 43 List<String> get extraRequiredLibraries => <String>[]; |
| 44 | 44 |
| 45 /// Additional declared variables implied by this target. | 45 /// Additional declared variables implied by this target. |
| 46 /// | 46 /// |
| 47 /// These can also be passed on the command-line of form `-D<name>=<value>`, | 47 /// These can also be passed on the command-line of form `-D<name>=<value>`, |
| 48 /// and those provided on the command-line take precedence over those defined | 48 /// and those provided on the command-line take precedence over those defined |
| 49 /// by the target. | 49 /// by the target. |
| 50 Map<String, String> get extraDeclaredVariables => const <String, String>{}; | 50 Map<String, String> get extraDeclaredVariables => const <String, String>{}; |
| 51 | 51 |
| 52 /// Classes from the SDK whose interface is required for the modular |
| 53 /// transformations. |
| 54 Map<String, List<String>> get requiredSdkClasses => CoreTypes.requiredClasses; |
| 55 |
| 52 bool get strongMode; | 56 bool get strongMode; |
| 53 | 57 |
| 54 /// If true, the SDK should be loaded in strong mode. | 58 /// If true, the SDK should be loaded in strong mode. |
| 55 bool get strongModeSdk => strongMode; | 59 bool get strongModeSdk => strongMode; |
| 56 | 60 |
| 57 /// Perform target-specific modular transformations. | 61 /// Perform target-specific modular transformations. |
| 58 /// | 62 /// |
| 59 /// These transformations should not be whole-program transformations. They | 63 /// These transformations should not be whole-program transformations. They |
| 60 /// should expect that the program will contain external libraries. | 64 /// should expect that the program will contain external libraries. |
| 61 void performModularTransformations(Program program); | 65 void performModularTransformations(Program program); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 74 final TargetFlags flags; | 78 final TargetFlags flags; |
| 75 | 79 |
| 76 NoneTarget(this.flags); | 80 NoneTarget(this.flags); |
| 77 | 81 |
| 78 bool get strongMode => flags.strongMode; | 82 bool get strongMode => flags.strongMode; |
| 79 String get name => 'none'; | 83 String get name => 'none'; |
| 80 List<String> get extraRequiredLibraries => <String>[]; | 84 List<String> get extraRequiredLibraries => <String>[]; |
| 81 void performModularTransformations(Program program) {} | 85 void performModularTransformations(Program program) {} |
| 82 void performGlobalTransformations(Program program) {} | 86 void performGlobalTransformations(Program program) {} |
| 83 } | 87 } |
| OLD | NEW |