• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2013 The Flutter Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/fuchsia/sdk.gni")
6import("//third_party/dart/sdk/lib/_http/http_sources.gni")
7import("//third_party/dart/sdk/lib/async/async_sources.gni")
8import("//third_party/dart/sdk/lib/collection/collection_sources.gni")
9import("//third_party/dart/sdk/lib/convert/convert_sources.gni")
10import("//third_party/dart/sdk/lib/core/core_sources.gni")
11import("//third_party/dart/sdk/lib/developer/developer_sources.gni")
12import("//third_party/dart/sdk/lib/ffi/ffi_sources.gni")
13import("//third_party/dart/sdk/lib/internal/internal_sources.gni")
14import("//third_party/dart/sdk/lib/io/io_sources.gni")
15import("//third_party/dart/sdk/lib/isolate/isolate_sources.gni")
16import("//third_party/dart/sdk/lib/math/math_sources.gni")
17import("//third_party/dart/sdk/lib/typed_data/typed_data_sources.gni")
18import("$flutter_root/build/dart/rules.gni")
19import("$flutter_root/lib/ui/dart_ui.gni")
20
21if (!is_fuchsia) {
22  copy("copy_sky_engine_authors") {
23    sources = [ "//AUTHORS" ]
24
25    outputs = [ "$root_gen_dir/dart-pkg/sky_engine/{{source_file_part}}" ]
26  }
27}
28
29dart_sdk_lib_path = rebase_path("//third_party/dart/sdk/lib")
30
31copy("async") {
32  lib_path = rebase_path("async", "", dart_sdk_lib_path)
33  sources = rebase_path(async_sdk_sources, "", lib_path)
34  outputs =
35      [ "$root_gen_dir/dart-pkg/sky_engine/lib/async/{{source_file_part}}" ]
36}
37
38copy("collection") {
39  lib_path = rebase_path("collection", "", dart_sdk_lib_path)
40  sources = rebase_path(collection_sdk_sources, "", lib_path)
41  outputs = [
42    "$root_gen_dir/dart-pkg/sky_engine/lib/collection/{{source_file_part}}",
43  ]
44}
45
46copy("convert") {
47  lib_path = rebase_path("convert", "", dart_sdk_lib_path)
48  sources = rebase_path(convert_sdk_sources, "", lib_path)
49  outputs =
50      [ "$root_gen_dir/dart-pkg/sky_engine/lib/convert/{{source_file_part}}" ]
51}
52
53copy("core") {
54  lib_path = rebase_path("core", "", dart_sdk_lib_path)
55  sources = rebase_path(core_sdk_sources, "", lib_path)
56  outputs =
57      [ "$root_gen_dir/dart-pkg/sky_engine/lib/core/{{source_file_part}}" ]
58}
59
60copy("developer") {
61  lib_path = rebase_path("developer", "", dart_sdk_lib_path)
62  sources = rebase_path(developer_sdk_sources, "", lib_path)
63  outputs =
64      [ "$root_gen_dir/dart-pkg/sky_engine/lib/developer/{{source_file_part}}" ]
65}
66
67copy("_http") {
68  lib_path = rebase_path("_http", "", dart_sdk_lib_path)
69  sources = rebase_path(http_sdk_sources, "", lib_path)
70  outputs =
71      [ "$root_gen_dir/dart-pkg/sky_engine/lib/_http/{{source_file_part}}" ]
72}
73
74copy("internal") {
75  lib_path = rebase_path("internal", "", dart_sdk_lib_path)
76  sources = rebase_path(internal_sdk_sources, "", lib_path)
77  outputs =
78      [ "$root_gen_dir/dart-pkg/sky_engine/lib/internal/{{source_file_part}}" ]
79}
80
81copy("io") {
82  lib_path = rebase_path("io", "", dart_sdk_lib_path)
83  sources = rebase_path(io_sdk_sources, "", lib_path)
84  outputs = [ "$root_gen_dir/dart-pkg/sky_engine/lib/io/{{source_file_part}}" ]
85}
86
87copy("ffi") {
88  lib_path = rebase_path("ffi", "", dart_sdk_lib_path)
89  sources = rebase_path(ffi_sdk_sources, "", lib_path)
90  outputs = [ "$root_gen_dir/dart-pkg/sky_engine/lib/ffi/{{source_file_part}}" ]
91}
92
93copy("isolate") {
94  lib_path = rebase_path("isolate", "", dart_sdk_lib_path)
95  sources = rebase_path(isolate_sdk_sources, "", lib_path)
96  outputs =
97      [ "$root_gen_dir/dart-pkg/sky_engine/lib/isolate/{{source_file_part}}" ]
98}
99
100copy("math") {
101  lib_path = rebase_path("math", "", dart_sdk_lib_path)
102  sources = rebase_path(math_sdk_sources, "", lib_path)
103  outputs =
104      [ "$root_gen_dir/dart-pkg/sky_engine/lib/math/{{source_file_part}}" ]
105}
106
107copy("typed_data") {
108  lib_path = rebase_path("typed_data", "", dart_sdk_lib_path)
109  sources = rebase_path(typed_data_sdk_sources, "", lib_path)
110  outputs = [
111    "$root_gen_dir/dart-pkg/sky_engine/lib/typed_data/{{source_file_part}}",
112  ]
113}
114
115copy("copy_dart_ui") {
116  sources = dart_ui_files
117
118  outputs = [ "$root_gen_dir/dart-pkg/sky_engine/lib/ui/{{source_file_part}}" ]
119}
120
121group("copy_dart_sdk") {
122  deps = [
123    ":_http",
124    ":async",
125    ":collection",
126    ":convert",
127    ":core",
128    ":developer",
129    ":ffi",
130    ":internal",
131    ":io",
132    ":isolate",
133    ":math",
134    ":typed_data",
135  ]
136}
137
138dart_pkg("sky_engine") {
139  sources = [
140    "LICENSE",
141    "README.md",
142    "lib/_embedder.yaml",
143    "lib/_empty.dart",
144    "pubspec.yaml",
145  ]
146
147  deps = [
148    ":copy_dart_sdk",
149    ":copy_dart_ui",
150  ]
151
152  if (!is_fuchsia) {
153    deps += [ ":copy_sky_engine_authors" ]
154  }
155
156  service_isolate_dir = "//third_party/dart/runtime/bin/vmservice"
157  sdk_ext_directory = "$root_gen_dir/sky/bindings"
158  sdk_ext_files = [
159    "$service_isolate_dir/vmservice_io.dart",
160    "$service_isolate_dir/loader.dart",
161    "$service_isolate_dir/server.dart",
162  ]
163}
164
165if (is_fuchsia && !using_fuchsia_sdk) {
166  import("//build/dart/dart_library.gni")
167
168  dart_library("sky_engine_dart") {
169    package_name = "sky_engine"
170
171    package_root = "$root_gen_dir/dart-pkg/sky_engine"
172
173    sources = []
174
175    disable_analysis = true
176
177    non_dart_deps = [
178      # This will ensure all the source files needed for this package are
179      # copied to the right location.
180      ":sky_engine",
181    ]
182  }
183}
184