blob: baad58eedcb17c353c1a0a7dd70b580bf2ec66bf [file] [log] [blame]
Jiyong Parkc678ad32018-04-10 13:07:10 +09001// Copyright 2016 Google Inc. All rights reserved.
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
Jaewoong Jung4b79e982020-06-01 10:45:49 -070015package etc
Jiyong Parkc678ad32018-04-10 13:07:10 +090016
Yo Chiang803c40d2020-11-16 20:32:51 +080017// This file implements module types that install prebuilt artifacts.
18//
19// There exist two classes of prebuilt modules in the Android tree. The first class are the ones
20// based on `android.Prebuilt`, such as `cc_prebuilt_library` and `java_import`. This kind of
21// modules may exist both as prebuilts and source at the same time, though only one would be
22// installed and the other would be marked disabled. The `prebuilt_postdeps` mutator would select
23// the actual modules to be installed. More details in android/prebuilt.go.
24//
25// The second class is described in this file. Unlike `android.Prebuilt` based module types,
26// `prebuilt_etc` exist only as prebuilts and cannot have a same-named source module counterpart.
27// This makes the logic of `prebuilt_etc` to be much simpler as they don't need to go through the
28// various `prebuilt_*` mutators.
Jaewoong Jung4b79e982020-06-01 10:45:49 -070029
Yo Chiang803c40d2020-11-16 20:32:51 +080030import (
Kiyoung Kimae11c232021-07-19 11:38:04 +090031 "encoding/json"
Jiyong Park76a42f52021-02-16 06:50:37 +090032 "fmt"
Kiyoung Kimae11c232021-07-19 11:38:04 +090033 "path/filepath"
Alixbbfd5382022-06-09 18:52:05 +000034 "reflect"
Inseob Kim27408bf2021-04-06 21:00:17 +090035 "strings"
Jiyong Park76a42f52021-02-16 06:50:37 +090036
Jaewoong Jung4b79e982020-06-01 10:45:49 -070037 "github.com/google/blueprint/proptools"
38
39 "android/soong/android"
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -040040 "android/soong/bazel"
Kiyoung Kimae11c232021-07-19 11:38:04 +090041 "android/soong/snapshot"
Jaewoong Jung4b79e982020-06-01 10:45:49 -070042)
43
44var pctx = android.NewPackageContext("android/soong/etc")
Jiyong Parkc678ad32018-04-10 13:07:10 +090045
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -080046// TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file.
Jiyong Parkc678ad32018-04-10 13:07:10 +090047
48func init() {
Jaewoong Jung4b79e982020-06-01 10:45:49 -070049 pctx.Import("android/soong/android")
Jooyung Han0703fd82020-08-26 22:11:53 +090050 RegisterPrebuiltEtcBuildComponents(android.InitRegistrationContext)
Kiyoung Kimae11c232021-07-19 11:38:04 +090051 snapshot.RegisterSnapshotAction(generatePrebuiltSnapshot)
Jooyung Han0703fd82020-08-26 22:11:53 +090052}
Jaewoong Jung4b79e982020-06-01 10:45:49 -070053
Jooyung Han0703fd82020-08-26 22:11:53 +090054func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
55 ctx.RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory)
56 ctx.RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory)
Inseob Kim27408bf2021-04-06 21:00:17 +090057 ctx.RegisterModuleType("prebuilt_root", PrebuiltRootFactory)
Liz Kammere9ecddc2022-01-04 17:27:52 -050058 ctx.RegisterModuleType("prebuilt_root_host", PrebuiltRootHostFactory)
Jooyung Han0703fd82020-08-26 22:11:53 +090059 ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
60 ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
61 ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
62 ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
63 ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
Colin Cross83ebf232021-04-09 09:41:23 -070064 ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory)
Inseob Kim1e27a142021-05-06 11:46:11 +000065
66 ctx.RegisterModuleType("prebuilt_defaults", defaultsFactory)
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -040067
Jiyong Parkc678ad32018-04-10 13:07:10 +090068}
69
Paul Duffin1172fed2021-03-08 11:28:18 +000070var PrepareForTestWithPrebuiltEtc = android.FixtureRegisterWithContext(RegisterPrebuiltEtcBuildComponents)
71
Jiyong Parkc678ad32018-04-10 13:07:10 +090072type prebuiltEtcProperties struct {
Yo Chiang803c40d2020-11-16 20:32:51 +080073 // Source file of this prebuilt. Can reference a genrule type module with the ":module" syntax.
Colin Cross27b922f2019-03-04 22:35:41 -080074 Src *string `android:"path,arch_variant"`
Jiyong Parkc678ad32018-04-10 13:07:10 +090075
Yo Chiangf0e19fe2020-11-18 15:28:42 +080076 // Optional name for the installed file. If unspecified, name of the module is used as the file
77 // name.
Jiyong Park139a2e62018-10-26 21:49:39 +090078 Filename *string `android:"arch_variant"`
79
Yo Chiangf0e19fe2020-11-18 15:28:42 +080080 // When set to true, and filename property is not set, the name for the installed file
Jiyong Park1a7cf082018-11-13 11:59:12 +090081 // is the same as the file name of the source file.
82 Filename_from_src *bool `android:"arch_variant"`
83
Yifan Hong1b3348d2020-01-21 15:53:22 -080084 // Make this module available when building for ramdisk.
Yifan Hong39143a92020-10-26 12:43:12 -070085 // On device without a dedicated recovery partition, the module is only
86 // available after switching root into
87 // /first_stage_ramdisk. To expose the module before switching root, install
88 // the recovery variant instead.
Yifan Hong1b3348d2020-01-21 15:53:22 -080089 Ramdisk_available *bool
90
Yifan Hong60e0cfb2020-10-21 15:17:56 -070091 // Make this module available when building for vendor ramdisk.
Yifan Hong39143a92020-10-26 12:43:12 -070092 // On device without a dedicated recovery partition, the module is only
93 // available after switching root into
94 // /first_stage_ramdisk. To expose the module before switching root, install
95 // the recovery variant instead.
Yifan Hong60e0cfb2020-10-21 15:17:56 -070096 Vendor_ramdisk_available *bool
97
Inseob Kim08758f02021-04-08 21:13:22 +090098 // Make this module available when building for debug ramdisk.
99 Debug_ramdisk_available *bool
100
Tao Bao0ba5c942018-08-14 22:20:22 -0700101 // Make this module available when building for recovery.
102 Recovery_available *bool
103
Jiyong Parkad9ce042018-10-31 22:49:57 +0900104 // Whether this module is directly installable to one of the partitions. Default: true.
105 Installable *bool
Yo Chiang3d64d492020-05-27 17:56:39 +0800106
107 // Install symlinks to the installed file.
108 Symlinks []string `android:"arch_variant"`
Jiyong Parkc678ad32018-04-10 13:07:10 +0900109}
110
Inseob Kim27408bf2021-04-06 21:00:17 +0900111type prebuiltSubdirProperties struct {
112 // Optional subdirectory under which this file is installed into, cannot be specified with
113 // relative_install_path, prefer relative_install_path.
114 Sub_dir *string `android:"arch_variant"`
115
116 // Optional subdirectory under which this file is installed into, cannot be specified with
117 // sub_dir.
118 Relative_install_path *string `android:"arch_variant"`
119}
120
Jooyung Han39edb6c2019-11-06 16:53:07 +0900121type PrebuiltEtcModule interface {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700122 android.Module
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800123
124 // Returns the base install directory, such as "etc", "usr/share".
Jooyung Han0703fd82020-08-26 22:11:53 +0900125 BaseDir() string
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800126
127 // Returns the sub install directory relative to BaseDir().
Jooyung Han39edb6c2019-11-06 16:53:07 +0900128 SubDir() string
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800129
130 // Returns an android.OutputPath to the intermeidate file, which is the renamed prebuilt source
131 // file.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700132 OutputFile() android.OutputPath
Jooyung Han39edb6c2019-11-06 16:53:07 +0900133}
134
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900135type PrebuiltEtc struct {
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700136 android.ModuleBase
Inseob Kim1e27a142021-05-06 11:46:11 +0000137 android.DefaultableModuleBase
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400138 android.BazelModuleBase
Jiyong Parkc678ad32018-04-10 13:07:10 +0900139
Kiyoung Kimae11c232021-07-19 11:38:04 +0900140 snapshot.VendorSnapshotModuleInterface
141 snapshot.RecoverySnapshotModuleInterface
142
Inseob Kim27408bf2021-04-06 21:00:17 +0900143 properties prebuiltEtcProperties
144 subdirProperties prebuiltSubdirProperties
Jiyong Parkc678ad32018-04-10 13:07:10 +0900145
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700146 sourceFilePath android.Path
147 outputFilePath android.OutputPath
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800148 // The base install location, e.g. "etc" for prebuilt_etc, "usr/share" for prebuilt_usr_share.
Patrice Arruda057a8b12019-06-03 15:29:27 -0700149 installDirBase string
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800150 // The base install location when soc_specific property is set to true, e.g. "firmware" for
151 // prebuilt_firmware.
Patrice Arruda057a8b12019-06-03 15:29:27 -0700152 socInstallDirBase string
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700153 installDirPath android.InstallPath
154 additionalDependencies *android.Paths
Jiyong Parkc678ad32018-04-10 13:07:10 +0900155}
156
Inseob Kim1e27a142021-05-06 11:46:11 +0000157type Defaults struct {
158 android.ModuleBase
159 android.DefaultsModuleBase
160}
161
Yifan Hong1b3348d2020-01-21 15:53:22 -0800162func (p *PrebuiltEtc) inRamdisk() bool {
163 return p.ModuleBase.InRamdisk() || p.ModuleBase.InstallInRamdisk()
164}
165
166func (p *PrebuiltEtc) onlyInRamdisk() bool {
167 return p.ModuleBase.InstallInRamdisk()
168}
169
170func (p *PrebuiltEtc) InstallInRamdisk() bool {
171 return p.inRamdisk()
172}
173
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700174func (p *PrebuiltEtc) inVendorRamdisk() bool {
175 return p.ModuleBase.InVendorRamdisk() || p.ModuleBase.InstallInVendorRamdisk()
176}
177
178func (p *PrebuiltEtc) onlyInVendorRamdisk() bool {
179 return p.ModuleBase.InstallInVendorRamdisk()
180}
181
182func (p *PrebuiltEtc) InstallInVendorRamdisk() bool {
183 return p.inVendorRamdisk()
184}
185
Inseob Kim08758f02021-04-08 21:13:22 +0900186func (p *PrebuiltEtc) inDebugRamdisk() bool {
187 return p.ModuleBase.InDebugRamdisk() || p.ModuleBase.InstallInDebugRamdisk()
188}
189
190func (p *PrebuiltEtc) onlyInDebugRamdisk() bool {
191 return p.ModuleBase.InstallInDebugRamdisk()
192}
193
194func (p *PrebuiltEtc) InstallInDebugRamdisk() bool {
195 return p.inDebugRamdisk()
196}
197
Kiyoung Kimae11c232021-07-19 11:38:04 +0900198func (p *PrebuiltEtc) InRecovery() bool {
Colin Cross7228ecd2019-11-18 16:00:16 -0800199 return p.ModuleBase.InRecovery() || p.ModuleBase.InstallInRecovery()
Tao Bao0ba5c942018-08-14 22:20:22 -0700200}
201
202func (p *PrebuiltEtc) onlyInRecovery() bool {
203 return p.ModuleBase.InstallInRecovery()
204}
205
206func (p *PrebuiltEtc) InstallInRecovery() bool {
Kiyoung Kimae11c232021-07-19 11:38:04 +0900207 return p.InRecovery()
Tao Bao0ba5c942018-08-14 22:20:22 -0700208}
209
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700210var _ android.ImageInterface = (*PrebuiltEtc)(nil)
Colin Cross7228ecd2019-11-18 16:00:16 -0800211
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700212func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
Colin Cross7228ecd2019-11-18 16:00:16 -0800213
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700214func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700215 return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
Inseob Kim08758f02021-04-08 21:13:22 +0900216 !p.ModuleBase.InstallInVendorRamdisk() && !p.ModuleBase.InstallInDebugRamdisk()
Yifan Hong1b3348d2020-01-21 15:53:22 -0800217}
218
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700219func (p *PrebuiltEtc) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
220 return proptools.Bool(p.properties.Ramdisk_available) || p.ModuleBase.InstallInRamdisk()
Colin Cross7228ecd2019-11-18 16:00:16 -0800221}
222
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700223func (p *PrebuiltEtc) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
224 return proptools.Bool(p.properties.Vendor_ramdisk_available) || p.ModuleBase.InstallInVendorRamdisk()
225}
226
Inseob Kim08758f02021-04-08 21:13:22 +0900227func (p *PrebuiltEtc) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
228 return proptools.Bool(p.properties.Debug_ramdisk_available) || p.ModuleBase.InstallInDebugRamdisk()
229}
230
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700231func (p *PrebuiltEtc) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
232 return proptools.Bool(p.properties.Recovery_available) || p.ModuleBase.InstallInRecovery()
Colin Cross7228ecd2019-11-18 16:00:16 -0800233}
234
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700235func (p *PrebuiltEtc) ExtraImageVariations(ctx android.BaseModuleContext) []string {
Colin Cross7228ecd2019-11-18 16:00:16 -0800236 return nil
237}
238
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700239func (p *PrebuiltEtc) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
Colin Cross7228ecd2019-11-18 16:00:16 -0800240}
241
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700242func (p *PrebuiltEtc) SourceFilePath(ctx android.ModuleContext) android.Path {
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800243 return android.PathForModuleSrc(ctx, proptools.String(p.properties.Src))
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900244}
245
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700246func (p *PrebuiltEtc) InstallDirPath() android.InstallPath {
Jooyung Hana0171822019-07-22 15:48:36 +0900247 return p.installDirPath
248}
249
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900250// This allows other derivative modules (e.g. prebuilt_etc_xml) to perform
251// additional steps (like validating the src) before the file is installed.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700252func (p *PrebuiltEtc) SetAdditionalDependencies(paths android.Paths) {
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900253 p.additionalDependencies = &paths
254}
255
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700256func (p *PrebuiltEtc) OutputFile() android.OutputPath {
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900257 return p.outputFilePath
258}
259
Jiyong Park76a42f52021-02-16 06:50:37 +0900260var _ android.OutputFileProducer = (*PrebuiltEtc)(nil)
261
262func (p *PrebuiltEtc) OutputFiles(tag string) (android.Paths, error) {
263 switch tag {
264 case "":
265 return android.Paths{p.outputFilePath}, nil
266 default:
267 return nil, fmt.Errorf("unsupported module reference tag %q", tag)
268 }
269}
270
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900271func (p *PrebuiltEtc) SubDir() string {
Inseob Kim27408bf2021-04-06 21:00:17 +0900272 if subDir := proptools.String(p.subdirProperties.Sub_dir); subDir != "" {
Liz Kammer0449a632020-06-26 10:12:36 -0700273 return subDir
274 }
Inseob Kim27408bf2021-04-06 21:00:17 +0900275 return proptools.String(p.subdirProperties.Relative_install_path)
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900276}
277
Jooyung Han0703fd82020-08-26 22:11:53 +0900278func (p *PrebuiltEtc) BaseDir() string {
Jooyung Han8e5685d2020-09-21 11:02:57 +0900279 return p.installDirBase
Jooyung Han0703fd82020-08-26 22:11:53 +0900280}
281
Jiyong Parkad9ce042018-10-31 22:49:57 +0900282func (p *PrebuiltEtc) Installable() bool {
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800283 return p.properties.Installable == nil || proptools.Bool(p.properties.Installable)
Jiyong Parkad9ce042018-10-31 22:49:57 +0900284}
285
Kiyoung Kimae11c232021-07-19 11:38:04 +0900286func (p *PrebuiltEtc) InVendor() bool {
287 return p.ModuleBase.InstallInVendor()
288}
289
290func (p *PrebuiltEtc) ExcludeFromVendorSnapshot() bool {
291 return false
292}
293
294func (p *PrebuiltEtc) ExcludeFromRecoverySnapshot() bool {
295 return false
296}
297
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700298func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800299 filename := proptools.String(p.properties.Filename)
300 filenameFromSrc := proptools.Bool(p.properties.Filename_from_src)
Colin Cross725eac62022-10-03 15:31:29 -0700301 if p.properties.Src != nil {
302 p.sourceFilePath = android.PathForModuleSrc(ctx, proptools.String(p.properties.Src))
303
304 // Determine the output file basename.
305 // If Filename is set, use the name specified by the property.
306 // If Filename_from_src is set, use the source file name.
307 // Otherwise use the module name.
308 if filename != "" {
309 if filenameFromSrc {
310 ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true")
311 return
312 }
313 } else if filenameFromSrc {
314 filename = p.sourceFilePath.Base()
315 } else {
316 filename = ctx.ModuleName()
Jiyong Park1a7cf082018-11-13 11:59:12 +0900317 }
Colin Cross725eac62022-10-03 15:31:29 -0700318 } else if ctx.Config().AllowMissingDependencies() {
319 // If no srcs was set and AllowMissingDependencies is enabled then
320 // mark the module as missing dependencies and set a fake source path
321 // and file name.
322 ctx.AddMissingDependencies([]string{"MISSING_PREBUILT_SRC_FILE"})
323 p.sourceFilePath = android.PathForModuleSrc(ctx)
324 if filename == "" {
325 filename = ctx.ModuleName()
326 }
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800327 } else {
Colin Cross725eac62022-10-03 15:31:29 -0700328 ctx.PropertyErrorf("src", "missing prebuilt source file")
329 return
Jiyong Park139a2e62018-10-26 21:49:39 +0900330 }
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700331 p.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath
Patrice Arruda057a8b12019-06-03 15:29:27 -0700332
Inseob Kim27408bf2021-04-06 21:00:17 +0900333 if strings.Contains(filename, "/") {
334 ctx.PropertyErrorf("filename", "filename cannot contain separator '/'")
335 return
336 }
337
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800338 // Check that `sub_dir` and `relative_install_path` are not set at the same time.
Inseob Kim27408bf2021-04-06 21:00:17 +0900339 if p.subdirProperties.Sub_dir != nil && p.subdirProperties.Relative_install_path != nil {
Liz Kammer0449a632020-06-26 10:12:36 -0700340 ctx.PropertyErrorf("sub_dir", "relative_install_path is set. Cannot set sub_dir")
341 }
342
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800343 // If soc install dir was specified and SOC specific is set, set the installDirPath to the
344 // specified socInstallDirBase.
Jooyung Han8e5685d2020-09-21 11:02:57 +0900345 installBaseDir := p.installDirBase
346 if p.SocSpecific() && p.socInstallDirBase != "" {
347 installBaseDir = p.socInstallDirBase
348 }
349 p.installDirPath = android.PathForModuleInstall(ctx, installBaseDir, p.SubDir())
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900350
Dan Willemsenb0552672019-01-25 16:04:11 -0800351 // This ensures that outputFilePath has the correct name for others to
352 // use, as the source file may have a different name.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700353 ctx.Build(pctx, android.BuildParams{
354 Rule: android.Cp,
Jiyong Parkc43e0ac2018-10-04 20:27:15 +0900355 Output: p.outputFilePath,
356 Input: p.sourceFilePath,
357 })
Jiyong Parkf9f68052020-09-29 20:15:08 +0900358
Inseob Kim916901e2021-02-17 15:48:53 +0900359 if !p.Installable() {
360 p.SkipInstall()
361 }
362
363 // Call InstallFile even when uninstallable to make the module included in the package
364 installPath := ctx.InstallFile(p.installDirPath, p.outputFilePath.Base(), p.outputFilePath)
365 for _, sl := range p.properties.Symlinks {
366 ctx.InstallSymlink(p.installDirPath, sl, installPath)
Jiyong Parkf9f68052020-09-29 20:15:08 +0900367 }
Jiyong Parkc678ad32018-04-10 13:07:10 +0900368}
369
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700370func (p *PrebuiltEtc) AndroidMkEntries() []android.AndroidMkEntries {
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700371 nameSuffix := ""
Yifan Hong1b3348d2020-01-21 15:53:22 -0800372 if p.inRamdisk() && !p.onlyInRamdisk() {
373 nameSuffix = ".ramdisk"
374 }
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700375 if p.inVendorRamdisk() && !p.onlyInVendorRamdisk() {
376 nameSuffix = ".vendor_ramdisk"
377 }
Inseob Kim08758f02021-04-08 21:13:22 +0900378 if p.inDebugRamdisk() && !p.onlyInDebugRamdisk() {
379 nameSuffix = ".debug_ramdisk"
380 }
Kiyoung Kimae11c232021-07-19 11:38:04 +0900381 if p.InRecovery() && !p.onlyInRecovery() {
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700382 nameSuffix = ".recovery"
383 }
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700384 return []android.AndroidMkEntries{android.AndroidMkEntries{
Jaewoong Jung9aa3ab12019-04-03 15:47:29 -0700385 Class: "ETC",
386 SubName: nameSuffix,
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700387 OutputFile: android.OptionalPathForPath(p.outputFilePath),
388 ExtraEntries: []android.AndroidMkExtraEntriesFunc{
Colin Crossaa255532020-07-03 13:18:24 -0700389 func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700390 entries.SetString("LOCAL_MODULE_TAGS", "optional")
Colin Crossc68db4b2021-11-11 18:59:15 -0800391 entries.SetString("LOCAL_MODULE_PATH", p.installDirPath.String())
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700392 entries.SetString("LOCAL_INSTALLED_MODULE_STEM", p.outputFilePath.Base())
Yo Chiang3d64d492020-05-27 17:56:39 +0800393 if len(p.properties.Symlinks) > 0 {
394 entries.AddStrings("LOCAL_MODULE_SYMLINKS", p.properties.Symlinks...)
395 }
Yo Chiang803c40d2020-11-16 20:32:51 +0800396 entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !p.Installable())
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700397 if p.additionalDependencies != nil {
Yo Chiang803c40d2020-11-16 20:32:51 +0800398 entries.AddStrings("LOCAL_ADDITIONAL_DEPENDENCIES", p.additionalDependencies.Strings()...)
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900399 }
Jaewoong Junge0dc8df2019-08-27 17:33:16 -0700400 },
Jiyong Parkc678ad32018-04-10 13:07:10 +0900401 },
Jiyong Park0b0e1b92019-12-03 13:24:29 +0900402 }}
Jiyong Parkc678ad32018-04-10 13:07:10 +0900403}
404
Jooyung Hana0171822019-07-22 15:48:36 +0900405func InitPrebuiltEtcModule(p *PrebuiltEtc, dirBase string) {
406 p.installDirBase = dirBase
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900407 p.AddProperties(&p.properties)
Inseob Kim27408bf2021-04-06 21:00:17 +0900408 p.AddProperties(&p.subdirProperties)
409}
410
411func InitPrebuiltRootModule(p *PrebuiltEtc) {
412 p.installDirBase = "."
413 p.AddProperties(&p.properties)
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900414}
Jiyong Parkc678ad32018-04-10 13:07:10 +0900415
Patrice Arruda9e14b962019-03-11 15:58:50 -0700416// prebuilt_etc is for a prebuilt artifact that is installed in
417// <partition>/etc/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700418func PrebuiltEtcFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900419 module := &PrebuiltEtc{}
420 InitPrebuiltEtcModule(module, "etc")
Jiyong Park5a8d1be2018-04-25 22:57:34 +0900421 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700422 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Inseob Kim1e27a142021-05-06 11:46:11 +0000423 android.InitDefaultableModule(module)
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400424 android.InitBazelModule(module)
Inseob Kim1e27a142021-05-06 11:46:11 +0000425 return module
426}
427
428func defaultsFactory() android.Module {
429 return DefaultsFactory()
430}
431
432func DefaultsFactory(props ...interface{}) android.Module {
433 module := &Defaults{}
434
435 module.AddProperties(props...)
436 module.AddProperties(
437 &prebuiltEtcProperties{},
438 &prebuiltSubdirProperties{},
439 )
440
441 android.InitDefaultsModule(module)
442
Jiyong Parkc678ad32018-04-10 13:07:10 +0900443 return module
444}
Tao Bao0ba5c942018-08-14 22:20:22 -0700445
Patrice Arruda9e14b962019-03-11 15:58:50 -0700446// prebuilt_etc_host is for a host prebuilt artifact that is installed in
447// $(HOST_OUT)/etc/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700448func PrebuiltEtcHostFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900449 module := &PrebuiltEtc{}
450 InitPrebuiltEtcModule(module, "etc")
Jaewoong Jung24788182019-02-04 14:34:10 -0800451 // This module is host-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700452 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100453 android.InitDefaultableModule(module)
Liz Kammera9234422021-12-22 15:32:18 -0500454 android.InitBazelModule(module)
Jaewoong Jung24788182019-02-04 14:34:10 -0800455 return module
456}
457
Inseob Kim27408bf2021-04-06 21:00:17 +0900458// prebuilt_root is for a prebuilt artifact that is installed in
459// <partition>/ directory. Can't have any sub directories.
460func PrebuiltRootFactory() android.Module {
461 module := &PrebuiltEtc{}
462 InitPrebuiltRootModule(module)
463 // This module is device-only
464 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100465 android.InitDefaultableModule(module)
Inseob Kim27408bf2021-04-06 21:00:17 +0900466 return module
467}
468
Liz Kammere9ecddc2022-01-04 17:27:52 -0500469// prebuilt_root_host is for a host prebuilt artifact that is installed in $(HOST_OUT)/<sub_dir>
470// directory.
471func PrebuiltRootHostFactory() android.Module {
472 module := &PrebuiltEtc{}
473 InitPrebuiltEtcModule(module, ".")
474 // This module is host-only
475 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
476 android.InitDefaultableModule(module)
477 return module
478}
479
Patrice Arruda9e14b962019-03-11 15:58:50 -0700480// prebuilt_usr_share is for a prebuilt artifact that is installed in
481// <partition>/usr/share/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700482func PrebuiltUserShareFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900483 module := &PrebuiltEtc{}
484 InitPrebuiltEtcModule(module, "usr/share")
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800485 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700486 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100487 android.InitDefaultableModule(module)
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500488 android.InitBazelModule(module)
Jaewoong Jungc3fcdb42019-02-13 05:50:33 -0800489 return module
490}
491
Patrice Arruda9e14b962019-03-11 15:58:50 -0700492// prebuild_usr_share_host is for a host prebuilt artifact that is installed in
493// $(HOST_OUT)/usr/share/<sub_dir> directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700494func PrebuiltUserShareHostFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900495 module := &PrebuiltEtc{}
496 InitPrebuiltEtcModule(module, "usr/share")
Patrice Arruda300cef92019-02-22 15:47:57 -0800497 // This module is host-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700498 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100499 android.InitDefaultableModule(module)
Patrice Arruda300cef92019-02-22 15:47:57 -0800500 return module
501}
502
Patrice Arruda61583eb2019-05-14 08:20:45 -0700503// prebuilt_font installs a font in <partition>/fonts directory.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700504func PrebuiltFontFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900505 module := &PrebuiltEtc{}
506 InitPrebuiltEtcModule(module, "fonts")
Patrice Arruda61583eb2019-05-14 08:20:45 -0700507 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700508 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100509 android.InitDefaultableModule(module)
Patrice Arruda61583eb2019-05-14 08:20:45 -0700510 return module
511}
Patrice Arruda057a8b12019-06-03 15:29:27 -0700512
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800513// prebuilt_firmware installs a firmware file to <partition>/etc/firmware directory for system
514// image.
515// If soc_specific property is set to true, the firmware file is installed to the
516// vendor <partition>/firmware directory for vendor image.
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700517func PrebuiltFirmwareFactory() android.Module {
Jooyung Hana0171822019-07-22 15:48:36 +0900518 module := &PrebuiltEtc{}
519 module.socInstallDirBase = "firmware"
520 InitPrebuiltEtcModule(module, "etc/firmware")
Patrice Arruda057a8b12019-06-03 15:29:27 -0700521 // This module is device-only
Jaewoong Jung4b79e982020-06-01 10:45:49 -0700522 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100523 android.InitDefaultableModule(module)
Patrice Arruda057a8b12019-06-03 15:29:27 -0700524 return module
525}
Patrice Arruda0f688002020-06-08 21:40:25 +0000526
527// prebuilt_dsp installs a DSP related file to <partition>/etc/dsp directory for system image.
Yo Chiangf0e19fe2020-11-18 15:28:42 +0800528// If soc_specific property is set to true, the DSP related file is installed to the
529// vendor <partition>/dsp directory for vendor image.
Patrice Arruda0f688002020-06-08 21:40:25 +0000530func PrebuiltDSPFactory() android.Module {
531 module := &PrebuiltEtc{}
532 module.socInstallDirBase = "dsp"
533 InitPrebuiltEtcModule(module, "etc/dsp")
534 // This module is device-only
535 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100536 android.InitDefaultableModule(module)
Patrice Arruda0f688002020-06-08 21:40:25 +0000537 return module
538}
Colin Cross83ebf232021-04-09 09:41:23 -0700539
540// prebuilt_rfsa installs a firmware file that will be available through Qualcomm's RFSA
541// to the <partition>/lib/rfsa directory.
542func PrebuiltRFSAFactory() android.Module {
543 module := &PrebuiltEtc{}
544 // Ideally these would go in /vendor/dsp, but the /vendor/lib/rfsa paths are hardcoded in too
545 // many places outside of the application processor. They could be moved to /vendor/dsp once
546 // that is cleaned up.
547 InitPrebuiltEtcModule(module, "lib/rfsa")
548 // This module is device-only
549 android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
Martin Stjernholmdc6525e2021-10-14 00:42:59 +0100550 android.InitDefaultableModule(module)
Colin Cross83ebf232021-04-09 09:41:23 -0700551 return module
552}
Kiyoung Kimae11c232021-07-19 11:38:04 +0900553
Kiyoung Kimae11c232021-07-19 11:38:04 +0900554// Copy file into the snapshot
555func copyFile(ctx android.SingletonContext, path android.Path, out string, fake bool) android.OutputPath {
556 if fake {
557 // Create empty file instead for the fake snapshot
558 return snapshot.WriteStringToFileRule(ctx, "", out)
559 } else {
560 return snapshot.CopyFileRule(pctx, ctx, path, out)
561 }
562}
563
564// Check if the module is target of the snapshot
565func isSnapshotAware(ctx android.SingletonContext, m *PrebuiltEtc, image snapshot.SnapshotImage) bool {
566 if !m.Enabled() {
567 return false
568 }
569
570 // Skip if the module is not included in the image
571 if !image.InImage(m)() {
572 return false
573 }
574
575 // When android/prebuilt.go selects between source and prebuilt, it sets
576 // HideFromMake on the other one to avoid duplicate install rules in make.
577 if m.IsHideFromMake() {
578 return false
579 }
580
581 // There are some prebuilt_etc module with multiple definition of same name.
582 // Check if the target would be included from the build
583 if !m.ExportedToMake() {
584 return false
585 }
586
587 // Skip if the module is in the predefined path list to skip
588 if image.IsProprietaryPath(ctx.ModuleDir(m), ctx.DeviceConfig()) {
589 return false
590 }
591
592 // Skip if the module should be excluded
593 if image.ExcludeFromSnapshot(m) || image.ExcludeFromDirectedSnapshot(ctx.DeviceConfig(), m.BaseModuleName()) {
594 return false
595 }
596
597 // Skip from other exceptional cases
598 if m.Target().Os.Class != android.Device {
599 return false
600 }
601 if m.Target().NativeBridge == android.NativeBridgeEnabled {
602 return false
603 }
604
605 return true
606}
607
608func generatePrebuiltSnapshot(s snapshot.SnapshotSingleton, ctx android.SingletonContext, snapshotArchDir string) android.Paths {
609 /*
610 Snapshot zipped artifacts directory structure for etc modules:
611 {SNAPSHOT_ARCH}/
612 arch-{TARGET_ARCH}-{TARGET_ARCH_VARIANT}/
613 etc/
614 (prebuilt etc files)
615 arch-{TARGET_2ND_ARCH}-{TARGET_2ND_ARCH_VARIANT}/
616 etc/
617 (prebuilt etc files)
618 NOTICE_FILES/
619 (notice files)
620 */
621 var snapshotOutputs android.Paths
622 noticeDir := filepath.Join(snapshotArchDir, "NOTICE_FILES")
623 installedNotices := make(map[string]bool)
624
625 ctx.VisitAllModules(func(module android.Module) {
626 m, ok := module.(*PrebuiltEtc)
627 if !ok {
628 return
629 }
630
631 if !isSnapshotAware(ctx, m, s.Image) {
632 return
633 }
634
635 targetArch := "arch-" + m.Target().Arch.ArchType.String()
636
637 snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "etc", m.BaseModuleName())
638 snapshotOutputs = append(snapshotOutputs, copyFile(ctx, m.OutputFile(), snapshotLibOut, s.Fake))
639
Rob Seymour925aa092021-08-10 20:42:03 +0000640 prop := snapshot.SnapshotJsonFlags{}
Kiyoung Kimae11c232021-07-19 11:38:04 +0900641 propOut := snapshotLibOut + ".json"
642 prop.ModuleName = m.BaseModuleName()
643 if m.subdirProperties.Relative_install_path != nil {
644 prop.RelativeInstallPath = *m.subdirProperties.Relative_install_path
645 }
646
647 if m.properties.Filename != nil {
648 prop.Filename = *m.properties.Filename
649 }
650
651 j, err := json.Marshal(prop)
652 if err != nil {
653 ctx.Errorf("json marshal to %q failed: %#v", propOut, err)
654 return
655 }
656 snapshotOutputs = append(snapshotOutputs, snapshot.WriteStringToFileRule(ctx, string(j), propOut))
657
658 if len(m.EffectiveLicenseFiles()) > 0 {
659 noticeName := ctx.ModuleName(m) + ".txt"
660 noticeOut := filepath.Join(noticeDir, noticeName)
661 // skip already copied notice file
662 if !installedNotices[noticeOut] {
663 installedNotices[noticeOut] = true
664
665 noticeOutPath := android.PathForOutput(ctx, noticeOut)
666 ctx.Build(pctx, android.BuildParams{
667 Rule: android.Cat,
668 Inputs: m.EffectiveLicenseFiles(),
669 Output: noticeOutPath,
670 Description: "combine notices for " + noticeOut,
671 })
672 snapshotOutputs = append(snapshotOutputs, noticeOutPath)
673 }
674 }
675
676 })
677
678 return snapshotOutputs
679}
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400680
681// For Bazel / bp2build
682
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500683type bazelPrebuiltFileAttributes struct {
Alix993872a2022-06-15 17:42:14 +0000684 Src bazel.LabelAttribute
685 Filename bazel.LabelAttribute
686 Dir string
687 Installable bazel.BoolAttribute
688 Filename_from_src bazel.BoolAttribute
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400689}
690
Alix5918d642022-06-27 20:57:44 +0000691// Bp2buildHelper returns a bazelPrebuiltFileAttributes used for the conversion
692// of prebuilt_* modules. bazelPrebuiltFileAttributes has the common attributes
693// used by both prebuilt_etc_xml and other prebuilt_* moodules
694func (module *PrebuiltEtc) Bp2buildHelper(ctx android.TopDownMutatorContext) *bazelPrebuiltFileAttributes {
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500695 var src bazel.LabelAttribute
Liz Kammerdff00ea2021-10-04 13:44:34 -0400696 for axis, configToProps := range module.GetArchVariantProperties(ctx, &prebuiltEtcProperties{}) {
697 for config, p := range configToProps {
698 props, ok := p.(*prebuiltEtcProperties)
699 if !ok {
700 continue
701 }
702 if props.Src != nil {
Chris Parsons58852a02021-12-09 18:10:18 -0500703 label := android.BazelLabelForModuleSrcSingle(ctx, *props.Src)
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500704 src.SetSelectValue(axis, config, label)
Liz Kammerdff00ea2021-10-04 13:44:34 -0400705 }
706 }
Alixbbfd5382022-06-09 18:52:05 +0000707
708 for propName, productConfigProps := range android.ProductVariableProperties(ctx) {
709 for configProp, propVal := range productConfigProps {
710 if propName == "Src" {
711 props, ok := propVal.(*string)
712 if !ok {
713 ctx.PropertyErrorf(" Expected Property to have type string, but was %s\n", reflect.TypeOf(propVal).String())
714 continue
715 }
716 if props != nil {
717 label := android.BazelLabelForModuleSrcSingle(ctx, *props)
718 src.SetSelectValue(configProp.ConfigurationAxis(), configProp.SelectKey(), label)
719 }
720 }
721 }
722 }
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400723 }
724
725 var filename string
Alix993872a2022-06-15 17:42:14 +0000726 var filenameFromSrc bool
727 moduleProps := module.properties
728
729 if moduleProps.Filename != nil && *moduleProps.Filename != "" {
730 filename = *moduleProps.Filename
731 } else if moduleProps.Filename_from_src != nil && *moduleProps.Filename_from_src {
732 if moduleProps.Src != nil {
733 filename = *moduleProps.Src
734 }
735 filenameFromSrc = true
736 } else {
737 filename = ctx.ModuleName()
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400738 }
739
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500740 var dir = module.installDirBase
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500741 if subDir := module.subdirProperties.Sub_dir; subDir != nil {
742 dir = dir + "/" + *subDir
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400743 }
744
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500745 var installable bazel.BoolAttribute
746 if install := module.properties.Installable; install != nil {
747 installable.Value = install
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400748 }
749
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500750 attrs := &bazelPrebuiltFileAttributes{
751 Src: src,
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxc78604e2022-02-28 18:22:59 -0500752 Dir: dir,
753 Installable: installable,
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400754 }
755
Alix993872a2022-06-15 17:42:14 +0000756 if filename != "" {
757 attrs.Filename = bazel.LabelAttribute{Value: &bazel.Label{Label: filename}}
758 } else if filenameFromSrc {
759 attrs.Filename_from_src = bazel.BoolAttribute{Value: moduleProps.Filename_from_src}
760 }
761
Alix5918d642022-06-27 20:57:44 +0000762 return attrs
763
764}
765
766// ConvertWithBp2build performs bp2build conversion of PrebuiltEtc
767// prebuilt_* modules (except prebuilt_etc_xml) are PrebuiltEtc,
768// which we treat as *PrebuiltFile*
769func (module *PrebuiltEtc) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
770 var dir = module.installDirBase
771 // prebuilt_file supports only `etc` or `usr/share`
772 if !(dir == "etc" || dir == "usr/share") {
773 return
774 }
775
776 attrs := module.Bp2buildHelper(ctx)
777
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400778 props := bazel.BazelTargetModuleProperties{
Alex Márquez Pérez Muñíz Díaz Púras Thaureauxb81f77e2022-02-28 17:38:34 -0500779 Rule_class: "prebuilt_file",
780 Bzl_load_location: "//build/bazel/rules:prebuilt_file.bzl",
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400781 }
782
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux447f6c92021-08-31 20:30:36 +0000783 ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: module.Name()}, attrs)
Rupert Shuttleworth378fc1b2021-07-28 08:03:16 -0400784}