blob: 4d88fd67d86354832162cadcb4096908a4ba02a2 [file] [log] [blame]
Zachary Anderson7e1b7e52016-09-23 14:47:361# 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
3# BSD-style license that can be found in the LICENSE file.
4
Jake Ehrlich773f8d52019-07-30 20:34:315import("build/config/gclient_args.gni")
Nicholas Shahan50d972b2019-10-09 23:24:216import("sdk_args.gni")
Zachary Andersona99cdab2017-11-02 19:02:187
Josh Soreff7a2ea52023-01-24 18:00:258targeting_fuchsia = target_os == "fuchsia"
James Robinson138d5872018-01-18 06:05:569
Zachary Anderson7e1b7e52016-09-23 14:47:3610# This target will be built if no target is specified when invoking ninja.
11group("default") {
Josh Soreff7a2ea52023-01-24 18:00:2512 if (targeting_fuchsia) {
Zachary Anderson7f55ad82016-12-13 21:02:5213 # Fuchsia has run_vm_tests marked testonly.
14 testonly = true
15 }
asivae33d0232020-03-10 21:56:1116 deps = [ ":runtime" ]
Zachary Anderson7e1b7e52016-09-23 14:47:3617}
18
Zachary Anderson7c784ce2016-09-29 20:23:0019group("most") {
lambdabaad3fbbf82019-07-31 12:54:5220 import("runtime/runtime_args.gni")
Josh Soreff7a2ea52023-01-24 18:00:2521 if (targeting_fuchsia) {
Zachary Anderson7f55ad82016-12-13 21:02:5222 # Fuchsia has run_vm_tests marked testonly.
23 testonly = true
24 }
Zachary Anderson7c784ce2016-09-29 20:23:0025 deps = [
Alexander Thomasf38081d2021-03-19 12:03:4826 ":analysis_server",
Zachary Anderson7c784ce2016-09-29 20:23:0027 ":create_sdk",
28 ":dart2js",
29 ":dartanalyzer",
30 ":dartdevc",
31 ":runtime",
Zachary Anderson7c784ce2016-09-29 20:23:0032 ]
33}
34
Zachary Anderson7e1b7e52016-09-23 14:47:3635group("runtime") {
asivabc7220a2018-06-18 22:31:3236 import("runtime/runtime_args.gni")
37
Josh Soreff7a2ea52023-01-24 18:00:2538 if (targeting_fuchsia) {
Zachary Anderson7f55ad82016-12-13 21:02:5239 # Fuchsia has run_vm_tests marked testonly.
40 testonly = true
41 }
Chris Evans23b1f382022-03-09 14:17:4442
Zachary Anderson7e1b7e52016-09-23 14:47:3643 deps = [
Zachary Anderson7c784ce2016-09-29 20:23:0044 "runtime/bin:dart",
Vyacheslav Egorovbda70c82021-09-02 14:14:3545 "runtime/bin:entrypoints_verification_test",
Alexander Aprelev34087a62019-09-27 21:14:1146 "runtime/bin:ffi_test_dynamic_library",
47 "runtime/bin:ffi_test_functions",
Zachary Anderson7c784ce2016-09-29 20:23:0048 "runtime/bin:process_test",
Zachary Andersonc1313a52016-10-26 15:50:5449 "runtime/bin:run_vm_tests",
Zachary Anderson02eebb02017-11-01 21:13:2850 "runtime/vm:kernel_platform_files($host_toolchain)",
Ryan Macnak9eb216a2017-01-31 17:47:5151 "utils/kernel-service:kernel-service",
Zachary Anderson7c784ce2016-09-29 20:23:0052 ]
Ben Konyi48aa0202020-05-05 22:27:0953
54 # TODO(bkonyi): this dep causes a segfault on Android XARM_X64 builds.
55 # See issue #41776.
56 if (dart_target_arch != "arm") {
Ben Konyi157ebfe2020-07-21 16:23:1857 deps += [
58 "utils/dartdev:dartdev",
59 "utils/dds:dds",
60 ]
Ben Konyi48aa0202020-05-05 22:27:0961 }
Zach Anderson5dc1f8d2021-05-27 21:50:2462
Chris Evans0b8ab172023-01-24 14:07:2663 # This flag is set in runtime/runtime_args.gni
64 # The analyze_snapshot tool is only supported on 64 bit AOT builds running
65 # under linux and android platforms
66 if (build_analyze_snapshot) {
Martin Kustermannb15da0b2023-01-27 12:44:3067 deps += [
68 # The `analyze_snapshot` tests require the `analyze_snapshot` as well as
69 # `gen_snapshot` binaries.
70 "runtime/bin:analyze_snapshot",
71 "runtime/bin:analyze_snapshot($host_toolchain)",
72 "runtime/bin:gen_snapshot",
73 "runtime/bin:gen_snapshot($host_toolchain)",
74 ]
Chris Evans23b1f382022-03-09 14:17:4475 }
76
Zach Anderson5dc1f8d2021-05-27 21:50:2477 if (is_linux || is_android) {
78 deps += [ "runtime/bin:abstract_socket_test" ]
79 }
Zachary Anderson7c784ce2016-09-29 20:23:0080}
81
Daco Harkes9f96aed2020-11-16 16:10:5582# A separate target and not included in group("runtime"). This way the target\
83# "runtime" does not get many executables extra as build output.
84group("run_ffi_unit_tests") {
85 deps = [ "runtime/bin/ffi_unit_test:run_ffi_unit_tests" ]
86}
87
Zachary Anderson7c784ce2016-09-29 20:23:0088group("runtime_precompiled") {
89 deps = [
Zachary Andersonc1313a52016-10-26 15:50:5490 "runtime/bin:dart_precompiled_runtime",
Florian Schneiderc7aba7d2017-01-10 00:58:0991 "runtime/bin:process_test",
Zachary Anderson7c784ce2016-09-29 20:23:0092 ]
Zach Anderson5dc1f8d2021-05-27 21:50:2493 if (is_linux || is_android) {
94 deps += [ "runtime/bin:abstract_socket_test" ]
95 }
Zachary Anderson7c784ce2016-09-29 20:23:0096}
97
Leaf Petersend44457f2020-06-16 23:37:3698group("create_sdk") {
99 public_deps = [ "sdk:create_sdk" ]
Robert Nystrom6d867792019-09-25 00:43:13100}
101
Leaf Petersend44457f2020-06-16 23:37:36102group("create_platform_sdk") {
103 public_deps = [ "sdk:create_platform_sdk" ]
Ben Konyi1960d212020-05-12 23:37:19104}
105
Zachary Anderson7c784ce2016-09-29 20:23:00106group("dart2js") {
asivae33d0232020-03-10 21:56:11107 deps = [ "utils/compiler:dart2js" ]
Zachary Anderson7c784ce2016-09-29 20:23:00108}
109
Joshua Littfd39eab2022-10-05 11:55:22110group("dart2wasm_platform") {
Aske Simon Christensen6c760422022-05-10 10:06:06111 deps = [
112 ":runtime_precompiled",
113 "utils/dart2wasm:compile_dart2wasm_platform",
Aske Simon Christensen6c760422022-05-10 10:06:06114 "utils/dart2wasm:dart2wasm_snapshot",
Joshua Littfd39eab2022-10-05 11:55:22115 ]
Joshua Litt1ed2a072022-10-26 17:04:17116 if (defined(is_product)) {
117 if (is_product) {
118 deps += [ "utils/dart2wasm:dart2wasm_product_snapshot" ]
119 } else {
120 deps += [ "utils/dart2wasm:dart2wasm_asserts_snapshot" ]
121 }
Ryan Macnak8d604952022-10-10 19:14:58122 }
Joshua Littfd39eab2022-10-05 11:55:22123}
124
125group("dart2wasm") {
126 deps = [
127 ":dart2wasm_platform",
Ömer Sinan Ağacanaffc3392022-09-23 09:41:22128 "utils/dart2wasm:test_wasm_modules",
Aske Simon Christensen6c760422022-05-10 10:06:06129 ]
130}
131
Martin Kustermann0fdeaee2022-11-18 10:58:54132group("dart2wasm_benchmark") {
133 deps = [
134 ":dart2wasm_platform",
135 "third_party/binaryen:wasm-opt",
136 ]
137}
138
Zachary Anderson7c784ce2016-09-29 20:23:00139group("dartanalyzer") {
asivae33d0232020-03-10 21:56:11140 deps = [ "utils/dartanalyzer" ]
Zachary Anderson7c784ce2016-09-29 20:23:00141}
142
143group("dartdevc") {
asivae33d0232020-03-10 21:56:11144 deps = [ "utils/dartdevc" ]
Zachary Anderson7c784ce2016-09-29 20:23:00145}
146
Zachary Anderson7c784ce2016-09-29 20:23:00147group("analysis_server") {
asivae33d0232020-03-10 21:56:11148 deps = [ "utils/analysis_server" ]
Zachary Anderson7c784ce2016-09-29 20:23:00149}
150
151# This is the target that is built on the dart2js build bots.
152# It must depend on anything that is required by the dart2js
153# test suites.
154group("dart2js_bot") {
asivae33d0232020-03-10 21:56:11155 deps = [ ":create_sdk" ]
Zachary Anderson7c784ce2016-09-29 20:23:00156}
157
Zach Anderson9847c062018-06-04 21:35:39158# This rule and the compressed_observatory_archive rule are for the Fuchsia
159# bots that pre-build the Observatory. They copy the observatory tar files to
160# the root build output directory for convenient access by the Fuchsia buildbot
161# scripts.
Zach Anderson736ddd92018-05-29 16:35:34162group("observatory_archive") {
asivae33d0232020-03-10 21:56:11163 deps = [ "runtime/observatory:copy_observatory_archive" ]
Zach Anderson9847c062018-06-04 21:35:39164}
165
166group("compressed_observatory_archive") {
asivae33d0232020-03-10 21:56:11167 deps = [ "runtime/observatory:copy_compressed_observatory_archive" ]
Zach Anderson736ddd92018-05-29 16:35:34168}
Liam Appelbe089d6fc2020-07-10 18:10:05169
170if (is_fuchsia) {
Ryan Macnakb4b7b8f2021-10-13 21:14:56171 import("third_party/fuchsia/sdk/${host_os}/build/component.gni")
172 import("third_party/fuchsia/sdk/${host_os}/build/package.gni")
Liam Appelbe089d6fc2020-07-10 18:10:05173
Daco Harkes550d5802020-12-10 12:15:17174 template("dart_fuchsia_test_package") {
175 fuchsia_package(target_name) {
176 package_name = invoker.package_name
177 if (is_debug) {
178 package_name += "_debug"
179 } else if (is_release) {
180 package_name += "_release"
181 } else if (is_product) {
182 package_name += "_product"
183 }
184 testonly = true
185 deps = invoker.deps
186 }
187 }
Liam Appelbe6fc75e62020-07-15 20:44:06188
Daco Harkes550d5802020-12-10 12:15:17189 template("dart_fuchsia_test_component") {
190 fuchsia_component(target_name) {
191 testonly = true
192 data_deps = [ "runtime/bin:dart" ]
193 if (defined(invoker.data_deps)) {
194 data_deps += invoker.data_deps
195 }
Ryan Macnak384394b2023-02-09 22:43:36196 manifest = invoker.manifest
Daco Harkes550d5802020-12-10 12:15:17197
198 library_files = []
199 if (defined(invoker.library_files)) {
200 library_files += invoker.library_files
201 }
202 resource_files = [
203 ".dart_tool/package_config.json",
204 "pkg/testing/test/hello_test.dart",
205 "tools/addlatexhash.dart",
206 ]
207 resource_dirs = invoker.resource_dirs
208
209 resources = []
210 foreach(file, library_files) {
211 resources += [
212 {
213 path = root_out_dir + "/" + file
214 dest = "lib/" + file
215 },
216 ]
217 }
218 foreach(file, resource_files) {
219 resources += [
220 {
221 path = file
222 dest = "data/" + file
223 },
224 ]
225 }
226 resources +=
227 exec_script("tools/fuchsia/find_resources.py", resource_dirs, "json")
228 }
229 }
230
231 dart_fuchsia_test_component("fuchsia_test_component") {
Ryan Macnak384394b2023-02-09 22:43:36232 manifest = "build/fuchsia/fuchsia_test_component.cmx"
Liam Appelbe6fc75e62020-07-15 20:44:06233 resource_dirs = [
Liam Appelbe6bd220f2020-08-06 21:29:29234 "tests/standalone_2",
Liam Appelbe6fc75e62020-07-15 20:44:06235 "pkg/async_helper",
236 "pkg/expect",
237 "pkg/meta",
Liam Appelbe6bd220f2020-08-06 21:29:29238 "pkg/native_stack_traces",
Liam Appelbe6fc75e62020-07-15 20:44:06239 "pkg/smith",
240 "third_party/pkg/args",
241 "third_party/pkg/async",
242 "third_party/pkg/collection",
Liam Appelbe6bd220f2020-08-06 21:29:29243 "third_party/pkg/convert",
244 "third_party/pkg/crypto",
245 "third_party/pkg/http",
246 "third_party/pkg/http_parser",
Liam Appelbe6fc75e62020-07-15 20:44:06247 "third_party/pkg/path",
248 "third_party/pkg/pool",
249 "third_party/pkg/stack_trace",
Liam Appelbe6bd220f2020-08-06 21:29:29250 "third_party/pkg/string_scanner",
251 "third_party/pkg/typed_data",
Liam Appelbe6fc75e62020-07-15 20:44:06252 ]
Liam Appelbe089d6fc2020-07-10 18:10:05253 }
254
Daco Harkes550d5802020-12-10 12:15:17255 dart_fuchsia_test_package("fuchsia_test_package") {
256 package_name = "dart_test"
Liam Appelbef66eb722020-07-21 19:40:15257 deps = [ ":fuchsia_test_component" ]
Liam Appelbe089d6fc2020-07-10 18:10:05258 }
Daco Harkes550d5802020-12-10 12:15:17259
260 dart_fuchsia_test_component("fuchsia_ffi_test_component") {
Ryan Macnak384394b2023-02-09 22:43:36261 manifest = "build/fuchsia/fuchsia_ffi_test_component.cmx"
Daco Harkes550d5802020-12-10 12:15:17262 data_deps = [
263 "runtime/bin:ffi_test_dynamic_library",
264 "runtime/bin:ffi_test_functions",
265 ]
266 library_files = [
267 "libffi_test_dynamic_library.so",
268 "libffi_test_functions.so",
269 ]
270 resource_dirs = [
271 "pkg/expect",
272 "pkg/meta",
273 "tests/ffi",
274 "third_party/pkg/ffi",
275 ]
276 }
277
278 dart_fuchsia_test_package("fuchsia_ffi_test_package") {
279 package_name = "dart_ffi_test"
280 deps = [ ":fuchsia_ffi_test_component" ]
281 }
Liam Appelbe089d6fc2020-07-10 18:10:05282}