blob: b51918a6f8a571022ae233bc40ad1caaa8b58f6f [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
Francois Gaffie7d602f02019-02-13 10:37:49 +010015python_defaults {
16 name: "tools_default",
François Gaffiea56b5c22018-02-21 18:04:39 +010017 version: {
18 py2: {
Francois Gaffie31987fb2019-09-03 11:57:33 +020019 enabled: false,
François Gaffiea56b5c22018-02-21 18:04:39 +010020 },
21 py3: {
Francois Gaffie31987fb2019-09-03 11:57:33 +020022 enabled: true,
François Gaffiea56b5c22018-02-21 18:04:39 +010023 },
24 },
25}
26
Francois Gaffie5818b452019-08-27 16:30:04 +020027//##################################################################################################
28// Tools for audio policy engine criterion type configuration file
29//
Francois Gaffie7d602f02019-02-13 10:37:49 +010030python_binary_host {
31 name: "buildPolicyCriterionTypes.py",
32 main: "buildPolicyCriterionTypes.py",
33 srcs: [
34 "buildPolicyCriterionTypes.py",
35 ],
36 defaults: ["tools_default"],
37}
38
Francois Gaffie5818b452019-08-27 16:30:04 +020039genrule_defaults {
40 name: "buildpolicycriteriontypesrule",
41 tools: ["buildPolicyCriterionTypes.py"],
42 cmd: "cp $(locations :audio_policy_configuration_files) $(genDir)/. && " +
43 "cp $(location :audio_policy_configuration_top_file) $(genDir)/audio_policy_configuration.xml && " +
44 "$(location buildPolicyCriterionTypes.py) " +
Francois Gaffie958be0d2021-02-03 08:41:58 +010045 " --androidaudiobaseheader $(location :libaudio_system_audio_base) " +
46 " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " +
Francois Gaffie5818b452019-08-27 16:30:04 +020047 "--audiopolicyconfigurationfile $(genDir)/audio_policy_configuration.xml " +
48 "--criteriontypes $(location :audio_policy_engine_criterion_types_template) " +
49 "--outputfile $(out)",
50 srcs: [
51 // The commented inputs must be provided to use this genrule_defaults
52 // @todo uncomment if 1428659 is merged":android_audio_base_header_file",
53 ":audio_policy_engine_criterion_types_template",
Francois Gaffie958be0d2021-02-03 08:41:58 +010054 ":libaudio_system_audio_base",
55 ":libaudio_system_audio_common_base",
Francois Gaffie5818b452019-08-27 16:30:04 +020056 // ":audio_policy_configuration_top_file",
57 // ":audio_policy_configuration_files",
58 ],
59 out: ["audio_policy_engine_criterion_types.xml"],
60}
61
62//##################################################################################################
63// Tools for audio policy engine parameter framework configurable domains
64//
Francois Gaffie7d602f02019-02-13 10:37:49 +010065python_binary_host {
66 name: "domainGeneratorPolicy.py",
67 main: "domainGeneratorPolicy.py",
68 srcs: [
69 "domainGeneratorPolicy.py",
70 ],
71 defaults: ["tools_default"],
72 libs: [
73 "EddParser.py",
74 "hostConfig.py",
75 "PFWScriptGenerator.py",
76 ],
77 required: [
78 "domainGeneratorConnector",
79 ],
80}
81
Francois Gaffie5818b452019-08-27 16:30:04 +020082genrule_defaults {
83 name: "domaingeneratorpolicyrule",
84 tools: [
85 "domainGeneratorPolicy.py",
86 "domainGeneratorConnector",
87 ],
88 cmd: "mkdir -p $(genDir)/Structure/Policy && " +
89 "cp $(locations :audio_policy_pfw_structure_files) $(genDir)/Structure/Policy && " +
90 "cp $(location :audio_policy_pfw_toplevel) $(genDir)/top_level && " +
91 "$(location domainGeneratorPolicy.py) " +
92 "--validate " +
93 "--domain-generator-tool $(location domainGeneratorConnector) " +
94 "--toplevel-config $(genDir)/top_level " +
95 "--criteria $(location :audio_policy_engine_criteria) " +
96 "--criteriontypes $(location :audio_policy_engine_criterion_types) " +
97 "--add-edds $(locations :edd_files) " +
98 "--schemas-dir external/parameter-framework/upstream/schemas " +
99 " > $(out)",
100 srcs: [
101 // The commented inputs must be provided to use this genrule_defaults
102 // ":audio_policy_pfw_toplevel",
103 // ":audio_policy_pfw_structure_files",
104 ":audio_policy_engine_criteria",
105 // ":audio_policy_engine_criterion_types",
106 // ":edd_files",
107 ],
108 out: ["PolicyConfigurableDomains.xml"],
109}
110
111//##################################################################################################
112// Tools for policy parameter-framework product strategies structure file generation
113//
Francois Gaffie7d602f02019-02-13 10:37:49 +0100114python_binary_host {
115 name: "buildStrategiesStructureFile.py",
116 main: "buildStrategiesStructureFile.py",
117 srcs: [
118 "buildStrategiesStructureFile.py",
119 ],
120 defaults: ["tools_default"],
121}
Francois Gaffie5818b452019-08-27 16:30:04 +0200122
123genrule_defaults {
124 name: "buildstrategiesstructurerule",
125 tools: ["buildStrategiesStructureFile.py"],
126 cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&"+
127 "$(location buildStrategiesStructureFile.py) " +
128 "--audiopolicyengineconfigurationfile $(genDir)/audio_policy_engine_configuration.xml "+
129 "--productstrategiesstructurefile $(location :product_strategies_structure_template) " +
130 "--outputfile $(out)",
131 srcs: [
132 // The commented inputs must be provided to use this genrule_defaults
133 // ":audio_policy_engine_configuration_files",
134 ":product_strategies_structure_template",
135 ],
136 out: ["ProductStrategies.xml"],
137}
Francois Gaffie8b048922020-01-15 17:42:52 +0100138
139//##################################################################################################
140// Tools for policy parameter-framework common type structure file generation
141//
142python_binary_host {
143 name: "buildCommonTypesStructureFile.py",
144 main: "buildCommonTypesStructureFile.py",
145 srcs: [
146 "buildCommonTypesStructureFile.py",
147 ],
148 defaults: ["tools_default"],
149}
150
151genrule_defaults {
152 name: "buildcommontypesstructurerule",
153 tools: ["buildCommonTypesStructureFile.py"],
154 cmd: "$(location buildCommonTypesStructureFile.py) " +
155 "--androidaudiobaseheader $(location :libaudio_system_audio_base) " +
156 "--commontypesstructure $(location :common_types_structure_template) " +
157 "--outputfile $(out)",
158 srcs: [
159 ":common_types_structure_template",
160 ":libaudio_system_audio_base",
161 ],
162 out: ["PolicySubsystem-CommonTypes.xml"],
163}