| 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 '../transformations/treeshaker.dart' show ProgramRoot; |
| 9 import 'flutter.dart'; |
| 8 import 'vm.dart'; | 10 import 'vm.dart'; |
| 9 import 'vmcc.dart'; | 11 import 'vmcc.dart'; |
| 10 import 'flutter.dart'; | |
| 11 import '../transformations/treeshaker.dart' show ProgramRoot; | |
| 12 | 12 |
| 13 final List<String> targetNames = targets.keys.toList(); | 13 final List<String> targetNames = targets.keys.toList(); |
| 14 | 14 |
| 15 class TargetFlags { | 15 class TargetFlags { |
| 16 bool strongMode; | 16 bool strongMode; |
| 17 bool treeShake; | 17 bool treeShake; |
| 18 List<ProgramRoot> programRoots; | 18 List<ProgramRoot> programRoots; |
| 19 | 19 |
| 20 TargetFlags({this.strongMode: false, this.treeShake: false, this.programRoots:
const <ProgramRoot>[]}); | 20 TargetFlags({this.strongMode: false, this.treeShake: false, this.programRoots:
const <ProgramRoot>[]}); |
| 21 } | 21 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 /// Libraries will be loaded in order. | 44 /// Libraries will be loaded in order. |
| 45 List<String> get extraRequiredLibraries => <String>[]; | 45 List<String> get extraRequiredLibraries => <String>[]; |
| 46 | 46 |
| 47 /// Additional declared variables implied by this target. | 47 /// Additional declared variables implied by this target. |
| 48 /// | 48 /// |
| 49 /// These can also be passed on the command-line of form `-D<name>=<value>`, | 49 /// These can also be passed on the command-line of form `-D<name>=<value>`, |
| 50 /// and those provided on the command-line take precedence over those defined | 50 /// and those provided on the command-line take precedence over those defined |
| 51 /// by the target. | 51 /// by the target. |
| 52 Map<String, String> get extraDeclaredVariables => const <String, String>{}; | 52 Map<String, String> get extraDeclaredVariables => const <String, String>{}; |
| 53 | 53 |
| 54 /// Classes from the SDK whose interface is required for the modular |
| 55 /// transformations. |
| 56 Map<String, List<String>> get requiredSdkClasses => CoreTypes.requiredClasses; |
| 57 |
| 54 bool get strongMode; | 58 bool get strongMode; |
| 55 | 59 |
| 56 /// If true, the SDK should be loaded in strong mode. | 60 /// If true, the SDK should be loaded in strong mode. |
| 57 bool get strongModeSdk => strongMode; | 61 bool get strongModeSdk => strongMode; |
| 58 | 62 |
| 59 /// Perform target-specific modular transformations. | 63 /// Perform target-specific modular transformations. |
| 60 /// | 64 /// |
| 61 /// These transformations should not be whole-program transformations. They | 65 /// These transformations should not be whole-program transformations. They |
| 62 /// should expect that the program will contain external libraries. | 66 /// should expect that the program will contain external libraries. |
| 63 void performModularTransformations(Program program); | 67 void performModularTransformations(Program program); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 76 final TargetFlags flags; | 80 final TargetFlags flags; |
| 77 | 81 |
| 78 NoneTarget(this.flags); | 82 NoneTarget(this.flags); |
| 79 | 83 |
| 80 bool get strongMode => flags.strongMode; | 84 bool get strongMode => flags.strongMode; |
| 81 String get name => 'none'; | 85 String get name => 'none'; |
| 82 List<String> get extraRequiredLibraries => <String>[]; | 86 List<String> get extraRequiredLibraries => <String>[]; |
| 83 void performModularTransformations(Program program) {} | 87 void performModularTransformations(Program program) {} |
| 84 void performGlobalTransformations(Program program) {} | 88 void performGlobalTransformations(Program program) {} |
| 85 } | 89 } |
| OLD | NEW |