1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("../web_aafwk.gni")
15
16#################################################
17
18glue_script_gen_dir = rebase_path("${target_gen_dir}/../ohos_glue")
19
20action("webview_interface_prepare") {
21  script = "${webview_path}/copy_files.py"
22  depfile = "$target_gen_dir/$target_name.d"
23  output_file = "$target_out_dir/$target_name.out"
24  outputs = [ output_file ]
25
26  args = [
27    "--command-type",
28    "include",
29    "--ohos-glue-dir",
30    "${glue_script_gen_dir}",
31    "--depfile",
32    rebase_path(depfile, "${root_build_dir}"),
33    "--outfile",
34    rebase_path(output_file, "${root_build_dir}"),
35  ]
36}
37
38action("webview_glue_base_prepare") {
39  script = "${webview_path}/copy_files.py"
40  depfile = "$target_gen_dir/$target_name.d"
41  output_file = "$target_out_dir/$target_name.out"
42  outputs = [ output_file ]
43
44  args = [
45    "--command-type",
46    "base",
47    "--ohos-glue-dir",
48    "${glue_script_gen_dir}",
49    "--depfile",
50    rebase_path(depfile, "${root_build_dir}"),
51    "--outfile",
52    rebase_path(output_file, "${root_build_dir}"),
53  ]
54
55  deps = [ ":webview_interface_prepare" ]
56}
57
58action("webview_glue_nweb_prepare") {
59  script = "${webview_path}/copy_files.py"
60  depfile = "$target_gen_dir/$target_name.d"
61  output_file = "$target_out_dir/$target_name.out"
62  outputs = [ output_file ]
63
64  args = [
65    "--command-type",
66    "nweb",
67    "--ohos-glue-dir",
68    "${glue_script_gen_dir}",
69    "--depfile",
70    rebase_path(depfile, "${root_build_dir}"),
71    "--outfile",
72    rebase_path(output_file, "${root_build_dir}"),
73  ]
74}
75
76action("webview_glue_adapter_prepare") {
77  script = "${webview_path}/copy_files.py"
78  depfile = "$target_gen_dir/$target_name.d"
79  output_file = "$target_out_dir/$target_name.out"
80  outputs = [ output_file ]
81
82  args = [
83    "--command-type",
84    "adapter",
85    "--ohos-glue-dir",
86    "${glue_script_gen_dir}",
87    "--depfile",
88    rebase_path(depfile, "${root_build_dir}"),
89    "--outfile",
90    rebase_path(output_file, "${root_build_dir}"),
91  ]
92}
93