François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 1 | // 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 Badour | 948e6aa | 2021-02-12 21:02:31 -0800 | [diff] [blame] | 15 | package { |
| 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 Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 24 | //################################################################################################## |
| 25 | // Tools for audio policy engine criterion type configuration file |
| 26 | // |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 27 | python_binary_host { |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 28 | name: "buildPolicyCriterionTypes", |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 29 | main: "buildPolicyCriterionTypes.py", |
| 30 | srcs: [ |
| 31 | "buildPolicyCriterionTypes.py", |
| 32 | ], |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 33 | } |
| 34 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 35 | genrule_defaults { |
| 36 | name: "buildpolicycriteriontypesrule", |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 37 | tools: ["buildPolicyCriterionTypes"], |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 38 | cmd: "cp $(locations :audio_policy_configuration_files) $(genDir)/. && " + |
| 39 | "cp $(location :audio_policy_configuration_top_file) $(genDir)/audio_policy_configuration.xml && " + |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 40 | "$(location buildPolicyCriterionTypes) " + |
Francois Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame] | 41 | " --androidaudiobaseheader $(location :libaudio_system_audio_base) " + |
| 42 | " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " + |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 43 | "--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 Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame] | 50 | ":libaudio_system_audio_base", |
| 51 | ":libaudio_system_audio_common_base", |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 52 | // ":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 Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 61 | python_binary_host { |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 62 | name: "domainGeneratorPolicy", |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 63 | main: "domainGeneratorPolicy.py", |
| 64 | srcs: [ |
| 65 | "domainGeneratorPolicy.py", |
| 66 | ], |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 67 | libs: [ |
| 68 | "EddParser.py", |
| 69 | "hostConfig.py", |
| 70 | "PFWScriptGenerator.py", |
| 71 | ], |
| 72 | required: [ |
| 73 | "domainGeneratorConnector", |
| 74 | ], |
| 75 | } |
| 76 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 77 | genrule_defaults { |
| 78 | name: "domaingeneratorpolicyrule", |
| 79 | tools: [ |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 80 | "domainGeneratorPolicy", |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 81 | "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 Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 86 | "$(location domainGeneratorPolicy) " + |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 87 | "--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 Azucena | ecaf4b0 | 2023-10-30 21:03:33 -0700 | [diff] [blame^] | 102 | ":parameter_frameworks_configuration_schemas", |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 103 | ], |
| 104 | out: ["PolicyConfigurableDomains.xml"], |
| 105 | } |
| 106 | |
| 107 | //################################################################################################## |
| 108 | // Tools for policy parameter-framework product strategies structure file generation |
| 109 | // |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 110 | python_binary_host { |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 111 | name: "buildStrategiesStructureFile", |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 112 | main: "buildStrategiesStructureFile.py", |
| 113 | srcs: [ |
| 114 | "buildStrategiesStructureFile.py", |
| 115 | ], |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 116 | } |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 117 | |
| 118 | genrule_defaults { |
| 119 | name: "buildstrategiesstructurerule", |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 120 | tools: ["buildStrategiesStructureFile"], |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 121 | cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&"+ |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 122 | "$(location buildStrategiesStructureFile) " + |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 123 | "--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 Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 133 | |
| 134 | //################################################################################################## |
| 135 | // Tools for policy parameter-framework common type structure file generation |
| 136 | // |
| 137 | python_binary_host { |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 138 | name: "buildCommonTypesStructureFile", |
Francois Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 139 | main: "buildCommonTypesStructureFile.py", |
| 140 | srcs: [ |
| 141 | "buildCommonTypesStructureFile.py", |
| 142 | ], |
Francois Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | genrule_defaults { |
| 146 | name: "buildcommontypesstructurerule", |
Cole Faust | 97e9588 | 2022-09-01 17:13:49 -0700 | [diff] [blame] | 147 | tools: ["buildCommonTypesStructureFile"], |
| 148 | cmd: "$(location buildCommonTypesStructureFile) " + |
Francois Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 149 | "--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 | } |