blob: 40efb3d8bd6bb1d29c67dfe57de645ddca4aa9e3 [file] [log] [blame]
François Gaffiea56b5c22018-02-21 18:04:39 +01001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badour56786ac2021-02-25 15:24:36 -080015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "frameworks_av_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["frameworks_av_license"],
22}
23
Francois Gaffie7d602f02019-02-13 10:37:49 +010024python_defaults {
25 name: "tools_default",
François Gaffiea56b5c22018-02-21 18:04:39 +010026 version: {
27 py2: {
Francois Gaffie31987fb2019-09-03 11:57:33 +020028 enabled: false,
François Gaffiea56b5c22018-02-21 18:04:39 +010029 },
30 py3: {
Francois Gaffie31987fb2019-09-03 11:57:33 +020031 enabled: true,
François Gaffiea56b5c22018-02-21 18:04:39 +010032 },
33 },
34}
35
Francois Gaffie5818b452019-08-27 16:30:04 +020036//##################################################################################################
37// Tools for audio policy engine criterion type configuration file
38//
Francois Gaffie7d602f02019-02-13 10:37:49 +010039python_binary_host {
40 name: "buildPolicyCriterionTypes.py",
41 main: "buildPolicyCriterionTypes.py",
42 srcs: [
43 "buildPolicyCriterionTypes.py",
44 ],
45 defaults: ["tools_default"],
46}
47
Francois Gaffie5818b452019-08-27 16:30:04 +020048genrule_defaults {
49 name: "buildpolicycriteriontypesrule",
50 tools: ["buildPolicyCriterionTypes.py"],
51 cmd: "cp $(locations :audio_policy_configuration_files) $(genDir)/. && " +
52 "cp $(location :audio_policy_configuration_top_file) $(genDir)/audio_policy_configuration.xml && " +
53 "$(location buildPolicyCriterionTypes.py) " +
Francois Gaffie958be0d2021-02-03 08:41:58 +010054 " --androidaudiobaseheader $(location :libaudio_system_audio_base) " +
55 " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " +
Francois Gaffie5818b452019-08-27 16:30:04 +020056 "--audiopolicyconfigurationfile $(genDir)/audio_policy_configuration.xml " +
57 "--criteriontypes $(location :audio_policy_engine_criterion_types_template) " +
58 "--outputfile $(out)",
59 srcs: [
60 // The commented inputs must be provided to use this genrule_defaults
61 // @todo uncomment if 1428659 is merged":android_audio_base_header_file",
62 ":audio_policy_engine_criterion_types_template",
Francois Gaffie958be0d2021-02-03 08:41:58 +010063 ":libaudio_system_audio_base",
64 ":libaudio_system_audio_common_base",
Francois Gaffie5818b452019-08-27 16:30:04 +020065 // ":audio_policy_configuration_top_file",
66 // ":audio_policy_configuration_files",
67 ],
68 out: ["audio_policy_engine_criterion_types.xml"],
69}
70
71//##################################################################################################
72// Tools for audio policy engine parameter framework configurable domains
73//
Francois Gaffie7d602f02019-02-13 10:37:49 +010074python_binary_host {
75 name: "domainGeneratorPolicy.py",
76 main: "domainGeneratorPolicy.py",
77 srcs: [
78 "domainGeneratorPolicy.py",
79 ],
80 defaults: ["tools_default"],
81 libs: [
82 "EddParser.py",
83 "hostConfig.py",
84 "PFWScriptGenerator.py",
85 ],
86 required: [
87 "domainGeneratorConnector",
88 ],
89}
90
Francois Gaffie5818b452019-08-27 16:30:04 +020091genrule_defaults {
92 name: "domaingeneratorpolicyrule",
93 tools: [
94 "domainGeneratorPolicy.py",
95 "domainGeneratorConnector",
96 ],
97 cmd: "mkdir -p $(genDir)/Structure/Policy && " +
98 "cp $(locations :audio_policy_pfw_structure_files) $(genDir)/Structure/Policy && " +
99 "cp $(location :audio_policy_pfw_toplevel) $(genDir)/top_level && " +
100 "$(location domainGeneratorPolicy.py) " +
101 "--validate " +
102 "--domain-generator-tool $(location domainGeneratorConnector) " +
103 "--toplevel-config $(genDir)/top_level " +
104 "--criteria $(location :audio_policy_engine_criteria) " +
105 "--criteriontypes $(location :audio_policy_engine_criterion_types) " +
106 "--add-edds $(locations :edd_files) " +
107 "--schemas-dir external/parameter-framework/upstream/schemas " +
108 " > $(out)",
109 srcs: [
110 // The commented inputs must be provided to use this genrule_defaults
111 // ":audio_policy_pfw_toplevel",
112 // ":audio_policy_pfw_structure_files",
113 ":audio_policy_engine_criteria",
114 // ":audio_policy_engine_criterion_types",
115 // ":edd_files",
116 ],
117 out: ["PolicyConfigurableDomains.xml"],
118}
119
120//##################################################################################################
121// Tools for policy parameter-framework product strategies structure file generation
122//
Francois Gaffie7d602f02019-02-13 10:37:49 +0100123python_binary_host {
124 name: "buildStrategiesStructureFile.py",
125 main: "buildStrategiesStructureFile.py",
126 srcs: [
127 "buildStrategiesStructureFile.py",
128 ],
129 defaults: ["tools_default"],
130}
Francois Gaffie5818b452019-08-27 16:30:04 +0200131
132genrule_defaults {
133 name: "buildstrategiesstructurerule",
134 tools: ["buildStrategiesStructureFile.py"],
135 cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&"+
136 "$(location buildStrategiesStructureFile.py) " +
137 "--audiopolicyengineconfigurationfile $(genDir)/audio_policy_engine_configuration.xml "+
138 "--productstrategiesstructurefile $(location :product_strategies_structure_template) " +
139 "--outputfile $(out)",
140 srcs: [
141 // The commented inputs must be provided to use this genrule_defaults
142 // ":audio_policy_engine_configuration_files",
143 ":product_strategies_structure_template",
144 ],
145 out: ["ProductStrategies.xml"],
146}
Francois Gaffie8b048922020-01-15 17:42:52 +0100147
148//##################################################################################################
149// Tools for policy parameter-framework common type structure file generation
150//
151python_binary_host {
152 name: "buildCommonTypesStructureFile.py",
153 main: "buildCommonTypesStructureFile.py",
154 srcs: [
155 "buildCommonTypesStructureFile.py",
156 ],
157 defaults: ["tools_default"],
158}
159
160genrule_defaults {
161 name: "buildcommontypesstructurerule",
162 tools: ["buildCommonTypesStructureFile.py"],
163 cmd: "$(location buildCommonTypesStructureFile.py) " +
164 "--androidaudiobaseheader $(location :libaudio_system_audio_base) " +
165 "--commontypesstructure $(location :common_types_structure_template) " +
166 "--outputfile $(out)",
167 srcs: [
168 ":common_types_structure_template",
169 ":libaudio_system_audio_base",
170 ],
171 out: ["PolicySubsystem-CommonTypes.xml"],
172}