forked from ChromeDevTools/devtools-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevtools_module.gni
51 lines (42 loc) · 1.58 KB
/
devtools_module.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../../third_party/typescript/typescript.gni")
import("./copy.gni")
import("./vars.gni")
template("devtools_module") {
_typescript_target_name = target_name + "-typescript"
_typescript_target_dep = ":$_typescript_target_name"
ts_library(_typescript_target_name) {
forward_variables_from(invoker,
[
"sources",
"deps",
])
# To make sure that this target can be depended upon by other TypeScript targets,
# we have to name it the `target_name`. However, we can't name this `ts_library` the
# `target_name`, as the buildgraph requires the `copy_gen__to_resources` to happen *after*
# `ts_library` is finished.
typescript_config_name = invoker.target_name
visibility += [ ":*" ]
}
_target_outputs = get_target_outputs(_typescript_target_dep)
_javascript_implementation_files =
filter_include(_target_outputs + invoker.data, [ "*.js" ])
group(target_name) {
public_deps = [ _typescript_target_dep ] + invoker.public_deps
visibility = invoker.visibility + [ ":*" ]
data = _javascript_implementation_files +
filter_include(invoker.data + _target_outputs, [ "*.map" ])
if (is_debug) {
metadata = {
grd_files = _javascript_implementation_files
}
}
}
}
set_defaults("devtools_module") {
visibility = []
data = []
public_deps = []
}