blob: 3aec064fbdc7722e113b8d8c65f32fad772e4c88 [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 Badour948e6aa2021-02-12 21:02:31 -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 Gaffie5818b452019-08-27 16:30:04 +020024//##################################################################################################
25// Tools for audio policy engine criterion type configuration file
26//
Francois Gaffie7d602f02019-02-13 10:37:49 +010027python_binary_host {
Cole Faust97e95882022-09-01 17:13:49 -070028 name: "buildPolicyCriterionTypes",
Francois Gaffie7d602f02019-02-13 10:37:49 +010029 main: "buildPolicyCriterionTypes.py",
30 srcs: [
31 "buildPolicyCriterionTypes.py",
32 ],
Francois Gaffie7d602f02019-02-13 10:37:49 +010033}
34
Francois Gaffie5818b452019-08-27 16:30:04 +020035genrule_defaults {
36 name: "buildpolicycriteriontypesrule",
Cole Faust97e95882022-09-01 17:13:49 -070037 tools: ["buildPolicyCriterionTypes"],
Francois Gaffie5818b452019-08-27 16:30:04 +020038 cmd: "cp $(locations :audio_policy_configuration_files) $(genDir)/. && " +
39 "cp $(location :audio_policy_configuration_top_file) $(genDir)/audio_policy_configuration.xml && " +
Cole Faust97e95882022-09-01 17:13:49 -070040 "$(location buildPolicyCriterionTypes) " +
Francois Gaffie958be0d2021-02-03 08:41:58 +010041 " --androidaudiobaseheader $(location :libaudio_system_audio_base) " +
42 " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " +
Francois Gaffie5818b452019-08-27 16:30:04 +020043 "--audiopolicyconfigurationfile $(genDir)/audio_policy_configuration.xml " +
44 "--criteriontypes $(location :audio_policy_engine_criterion_types_template) " +
45 "--outputfile $(out)",
46 srcs: [
47 // The commented inputs must be provided to use this genrule_defaults
48 // @todo uncomment if 1428659 is merged":android_audio_base_header_file",
49 ":audio_policy_engine_criterion_types_template",
Francois Gaffie958be0d2021-02-03 08:41:58 +010050 ":libaudio_system_audio_base",
51 ":libaudio_system_audio_common_base",
Francois Gaffie5818b452019-08-27 16:30:04 +020052 // ":audio_policy_configuration_top_file",
53 // ":audio_policy_configuration_files",
54 ],
55 out: ["audio_policy_engine_criterion_types.xml"],
56}
57
58//##################################################################################################
59// Tools for audio policy engine parameter framework configurable domains
60//
Francois Gaffie7d602f02019-02-13 10:37:49 +010061python_binary_host {
Cole Faust97e95882022-09-01 17:13:49 -070062 name: "domainGeneratorPolicy",
Francois Gaffie7d602f02019-02-13 10:37:49 +010063 main: "domainGeneratorPolicy.py",
64 srcs: [
65 "domainGeneratorPolicy.py",
66 ],
Francois Gaffie7d602f02019-02-13 10:37:49 +010067 libs: [
68 "EddParser.py",
69 "hostConfig.py",
70 "PFWScriptGenerator.py",
71 ],
72 required: [
73 "domainGeneratorConnector",
74 ],
75}
76
Francois Gaffie5818b452019-08-27 16:30:04 +020077genrule_defaults {
78 name: "domaingeneratorpolicyrule",
79 tools: [
Cole Faust97e95882022-09-01 17:13:49 -070080 "domainGeneratorPolicy",
Francois Gaffie5818b452019-08-27 16:30:04 +020081 "domainGeneratorConnector",
82 ],
83 cmd: "mkdir -p $(genDir)/Structure/Policy && " +
84 "cp $(locations :audio_policy_pfw_structure_files) $(genDir)/Structure/Policy && " +
85 "cp $(location :audio_policy_pfw_toplevel) $(genDir)/top_level && " +
Cole Faust97e95882022-09-01 17:13:49 -070086 "$(location domainGeneratorPolicy) " +
Francois Gaffie5818b452019-08-27 16:30:04 +020087 "--validate " +
88 "--domain-generator-tool $(location domainGeneratorConnector) " +
89 "--toplevel-config $(genDir)/top_level " +
90 "--criteria $(location :audio_policy_engine_criteria) " +
91 "--criteriontypes $(location :audio_policy_engine_criterion_types) " +
92 "--add-edds $(locations :edd_files) " +
93 "--schemas-dir external/parameter-framework/upstream/schemas " +
94 " > $(out)",
95 srcs: [
96 // The commented inputs must be provided to use this genrule_defaults
97 // ":audio_policy_pfw_toplevel",
98 // ":audio_policy_pfw_structure_files",
99 ":audio_policy_engine_criteria",
100 // ":audio_policy_engine_criterion_types",
101 // ":edd_files",
Oscar Azucenaecaf4b02023-10-30 21:03:33 -0700102 ":parameter_frameworks_configuration_schemas",
Francois Gaffie5818b452019-08-27 16:30:04 +0200103 ],
104 out: ["PolicyConfigurableDomains.xml"],
105}
106
107//##################################################################################################
108// Tools for policy parameter-framework product strategies structure file generation
109//
Francois Gaffie7d602f02019-02-13 10:37:49 +0100110python_binary_host {
Cole Faust97e95882022-09-01 17:13:49 -0700111 name: "buildStrategiesStructureFile",
Francois Gaffie7d602f02019-02-13 10:37:49 +0100112 main: "buildStrategiesStructureFile.py",
113 srcs: [
114 "buildStrategiesStructureFile.py",
115 ],
Francois Gaffie7d602f02019-02-13 10:37:49 +0100116}
Francois Gaffie5818b452019-08-27 16:30:04 +0200117
118genrule_defaults {
119 name: "buildstrategiesstructurerule",
Cole Faust97e95882022-09-01 17:13:49 -0700120 tools: ["buildStrategiesStructureFile"],
Francois Gaffie5818b452019-08-27 16:30:04 +0200121 cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&"+
Cole Faust97e95882022-09-01 17:13:49 -0700122 "$(location buildStrategiesStructureFile) " +
Francois Gaffie5818b452019-08-27 16:30:04 +0200123 "--audiopolicyengineconfigurationfile $(genDir)/audio_policy_engine_configuration.xml "+
124 "--productstrategiesstructurefile $(location :product_strategies_structure_template) " +
125 "--outputfile $(out)",
126 srcs: [
127 // The commented inputs must be provided to use this genrule_defaults
128 // ":audio_policy_engine_configuration_files",
129 ":product_strategies_structure_template",
130 ],
131 out: ["ProductStrategies.xml"],
132}
Francois Gaffie8b048922020-01-15 17:42:52 +0100133
134//##################################################################################################
135// Tools for policy parameter-framework common type structure file generation
136//
137python_binary_host {
Cole Faust97e95882022-09-01 17:13:49 -0700138 name: "buildCommonTypesStructureFile",
Francois Gaffie8b048922020-01-15 17:42:52 +0100139 main: "buildCommonTypesStructureFile.py",
140 srcs: [
141 "buildCommonTypesStructureFile.py",
142 ],
Francois Gaffie8b048922020-01-15 17:42:52 +0100143}
144
145genrule_defaults {
146 name: "buildcommontypesstructurerule",
Cole Faust97e95882022-09-01 17:13:49 -0700147 tools: ["buildCommonTypesStructureFile"],
148 cmd: "$(location buildCommonTypesStructureFile) " +
Francois Gaffie8b048922020-01-15 17:42:52 +0100149 "--androidaudiobaseheader $(location :libaudio_system_audio_base) " +
150 "--commontypesstructure $(location :common_types_structure_template) " +
151 "--outputfile $(out)",
152 srcs: [
153 ":common_types_structure_template",
154 ":libaudio_system_audio_base",
155 ],
156 out: ["PolicySubsystem-CommonTypes.xml"],
157}