• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020-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("//base/startup/appspawn/appspawn.gni")
15import("//base/startup/appspawn/etc/sandbox/appdata_sandbox_fixer.gni")
16import("//build/ohos.gni")
17
18if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) {
19  ohos_prebuilt_etc("appdata-sandbox-render.json") {
20    source = "../appdata-sandbox-render.json"
21    part_name = "${part_name}"
22    module_install_dir = "etc/sandbox"
23  }
24
25  ohos_prebuilt_etc("appdata-sandbox-gpu.json") {
26    source = "../appdata-sandbox-gpu.json"
27    part_name = "${part_name}"
28    module_install_dir = "etc/sandbox"
29  }
30
31  ohos_prebuilt_etc("appdata-sandbox.json") {
32    source = "../appdata-sandbox-app.json"
33    symlink_target_name = [ "appdata-sandbox.json" ]
34    part_name = "${part_name}"
35    module_install_dir = "etc/sandbox"
36  }
37
38  ohos_prebuilt_etc("appdata-sandbox-isolated-new.json") {
39    source = "../appdata-sandbox-isolated-new.json"
40    part_name = "${part_name}"
41    module_install_dir = "etc/sandbox"
42  }
43
44  ohos_prebuilt_etc("appdata-sandbox-debug.json") {
45    source = "../appdata-sandbox-debug.json"
46    part_name = "${part_name}"
47    module_install_dir = "etc/sandbox"
48  }
49} else {
50  ohos_prebuilt_appdata_sandbox("appdata-sandbox.json") {
51    source = "../appdata-sandbox.json"
52    patterns = []
53    extra_sandbox_cfgs = []
54    if (target_cpu == "arm64" || target_cpu == "x86_64") {
55      extra_sandbox_cfgs += [ "../appdata-sandbox64.json" ]
56    }
57    if (is_asan || asan_detector) {
58      extra_sandbox_cfgs += [ "../appdata-sandbox-asan.json" ]
59    }
60    subsystem_name = "${subsystem_name}"
61    part_name = "${part_name}"
62    module_install_dir = "etc/sandbox"
63  }
64
65  ohos_prebuilt_appdata_sandbox("appdata-sandbox-isolated.json") {
66    source = "../appdata-sandbox-isolated.json"
67    patterns = []
68    extra_sandbox_cfgs = []
69    subsystem_name = "${subsystem_name}"
70    part_name = "${part_name}"
71    module_install_dir = "etc/sandbox"
72  }
73}
74
75ohos_prebuilt_etc("appspawn_preload.json") {
76  source = appspawn_napi_preload_path
77  part_name = "${part_name}"
78  module_install_dir = "etc/appspawn"
79}
80
81ohos_prebuilt_etc("appspawn_preload_ets.json") {
82  source = "../appspawn_preload_ets.json"
83  part_name = "${part_name}"
84  module_install_dir = "etc/appspawn"
85}
86
87ohos_prebuilt_etc("appspawn_systemLib.json") {
88  source = "../appspawn_systemLib.json"
89  part_name = "${part_name}"
90  module_install_dir = "etc/appspawn"
91}
92
93ohos_prebuilt_etc("ohos.startup.appspawn.para") {
94  source = "ohos.startup.appspawn.para"
95  part_name = "${part_name}"
96  subsystem_name = "${subsystem_name}"
97  module_install_dir = "etc/param"
98}
99
100ohos_prebuilt_etc("ohos.startup.appspawn.para.dac") {
101  source = "ohos.startup.appspawn.para.dac"
102  part_name = "${part_name}"
103  subsystem_name = "${subsystem_name}"
104  module_install_dir = "etc/param"
105}
106
107group("etc_files") {
108  deps = [
109    ":appdata-sandbox.json",
110    ":appspawn_preload.json",
111    ":appspawn_preload_ets.json",
112    ":appspawn_systemLib.json",
113    ":ohos.startup.appspawn.para",
114    ":ohos.startup.appspawn.para.dac"
115  ]
116  if (defined(appspawn_sandbox_new) && appspawn_sandbox_new) {
117    deps += [
118      ":appdata-sandbox-debug.json",
119      ":appdata-sandbox-gpu.json",
120      ":appdata-sandbox-isolated-new.json",
121      ":appdata-sandbox-render.json",
122    ]
123  } else {
124    deps += [ ":appdata-sandbox-isolated.json" ]
125  }
126}
127