Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e32531f

Browse files
Switch flutter's dart sdk to full and add dartdevc libraries (#7968)
1 parent fb1c543 commit e32531f

File tree

4 files changed

+272
-1
lines changed

4 files changed

+272
-1
lines changed

BUILD.gn

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# found in the LICENSE file.
44

55
import("$flutter_root/common/config.gni")
6+
import("//third_party/dart/build/dart/dart_action.gni")
67

78
# Temporary snapshot copy rules until we can use the full SDK.
89
_flutter_sdk_snapshots = [
@@ -36,7 +37,8 @@ group("flutter") {
3637
"$flutter_root/frontend_server",
3738
"//third_party/dart:create_sdk",
3839
"$flutter_root/lib/stub_ui:stub_ui",
39-
":dart2js_platform_files"
40+
":dart2js_platform_files",
41+
":flutter_dartdevc_kernel_sdk",
4042
]
4143
foreach(snapshot, _flutter_sdk_snapshots) {
4244
public_deps += [ ":copy_flutter_${snapshot[0]}_snapshot" ]
@@ -108,3 +110,37 @@ copy("dart2js_platform_files") {
108110
"$root_out_dir/flutter_patched_sdk/{{source_file_part}}",
109111
]
110112
}
113+
114+
115+
prebuilt_dart_action("flutter_dartdevc_kernel_sdk") {
116+
deps = [
117+
"//third_party/dart:create_sdk",
118+
]
119+
120+
packages = "//third_party/dart/.packages"
121+
122+
script = "//third_party/dart/pkg/dev_compiler/tool/kernel_sdk.dart"
123+
124+
inputs = [
125+
"//third_party/dart/pkg/dev_compiler/tool/kernel_sdk.dart",
126+
]
127+
128+
outputs = [
129+
"$target_gen_dir/kernel/amd/dart_sdk.js",
130+
"$target_gen_dir/kernel/amd/dart_sdk.js.map",
131+
"$target_gen_dir/kernel/common/dart_sdk.js",
132+
"$target_gen_dir/kernel/common/dart_sdk.js.map",
133+
"$target_gen_dir/kernel/es6/dart_sdk.js",
134+
"$target_gen_dir/kernel/es6/dart_sdk.js.map",
135+
"$target_gen_dir/kernel/legacy/dart_sdk.js",
136+
"$target_gen_dir/kernel/legacy/dart_sdk.js.map",
137+
]
138+
139+
libraries_path = rebase_path("$flutter_root/lib/snapshot/libraries.json")
140+
output_path = rebase_path("$target_gen_dir/kernel/flutter_ddc_sdk.dill")
141+
142+
args = [
143+
"--output=$output_path",
144+
"--libraries=$libraries_path",
145+
]
146+
}

lib/snapshot/libraries.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,123 @@
11
{
22
"comment:0": "NOTE: THIS FILE IS GENERATED. DO NOT EDIT.",
33
"comment:1": "Instead modify 'flutter/lib/snapshot/libraries.yaml' and follow the instructions therein.",
4+
"none": {
5+
"libraries": {}
6+
},
7+
"dartdevc": {
8+
"libraries": {
9+
"async": {
10+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart",
11+
"uri": "../../../third_party/dart/sdk/lib/async/async.dart"
12+
},
13+
"_runtime": {
14+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart"
15+
},
16+
"_interceptors": {
17+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart"
18+
},
19+
"mirrors": {
20+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/mirrors_patch.dart",
21+
"supported": false,
22+
"uri": "../../../third_party/dart/sdk/lib/mirrors/mirrors.dart"
23+
},
24+
"_debugger": {
25+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/debugger.dart"
26+
},
27+
"io": {
28+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart",
29+
"supported": false,
30+
"uri": "../../../third_party/dart/sdk/lib/io/io.dart"
31+
},
32+
"_internal": {
33+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart",
34+
"uri": "../../../third_party/dart/sdk/lib/internal/internal.dart"
35+
},
36+
"_metadata": {
37+
"uri": "../../../third_party/dart/sdk/lib/html/html_common/metadata.dart"
38+
},
39+
"_http": {
40+
"uri": "../../../third_party/dart/sdk/lib/_http/http.dart"
41+
},
42+
"_js_primitives": {
43+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_primitives.dart"
44+
},
45+
"_js_helper": {
46+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart"
47+
},
48+
"ui": {
49+
"uri": "flutter/lib/stub_ui/ui.dart"
50+
},
51+
"js": {
52+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart"
53+
},
54+
"_js_mirrors": {
55+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart"
56+
},
57+
"html_common": {
58+
"uri": "../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart"
59+
},
60+
"_native_typed_data": {
61+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart"
62+
},
63+
"core": {
64+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart",
65+
"uri": "../../../third_party/dart/sdk/lib/core/core.dart"
66+
},
67+
"js_util": {
68+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/lib/js_util/dart2js/js_util_dart2js.dart"
69+
},
70+
"collection": {
71+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart",
72+
"uri": "../../../third_party/dart/sdk/lib/collection/collection.dart"
73+
},
74+
"typed_data": {
75+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/typed_data_patch.dart",
76+
"uri": "../../../third_party/dart/sdk/lib/typed_data/typed_data.dart"
77+
},
78+
"web_audio": {
79+
"uri": "../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart"
80+
},
81+
"html": {
82+
"uri": "../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart"
83+
},
84+
"developer": {
85+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart",
86+
"uri": "../../../third_party/dart/sdk/lib/developer/developer.dart"
87+
},
88+
"isolate": {
89+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart",
90+
"supported": false,
91+
"uri": "../../../third_party/dart/sdk/lib/isolate/isolate.dart"
92+
},
93+
"web_gl": {
94+
"uri": "../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart"
95+
},
96+
"indexed_db": {
97+
"uri": "../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart"
98+
},
99+
"convert": {
100+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/convert_patch.dart",
101+
"uri": "../../../third_party/dart/sdk/lib/convert/convert.dart"
102+
},
103+
"_isolate_helper": {
104+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart"
105+
},
106+
"math": {
107+
"patches": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart",
108+
"uri": "../../../third_party/dart/sdk/lib/math/math.dart"
109+
},
110+
"_foreign_helper": {
111+
"uri": "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/foreign_helper.dart"
112+
},
113+
"web_sql": {
114+
"uri": "../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart"
115+
},
116+
"svg": {
117+
"uri": "../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart"
118+
}
119+
}
120+
},
4121
"flutter": {
5122
"libraries": {
6123
"_builtin": {

lib/snapshot/libraries.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
# changing libraries, sources, and patch files. See
1212
# https://github.com/dart-lang/sdk/issues/28836.
1313

14+
none:
15+
libraries: {}
16+
1417
flutter:
1518
libraries:
1619
_builtin:
@@ -147,3 +150,115 @@ flutter:
147150

148151
vmservice_io:
149152
uri: "../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart"
153+
154+
dartdevc:
155+
libraries:
156+
_runtime:
157+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/runtime.dart"
158+
159+
_debugger:
160+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/debugger.dart"
161+
162+
_foreign_helper:
163+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/foreign_helper.dart"
164+
165+
_http:
166+
uri: "../../../third_party/dart/sdk/lib/_http/http.dart"
167+
168+
_interceptors:
169+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart"
170+
171+
_internal:
172+
uri: "../../../third_party/dart/sdk/lib/internal/internal.dart"
173+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart"
174+
175+
_isolate_helper:
176+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart"
177+
178+
_js_helper:
179+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart"
180+
181+
_js_mirrors:
182+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart"
183+
184+
_js_primitives:
185+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/js_primitives.dart"
186+
187+
_metadata:
188+
uri: "../../../third_party/dart/sdk/lib/html/html_common/metadata.dart"
189+
190+
_native_typed_data:
191+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/private/native_typed_data.dart"
192+
193+
async:
194+
uri: "../../../third_party/dart/sdk/lib/async/async.dart"
195+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart"
196+
197+
collection:
198+
uri: "../../../third_party/dart/sdk/lib/collection/collection.dart"
199+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart"
200+
201+
convert:
202+
uri: "../../../third_party/dart/sdk/lib/convert/convert.dart"
203+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/convert_patch.dart"
204+
205+
core:
206+
uri: "../../../third_party/dart/sdk/lib/core/core.dart"
207+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart"
208+
209+
developer:
210+
uri: "../../../third_party/dart/sdk/lib/developer/developer.dart"
211+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart"
212+
213+
io:
214+
uri: "../../../third_party/dart/sdk/lib/io/io.dart"
215+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart"
216+
supported: false
217+
218+
isolate:
219+
uri: "../../../third_party/dart/sdk/lib/isolate/isolate.dart"
220+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart"
221+
supported: false
222+
223+
mirrors:
224+
uri: "../../../third_party/dart/sdk/lib/mirrors/mirrors.dart"
225+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/mirrors_patch.dart"
226+
supported: false
227+
228+
math:
229+
uri: "../../../third_party/dart/sdk/lib/math/math.dart"
230+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/math_patch.dart"
231+
232+
typed_data:
233+
uri: "../../../third_party/dart/sdk/lib/typed_data/typed_data.dart"
234+
patches: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/patch/typed_data_patch.dart"
235+
236+
html:
237+
uri: "../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart"
238+
239+
html_common:
240+
uri: "../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart"
241+
242+
indexed_db:
243+
uri: "../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart"
244+
245+
js:
246+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart"
247+
248+
js_util:
249+
uri: "../../../third_party/dart/pkg/dev_compiler/tool/input_sdk/lib/js_util/dart2js/js_util_dart2js.dart"
250+
251+
svg:
252+
uri: "../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart"
253+
254+
web_audio:
255+
uri: "../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart"
256+
257+
web_gl:
258+
uri: "../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart"
259+
260+
web_sql:
261+
uri: "../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart"
262+
263+
ui:
264+
uri: "flutter/lib/stub_ui/ui.dart"

tools/gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def to_gn_args(args):
227227
if args.arm_float_abi:
228228
gn_args['arm_float_abi'] = args.arm_float_abi
229229

230+
# Switch flutter to full Dart SDK.
231+
gn_args['dart_platform_sdk'] = False
232+
230233
return gn_args
231234

232235
def parse_args(args):

0 commit comments

Comments
 (0)