• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//build/ohos.gni")
15
16wmlayout_scss_gni_filepath = "//foundation/graphic/graphic_2d/utils/wmlayout"
17
18template("wmlayout_scss") {
19  scss_name = invoker.scss
20  generate_binary_name = "${target_name}_binary"
21  prebuilt_etc_name = "${target_name}_etc"
22
23  scss_filename = "$root_gen_dir/${target_name}"
24  action(generate_binary_name) {
25    script = "$wmlayout_scss_gni_filepath/gen_scss.py"
26    inputs = [
27      script,
28      scss_name,
29    ]
30    outputs = [ scss_filename ]
31    label = "//foundation/graphic/graphic_2d/frameworks/wmserver/src/wmlayout_scss_parser:wmlayout_scss_parser($host_toolchain)"
32    deps = [ label ]
33    args = [
34      "--cmd",
35      "./" +
36          rebase_path(get_label_info(label, "root_out_dir"), root_build_dir) +
37          "/graphic/graphic_2d/wmlayout_scss_parser",
38      "--input",
39      rebase_path(scss_name, root_build_dir),
40      "--output",
41      rebase_path(scss_filename, root_build_dir),
42    ]
43  }
44
45  ohos_prebuilt_etc(prebuilt_etc_name) {
46    forward_variables_from(invoker,
47                           [
48                             "part_name",
49                             "subsystem_name",
50                           ])
51    source = scss_filename
52    relative_install_dir = "wmlayout.d"
53    deps = [ ":${generate_binary_name}" ]
54  }
55
56  group(target_name) {
57    public_deps = [ ":${prebuilt_etc_name}" ]
58  }
59}
60