blob: d9e97af1daae5f6b5510eb072612e32c5200eb7b [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) " +
45 // @todo update if 1428659 is merged "--androidaudiobaseheader $(location :android_audio_base_header_file) " +
46 " --androidaudiobaseheader system/media/audio/include/system/audio-base.h " +
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",
54 // ":audio_policy_configuration_top_file",
55 // ":audio_policy_configuration_files",
56 ],
57 out: ["audio_policy_engine_criterion_types.xml"],
58}
59
60//##################################################################################################
61// Tools for audio policy engine parameter framework configurable domains
62//
Francois Gaffie7d602f02019-02-13 10:37:49 +010063python_binary_host {
64 name: "domainGeneratorPolicy.py",
65 main: "domainGeneratorPolicy.py",
66 srcs: [
67 "domainGeneratorPolicy.py",
68 ],
69 defaults: ["tools_default"],
70 libs: [
71 "EddParser.py",
72 "hostConfig.py",
73 "PFWScriptGenerator.py",
74 ],
75 required: [
76 "domainGeneratorConnector",
77 ],
78}
79
Francois Gaffie5818b452019-08-27 16:30:04 +020080genrule_defaults {
81 name: "domaingeneratorpolicyrule",
82 tools: [
83 "domainGeneratorPolicy.py",
84 "domainGeneratorConnector",
85 ],
86 cmd: "mkdir -p $(genDir)/Structure/Policy && " +
87 "cp $(locations :audio_policy_pfw_structure_files) $(genDir)/Structure/Policy && " +
88 "cp $(location :audio_policy_pfw_toplevel) $(genDir)/top_level && " +
89 "$(location domainGeneratorPolicy.py) " +
90 "--validate " +
91 "--domain-generator-tool $(location domainGeneratorConnector) " +
92 "--toplevel-config $(genDir)/top_level " +
93 "--criteria $(location :audio_policy_engine_criteria) " +
94 "--criteriontypes $(location :audio_policy_engine_criterion_types) " +
95 "--add-edds $(locations :edd_files) " +
96 "--schemas-dir external/parameter-framework/upstream/schemas " +
97 " > $(out)",
98 srcs: [
99 // The commented inputs must be provided to use this genrule_defaults
100 // ":audio_policy_pfw_toplevel",
101 // ":audio_policy_pfw_structure_files",
102 ":audio_policy_engine_criteria",
103 // ":audio_policy_engine_criterion_types",
104 // ":edd_files",
105 ],
106 out: ["PolicyConfigurableDomains.xml"],
107}
108
109//##################################################################################################
110// Tools for policy parameter-framework product strategies structure file generation
111//
Francois Gaffie7d602f02019-02-13 10:37:49 +0100112python_binary_host {
113 name: "buildStrategiesStructureFile.py",
114 main: "buildStrategiesStructureFile.py",
115 srcs: [
116 "buildStrategiesStructureFile.py",
117 ],
118 defaults: ["tools_default"],
119}
Francois Gaffie5818b452019-08-27 16:30:04 +0200120
121genrule_defaults {
122 name: "buildstrategiesstructurerule",
123 tools: ["buildStrategiesStructureFile.py"],
124 cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&"+
125 "$(location buildStrategiesStructureFile.py) " +
126 "--audiopolicyengineconfigurationfile $(genDir)/audio_policy_engine_configuration.xml "+
127 "--productstrategiesstructurefile $(location :product_strategies_structure_template) " +
128 "--outputfile $(out)",
129 srcs: [
130 // The commented inputs must be provided to use this genrule_defaults
131 // ":audio_policy_engine_configuration_files",
132 ":product_strategies_structure_template",
133 ],
134 out: ["ProductStrategies.xml"],
135}