Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: pkg/kernel/lib/target/flutter.dart

Issue 2972323002: Add 'flutter_release' patch_sdk mode to patch_sdk (Closed)
Patch Set: Replace flag with dedicated target Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.flutter; 4 library kernel.target.flutter;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../class_hierarchy.dart'; 7 import '../class_hierarchy.dart';
8 import '../core_types.dart'; 8 import '../core_types.dart';
9 import '../transformations/continuation.dart' as cont; 9 import '../transformations/continuation.dart' as cont;
10 import '../transformations/erasure.dart'; 10 import '../transformations/erasure.dart';
11 import '../transformations/mixin_full_resolution.dart' as mix; 11 import '../transformations/mixin_full_resolution.dart' as mix;
12 import '../transformations/sanitize_for_vm.dart'; 12 import '../transformations/sanitize_for_vm.dart';
13 import 'targets.dart'; 13 import 'targets.dart';
14 14
15 class FlutterTarget extends Target { 15 class FlutterTarget extends Target {
16 final TargetFlags flags; 16 final TargetFlags flags;
17 17
18 FlutterTarget(this.flags); 18 bool includeVMService;
ahe 2017/07/10 13:19:02 Make this final.
ahe 2017/07/10 13:19:02 includeVMService -> includeVmService
aam 2017/07/10 22:11:37 Done.
aam 2017/07/10 22:11:37 I can't do that because I can't use "super(flags,
19
20 FlutterTarget(this.flags, {this.includeVMService: true});
19 21
20 bool get strongMode => flags.strongMode; 22 bool get strongMode => flags.strongMode;
21 23
22 bool get strongModeSdk => false; 24 bool get strongModeSdk => false;
23 25
24 String get name => 'flutter'; 26 String get name => 'flutter';
25 27
26 // This is the order that bootstrap libraries are loaded according to 28 // This is the order that bootstrap libraries are loaded according to
27 // `runtime/vm/object_store.h`. 29 // `runtime/vm/object_store.h`.
28 List<String> get extraRequiredLibraries => const <String>[ 30 List<String> get extraRequiredLibraries {
29 'dart:async', 31 List<String> libraries = const <String>[
30 'dart:collection', 32 'dart:async',
31 'dart:convert', 33 'dart:collection',
32 'dart:developer', 34 'dart:convert',
33 'dart:_internal', 35 'dart:developer',
34 'dart:isolate', 36 'dart:_internal',
35 'dart:math', 37 'dart:isolate',
38 'dart:math',
36 39
37 // The library dart:mirrors may be ignored by the VM, e.g. when built in 40 // The library dart:mirrors may be ignored by the VM, e.g. when built in
38 // PRODUCT mode. 41 // PRODUCT mode.
39 'dart:mirrors', 42 'dart:mirrors',
40 43
41 'dart:profiler', 44 'dart:profiler',
42 'dart:typed_data', 45 'dart:typed_data',
43 'dart:nativewrappers', 46 'dart:nativewrappers',
44 'dart:io', 47 'dart:io',
45 48
46 // Required for flutter. 49 // Required for flutter.
47 'dart:ui', 50 'dart:ui',
48 ]; 51 ];
52 return includeVMService
53 ? (new List.from(libraries)..add('dart:vmservice_sky'))
54 : libraries;
55 }
49 56
50 void performModularTransformationsOnLibraries( 57 void performModularTransformationsOnLibraries(
51 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries, 58 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries,
52 {void logger(String msg)}) { 59 {void logger(String msg)}) {
53 mix.transformLibraries(this, coreTypes, hierarchy, libraries); 60 mix.transformLibraries(this, coreTypes, hierarchy, libraries);
54 } 61 }
55 62
56 void performGlobalTransformations(CoreTypes coreTypes, Program program, 63 void performGlobalTransformations(CoreTypes coreTypes, Program program,
57 {void logger(String msg)}) { 64 {void logger(String msg)}) {
58 cont.transformProgram(coreTypes, program); 65 cont.transformProgram(coreTypes, program);
(...skipping 22 matching lines...) Expand all
81 bool isLocalVariable: false, 88 bool isLocalVariable: false,
82 bool isDynamic: false, 89 bool isDynamic: false,
83 bool isSuper: false, 90 bool isSuper: false,
84 bool isStatic: false, 91 bool isStatic: false,
85 bool isConstructor: false, 92 bool isConstructor: false,
86 bool isTopLevel: false}) { 93 bool isTopLevel: false}) {
87 // TODO(ahe): This should probably return the same as VmTarget does. 94 // TODO(ahe): This should probably return the same as VmTarget does.
88 return new InvalidExpression(); 95 return new InvalidExpression();
89 } 96 }
90 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698