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 | |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 15 | python_defaults { |
| 16 | name: "tools_default", |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 17 | version: { |
| 18 | py2: { |
Francois Gaffie | 31987fb | 2019-09-03 11:57:33 +0200 | [diff] [blame] | 19 | enabled: false, |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 20 | }, |
| 21 | py3: { |
Francois Gaffie | 31987fb | 2019-09-03 11:57:33 +0200 | [diff] [blame] | 22 | enabled: true, |
François Gaffie | a56b5c2 | 2018-02-21 18:04:39 +0100 | [diff] [blame] | 23 | }, |
| 24 | }, |
| 25 | } |
| 26 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 27 | //################################################################################################## |
| 28 | // Tools for audio policy engine criterion type configuration file |
| 29 | // |
Francois Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 30 | python_binary_host { |
| 31 | name: "buildPolicyCriterionTypes.py", |
| 32 | main: "buildPolicyCriterionTypes.py", |
| 33 | srcs: [ |
| 34 | "buildPolicyCriterionTypes.py", |
| 35 | ], |
| 36 | defaults: ["tools_default"], |
| 37 | } |
| 38 | |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 39 | genrule_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 Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame^] | 45 | " --androidaudiobaseheader $(location :libaudio_system_audio_base) " + |
| 46 | " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " + |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 47 | "--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 Gaffie | 958be0d | 2021-02-03 08:41:58 +0100 | [diff] [blame^] | 54 | ":libaudio_system_audio_base", |
| 55 | ":libaudio_system_audio_common_base", |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 56 | // ":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 Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 65 | python_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 Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 82 | genrule_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 Gaffie | 7d602f0 | 2019-02-13 10:37:49 +0100 | [diff] [blame] | 114 | python_binary_host { |
| 115 | name: "buildStrategiesStructureFile.py", |
| 116 | main: "buildStrategiesStructureFile.py", |
| 117 | srcs: [ |
| 118 | "buildStrategiesStructureFile.py", |
| 119 | ], |
| 120 | defaults: ["tools_default"], |
| 121 | } |
Francois Gaffie | 5818b45 | 2019-08-27 16:30:04 +0200 | [diff] [blame] | 122 | |
| 123 | genrule_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 Gaffie | 8b04892 | 2020-01-15 17:42:52 +0100 | [diff] [blame] | 138 | |
| 139 | //################################################################################################## |
| 140 | // Tools for policy parameter-framework common type structure file generation |
| 141 | // |
| 142 | python_binary_host { |
| 143 | name: "buildCommonTypesStructureFile.py", |
| 144 | main: "buildCommonTypesStructureFile.py", |
| 145 | srcs: [ |
| 146 | "buildCommonTypesStructureFile.py", |
| 147 | ], |
| 148 | defaults: ["tools_default"], |
| 149 | } |
| 150 | |
| 151 | genrule_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 | } |