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 | 56786ac | 2021-02-25 15:24:36 -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 | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 24 | python_defaults { |
| 25 | name: "tools_default", |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 26 | version: { |
| 27 | py2: { |
Francois Gaffie | 31987fb | 2019-09-03 11:57:33 +0200 | [diff] [blame] | 28 | enabled: false, |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 29 | }, |
| 30 | py3: { |
Francois Gaffie | 31987fb | 2019-09-03 11:57:33 +0200 | [diff] [blame] | 31 | enabled: true, |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 32 | }, |
| 33 | }, |
| 34 | } |
| 35 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 36 | //################################################################################################## |
| 37 | // Tools for audio policy engine criterion type configuration file |
| 38 | // |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 39 | python_binary_host { |
| 40 | name: "buildPolicyCriterionTypes.py", |
| 41 | main: "buildPolicyCriterionTypes.py", |
| 42 | srcs: [ |
| 43 | "buildPolicyCriterionTypes.py", |
| 44 | ], |
| 45 | defaults: ["tools_default"], |
| 46 | } |
| 47 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 48 | genrule_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 Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame] | 54 | " --androidaudiobaseheader $(location :libaudio_system_audio_base) " + |
| 55 | " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " + |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 56 | "--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 Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame] | 63 | ":libaudio_system_audio_base", |
| 64 | ":libaudio_system_audio_common_base", |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 65 | // ":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 Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 74 | python_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 Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 91 | genrule_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 Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 123 | python_binary_host { |
| 124 | name: "buildStrategiesStructureFile.py", |
| 125 | main: "buildStrategiesStructureFile.py", |
| 126 | srcs: [ |
| 127 | "buildStrategiesStructureFile.py", |
| 128 | ], |
| 129 | defaults: ["tools_default"], |
| 130 | } |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 131 | |
| 132 | genrule_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 Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 147 | |
| 148 | //################################################################################################## |
| 149 | // Tools for policy parameter-framework common type structure file generation |
| 150 | // |
| 151 | python_binary_host { |
| 152 | name: "buildCommonTypesStructureFile.py", |
| 153 | main: "buildCommonTypesStructureFile.py", |
| 154 | srcs: [ |
| 155 | "buildCommonTypesStructureFile.py", |
| 156 | ], |
| 157 | defaults: ["tools_default"], |
| 158 | } |
| 159 | |
| 160 | genrule_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 | } |