blob: 14fab6884e0192167900d18ce5f0eaf70343894d [file] [log] [blame]
Inseob Kimc0907f12019-02-08 21:00:45 +09001// Copyright (C) 2019 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
15package sysprop
16
17import (
Inseob Kim42882742019-07-30 17:55:33 +090018 "fmt"
19 "io"
20 "path"
Colin Crossf8b860a2019-04-16 14:43:28 -070021
Inseob Kimc0907f12019-02-08 21:00:45 +090022 "github.com/google/blueprint"
23 "github.com/google/blueprint/proptools"
Inseob Kim42882742019-07-30 17:55:33 +090024
25 "android/soong/android"
26 "android/soong/cc"
27 "android/soong/java"
Inseob Kimc0907f12019-02-08 21:00:45 +090028)
29
30type dependencyTag struct {
31 blueprint.BaseDependencyTag
32 name string
33}
34
Inseob Kim988f53c2019-09-16 15:59:01 +090035type syspropGenProperties struct {
36 Srcs []string `android:"path"`
37 Scope string
Inseob Kimac1e9862019-12-09 18:15:47 +090038 Name *string
Inseob Kim988f53c2019-09-16 15:59:01 +090039}
40
41type syspropJavaGenRule struct {
42 android.ModuleBase
43
44 properties syspropGenProperties
45
46 genSrcjars android.Paths
47}
48
49var _ android.OutputFileProducer = (*syspropJavaGenRule)(nil)
50
51var (
52 syspropJava = pctx.AndroidStaticRule("syspropJava",
53 blueprint.RuleParams{
54 Command: `rm -rf $out.tmp && mkdir -p $out.tmp && ` +
55 `$syspropJavaCmd --scope $scope --java-output-dir $out.tmp $in && ` +
56 `$soongZipCmd -jar -o $out -C $out.tmp -D $out.tmp && rm -rf $out.tmp`,
57 CommandDeps: []string{
58 "$syspropJavaCmd",
59 "$soongZipCmd",
60 },
61 }, "scope")
62)
63
64func init() {
65 pctx.HostBinToolVariable("soongZipCmd", "soong_zip")
66 pctx.HostBinToolVariable("syspropJavaCmd", "sysprop_java")
67
68 android.PreArchMutators(func(ctx android.RegisterMutatorsContext) {
69 ctx.BottomUp("sysprop_deps", syspropDepsMutator).Parallel()
70 })
71}
72
73func (g *syspropJavaGenRule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
74 var checkApiFileTimeStamp android.WritablePath
75
76 ctx.VisitDirectDeps(func(dep android.Module) {
77 if m, ok := dep.(*syspropLibrary); ok {
78 checkApiFileTimeStamp = m.checkApiFileTimeStamp
79 }
80 })
81
82 for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) {
83 srcJarFile := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcjar")
84
85 ctx.Build(pctx, android.BuildParams{
86 Rule: syspropJava,
87 Description: "sysprop_java " + syspropFile.Rel(),
88 Output: srcJarFile,
89 Input: syspropFile,
90 Implicit: checkApiFileTimeStamp,
91 Args: map[string]string{
92 "scope": g.properties.Scope,
93 },
94 })
95
96 g.genSrcjars = append(g.genSrcjars, srcJarFile)
97 }
98}
99
100func (g *syspropJavaGenRule) OutputFiles(tag string) (android.Paths, error) {
101 switch tag {
102 case "":
103 return g.genSrcjars, nil
104 default:
105 return nil, fmt.Errorf("unsupported module reference tag %q", tag)
106 }
107}
108
109func syspropJavaGenFactory() android.Module {
110 g := &syspropJavaGenRule{}
111 g.AddProperties(&g.properties)
112 android.InitAndroidModule(g)
113 return g
114}
115
Inseob Kimc0907f12019-02-08 21:00:45 +0900116type syspropLibrary struct {
Inseob Kim42882742019-07-30 17:55:33 +0900117 android.ModuleBase
Paul Duffinebb7af62020-03-30 18:00:25 +0100118 android.ApexModuleBase
Inseob Kimc0907f12019-02-08 21:00:45 +0900119
Inseob Kim42882742019-07-30 17:55:33 +0900120 properties syspropLibraryProperties
121
122 checkApiFileTimeStamp android.WritablePath
123 latestApiFile android.Path
124 currentApiFile android.Path
125 dumpedApiFile android.WritablePath
Inseob Kimc0907f12019-02-08 21:00:45 +0900126}
127
128type syspropLibraryProperties struct {
129 // Determine who owns this sysprop library. Possible values are
130 // "Platform", "Vendor", or "Odm"
131 Property_owner string
Inseob Kimf63c2fb2019-03-05 14:22:30 +0900132
133 // list of package names that will be documented and publicized as API
134 Api_packages []string
Inseob Kimc0907f12019-02-08 21:00:45 +0900135
Inseob Kim42882742019-07-30 17:55:33 +0900136 // If set to true, allow this module to be dexed and installed on devices.
137 Installable *bool
138
139 // Make this module available when building for recovery
Jiyong Park854a9442019-02-26 10:27:13 +0900140 Recovery_available *bool
Inseob Kim42882742019-07-30 17:55:33 +0900141
142 // Make this module available when building for vendor
143 Vendor_available *bool
144
145 // list of .sysprop files which defines the properties.
146 Srcs []string `android:"path"`
Inseob Kimac1e9862019-12-09 18:15:47 +0900147
Inseob Kimeb591652020-02-03 18:06:46 +0900148 // If set to true, build a variant of the module for the host. Defaults to false.
149 Host_supported *bool
150
Inseob Kimac1e9862019-12-09 18:15:47 +0900151 // Whether public stub exists or not.
152 Public_stub *bool `blueprint:"mutated"`
Jooyung Hanba118122020-04-21 15:24:00 +0900153
154 Cpp struct {
155 // Minimum sdk version that the artifact should support when it runs as part of mainline modules(APEX).
156 // Forwarded to cc_library.min_sdk_version
157 Min_sdk_version *string
158 }
Inseob Kimc0907f12019-02-08 21:00:45 +0900159}
160
161var (
Inseob Kim42882742019-07-30 17:55:33 +0900162 pctx = android.NewPackageContext("android/soong/sysprop")
Inseob Kimc0907f12019-02-08 21:00:45 +0900163 syspropCcTag = dependencyTag{name: "syspropCc"}
164)
165
166func init() {
167 android.RegisterModuleType("sysprop_library", syspropLibraryFactory)
168}
169
Inseob Kim42882742019-07-30 17:55:33 +0900170func (m *syspropLibrary) Name() string {
171 return m.BaseModuleName() + "_sysprop_library"
Inseob Kimc0907f12019-02-08 21:00:45 +0900172}
173
Inseob Kimac1e9862019-12-09 18:15:47 +0900174func (m *syspropLibrary) Owner() string {
175 return m.properties.Property_owner
176}
177
Inseob Kim42882742019-07-30 17:55:33 +0900178func (m *syspropLibrary) CcModuleName() string {
179 return "lib" + m.BaseModuleName()
180}
181
Inseob Kimac1e9862019-12-09 18:15:47 +0900182func (m *syspropLibrary) JavaPublicStubName() string {
183 if proptools.Bool(m.properties.Public_stub) {
184 return m.BaseModuleName() + "_public"
185 }
186 return ""
187}
188
Inseob Kim988f53c2019-09-16 15:59:01 +0900189func (m *syspropLibrary) javaGenModuleName() string {
190 return m.BaseModuleName() + "_java_gen"
191}
192
Inseob Kimac1e9862019-12-09 18:15:47 +0900193func (m *syspropLibrary) javaGenPublicStubName() string {
194 return m.BaseModuleName() + "_java_gen_public"
195}
196
Inseob Kim42882742019-07-30 17:55:33 +0900197func (m *syspropLibrary) BaseModuleName() string {
198 return m.ModuleBase.Name()
199}
200
Inseob Kimac1e9862019-12-09 18:15:47 +0900201func (m *syspropLibrary) HasPublicStub() bool {
202 return proptools.Bool(m.properties.Public_stub)
203}
204
Inseob Kim42882742019-07-30 17:55:33 +0900205func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Inseob Kim988f53c2019-09-16 15:59:01 +0900206 baseModuleName := m.BaseModuleName()
207
208 for _, syspropFile := range android.PathsForModuleSrc(ctx, m.properties.Srcs) {
209 if syspropFile.Ext() != ".sysprop" {
210 ctx.PropertyErrorf("srcs", "srcs contains non-sysprop file %q", syspropFile.String())
211 }
212 }
213
214 if ctx.Failed() {
215 return
216 }
217
218 m.currentApiFile = android.PathForSource(ctx, ctx.ModuleDir(), "api", baseModuleName+"-current.txt")
219 m.latestApiFile = android.PathForSource(ctx, ctx.ModuleDir(), "api", baseModuleName+"-latest.txt")
Inseob Kim42882742019-07-30 17:55:33 +0900220
221 // dump API rule
222 rule := android.NewRuleBuilder()
223 m.dumpedApiFile = android.PathForModuleOut(ctx, "api-dump.txt")
224 rule.Command().
225 BuiltTool(ctx, "sysprop_api_dump").
226 Output(m.dumpedApiFile).
227 Inputs(android.PathsForModuleSrc(ctx, m.properties.Srcs))
Inseob Kim988f53c2019-09-16 15:59:01 +0900228 rule.Build(pctx, ctx, baseModuleName+"_api_dump", baseModuleName+" api dump")
Inseob Kim42882742019-07-30 17:55:33 +0900229
230 // check API rule
231 rule = android.NewRuleBuilder()
232
233 // 1. current.txt <-> api_dump.txt
234 msg := fmt.Sprintf(`\n******************************\n`+
235 `API of sysprop_library %s doesn't match with current.txt\n`+
236 `Please update current.txt by:\n`+
Inseob Kim988f53c2019-09-16 15:59:01 +0900237 `m %s-dump-api && rm -rf %q && cp -f %q %q\n`+
238 `******************************\n`, baseModuleName, baseModuleName,
Inseob Kim42882742019-07-30 17:55:33 +0900239 m.currentApiFile.String(), m.dumpedApiFile.String(), m.currentApiFile.String())
240
241 rule.Command().
242 Text("( cmp").Flag("-s").
243 Input(m.dumpedApiFile).
244 Input(m.currentApiFile).
245 Text("|| ( echo").Flag("-e").
246 Flag(`"` + msg + `"`).
247 Text("; exit 38) )")
248
249 // 2. current.txt <-> latest.txt
250 msg = fmt.Sprintf(`\n******************************\n`+
251 `API of sysprop_library %s doesn't match with latest version\n`+
252 `Please fix the breakage and rebuild.\n`+
Inseob Kim988f53c2019-09-16 15:59:01 +0900253 `******************************\n`, baseModuleName)
Inseob Kim42882742019-07-30 17:55:33 +0900254
255 rule.Command().
256 Text("( ").
257 BuiltTool(ctx, "sysprop_api_checker").
258 Input(m.latestApiFile).
259 Input(m.currentApiFile).
260 Text(" || ( echo").Flag("-e").
261 Flag(`"` + msg + `"`).
262 Text("; exit 38) )")
263
264 m.checkApiFileTimeStamp = android.PathForModuleOut(ctx, "check_api.timestamp")
265
266 rule.Command().
267 Text("touch").
268 Output(m.checkApiFileTimeStamp)
269
Inseob Kim988f53c2019-09-16 15:59:01 +0900270 rule.Build(pctx, ctx, baseModuleName+"_check_api", baseModuleName+" check api")
Inseob Kim42882742019-07-30 17:55:33 +0900271}
272
273func (m *syspropLibrary) AndroidMk() android.AndroidMkData {
274 return android.AndroidMkData{
275 Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
276 // sysprop_library module itself is defined as a FAKE module to perform API check.
277 // Actual implementation libraries are created on LoadHookMutator
278 fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
279 fmt.Fprintf(w, "LOCAL_MODULE := %s\n", m.Name())
280 fmt.Fprintf(w, "LOCAL_MODULE_CLASS := FAKE\n")
281 fmt.Fprintf(w, "LOCAL_MODULE_TAGS := optional\n")
282 fmt.Fprintf(w, "include $(BUILD_SYSTEM)/base_rules.mk\n\n")
283 fmt.Fprintf(w, "$(LOCAL_BUILT_MODULE): %s\n", m.checkApiFileTimeStamp.String())
284 fmt.Fprintf(w, "\ttouch $@\n\n")
Inseob Kim988f53c2019-09-16 15:59:01 +0900285 fmt.Fprintf(w, ".PHONY: %s-check-api %s-dump-api\n\n", name, name)
286
287 // dump API rule
288 fmt.Fprintf(w, "%s-dump-api: %s\n\n", name, m.dumpedApiFile.String())
Inseob Kim42882742019-07-30 17:55:33 +0900289
290 // check API rule
291 fmt.Fprintf(w, "%s-check-api: %s\n\n", name, m.checkApiFileTimeStamp.String())
Inseob Kim42882742019-07-30 17:55:33 +0900292 }}
293}
294
295// sysprop_library creates schematized APIs from sysprop description files (.sysprop).
296// Both Java and C++ modules can link against sysprop_library, and API stability check
297// against latest APIs (see build/soong/scripts/freeze-sysprop-api-files.sh)
298// is performed.
Inseob Kimc0907f12019-02-08 21:00:45 +0900299func syspropLibraryFactory() android.Module {
300 m := &syspropLibrary{}
301
302 m.AddProperties(
Inseob Kim42882742019-07-30 17:55:33 +0900303 &m.properties,
Inseob Kimc0907f12019-02-08 21:00:45 +0900304 )
Inseob Kim42882742019-07-30 17:55:33 +0900305 android.InitAndroidModule(m)
Paul Duffinebb7af62020-03-30 18:00:25 +0100306 android.InitApexModule(m)
Inseob Kimc0907f12019-02-08 21:00:45 +0900307 android.AddLoadHook(m, func(ctx android.LoadHookContext) { syspropLibraryHook(ctx, m) })
Inseob Kimc0907f12019-02-08 21:00:45 +0900308 return m
309}
310
Inseob Kimac1e9862019-12-09 18:15:47 +0900311type ccLibraryProperties struct {
312 Name *string
313 Srcs []string
314 Soc_specific *bool
315 Device_specific *bool
316 Product_specific *bool
317 Sysprop struct {
318 Platform *bool
319 }
Inseob Kimeb591652020-02-03 18:06:46 +0900320 Target struct {
321 Android struct {
322 Header_libs []string
323 Shared_libs []string
324 }
325 Host struct {
326 Static_libs []string
327 }
328 }
Inseob Kimac1e9862019-12-09 18:15:47 +0900329 Required []string
330 Recovery *bool
331 Recovery_available *bool
332 Vendor_available *bool
Inseob Kimeb591652020-02-03 18:06:46 +0900333 Host_supported *bool
Paul Duffinebb7af62020-03-30 18:00:25 +0100334 Apex_available []string
Jooyung Hanba118122020-04-21 15:24:00 +0900335 Min_sdk_version *string
Inseob Kimac1e9862019-12-09 18:15:47 +0900336}
337
338type javaLibraryProperties struct {
339 Name *string
340 Srcs []string
341 Soc_specific *bool
342 Device_specific *bool
343 Product_specific *bool
344 Required []string
345 Sdk_version *string
346 Installable *bool
347 Libs []string
348 Stem *string
349}
350
Inseob Kimc0907f12019-02-08 21:00:45 +0900351func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
Inseob Kim42882742019-07-30 17:55:33 +0900352 if len(m.properties.Srcs) == 0 {
Inseob Kim6e93ac92019-03-21 17:43:49 +0900353 ctx.PropertyErrorf("srcs", "sysprop_library must specify srcs")
354 }
355
Inseob Kim42882742019-07-30 17:55:33 +0900356 missing_api := false
357
358 for _, txt := range []string{"-current.txt", "-latest.txt"} {
359 path := path.Join(ctx.ModuleDir(), "api", m.BaseModuleName()+txt)
360 file := android.ExistentPathForSource(ctx, path)
361 if !file.Valid() {
362 ctx.ModuleErrorf("API file %#v doesn't exist", path)
363 missing_api = true
364 }
365 }
366
367 if missing_api {
368 script := "build/soong/scripts/gen-sysprop-api-files.sh"
369 p := android.ExistentPathForSource(ctx, script)
370
371 if !p.Valid() {
372 panic(fmt.Sprintf("script file %s doesn't exist", script))
373 }
374
375 ctx.ModuleErrorf("One or more api files are missing. "+
376 "You can create them by:\n"+
377 "%s %q %q", script, ctx.ModuleDir(), m.BaseModuleName())
378 return
Inseob Kimc0907f12019-02-08 21:00:45 +0900379 }
380
Inseob Kimac1e9862019-12-09 18:15:47 +0900381 // ctx's Platform or Specific functions represent where this sysprop_library installed.
382 installedInSystem := ctx.Platform() || ctx.SystemExtSpecific()
383 installedInVendorOrOdm := ctx.SocSpecific() || ctx.DeviceSpecific()
384 isOwnerPlatform := false
Inseob Kim42882742019-07-30 17:55:33 +0900385 stub := "sysprop-library-stub-"
Inseob Kimc0907f12019-02-08 21:00:45 +0900386
Inseob Kimac1e9862019-12-09 18:15:47 +0900387 switch m.Owner() {
Inseob Kimc0907f12019-02-08 21:00:45 +0900388 case "Platform":
389 // Every partition can access platform-defined properties
Inseob Kim42882742019-07-30 17:55:33 +0900390 stub += "platform"
Inseob Kimac1e9862019-12-09 18:15:47 +0900391 isOwnerPlatform = true
Inseob Kimc0907f12019-02-08 21:00:45 +0900392 case "Vendor":
393 // System can't access vendor's properties
Inseob Kimac1e9862019-12-09 18:15:47 +0900394 if installedInSystem {
Inseob Kimc0907f12019-02-08 21:00:45 +0900395 ctx.ModuleErrorf("None of soc_specific, device_specific, product_specific is true. " +
396 "System can't access sysprop_library owned by Vendor")
397 }
Inseob Kim42882742019-07-30 17:55:33 +0900398 stub += "vendor"
Inseob Kimc0907f12019-02-08 21:00:45 +0900399 case "Odm":
400 // Only vendor can access Odm-defined properties
Inseob Kimac1e9862019-12-09 18:15:47 +0900401 if !installedInVendorOrOdm {
Inseob Kimc0907f12019-02-08 21:00:45 +0900402 ctx.ModuleErrorf("Neither soc_speicifc nor device_specific is true. " +
403 "Odm-defined properties should be accessed only in Vendor or Odm")
404 }
Inseob Kim42882742019-07-30 17:55:33 +0900405 stub += "vendor"
Inseob Kimc0907f12019-02-08 21:00:45 +0900406 default:
407 ctx.PropertyErrorf("property_owner",
Inseob Kimac1e9862019-12-09 18:15:47 +0900408 "Unknown value %s: must be one of Platform, Vendor or Odm", m.Owner())
Inseob Kimc0907f12019-02-08 21:00:45 +0900409 }
410
Inseob Kimac1e9862019-12-09 18:15:47 +0900411 ccProps := ccLibraryProperties{}
Inseob Kimc0907f12019-02-08 21:00:45 +0900412 ccProps.Name = proptools.StringPtr(m.CcModuleName())
Inseob Kim42882742019-07-30 17:55:33 +0900413 ccProps.Srcs = m.properties.Srcs
Inseob Kimac1e9862019-12-09 18:15:47 +0900414 ccProps.Soc_specific = proptools.BoolPtr(ctx.SocSpecific())
415 ccProps.Device_specific = proptools.BoolPtr(ctx.DeviceSpecific())
416 ccProps.Product_specific = proptools.BoolPtr(ctx.ProductSpecific())
417 ccProps.Sysprop.Platform = proptools.BoolPtr(isOwnerPlatform)
Inseob Kimeb591652020-02-03 18:06:46 +0900418 ccProps.Target.Android.Header_libs = []string{"libbase_headers"}
419 ccProps.Target.Android.Shared_libs = []string{"liblog"}
420 ccProps.Target.Host.Static_libs = []string{"libbase", "liblog"}
Inseob Kim42882742019-07-30 17:55:33 +0900421 ccProps.Recovery_available = m.properties.Recovery_available
422 ccProps.Vendor_available = m.properties.Vendor_available
Inseob Kimeb591652020-02-03 18:06:46 +0900423 ccProps.Host_supported = m.properties.Host_supported
Paul Duffinebb7af62020-03-30 18:00:25 +0100424 ccProps.Apex_available = m.ApexProperties.Apex_available
Jooyung Hanba118122020-04-21 15:24:00 +0900425 ccProps.Min_sdk_version = m.properties.Cpp.Min_sdk_version
Colin Cross84dfc3d2019-09-25 11:33:01 -0700426 ctx.CreateModule(cc.LibraryFactory, &ccProps)
Inseob Kim42882742019-07-30 17:55:33 +0900427
Inseob Kim988f53c2019-09-16 15:59:01 +0900428 scope := "internal"
Inseob Kim988f53c2019-09-16 15:59:01 +0900429
Inseob Kimac1e9862019-12-09 18:15:47 +0900430 // We need to only use public version, if the partition where sysprop_library will be installed
431 // is different from owner.
432
433 if ctx.ProductSpecific() {
434 // Currently product partition can't own any sysprop_library.
Inseob Kim988f53c2019-09-16 15:59:01 +0900435 scope = "public"
Inseob Kimac1e9862019-12-09 18:15:47 +0900436 } else if isOwnerPlatform && installedInVendorOrOdm {
437 // Vendor or Odm should use public version of Platform's sysprop_library.
Inseob Kim988f53c2019-09-16 15:59:01 +0900438 scope = "public"
439 }
440
Inseob Kimac1e9862019-12-09 18:15:47 +0900441 ctx.CreateModule(syspropJavaGenFactory, &syspropGenProperties{
Inseob Kim988f53c2019-09-16 15:59:01 +0900442 Srcs: m.properties.Srcs,
443 Scope: scope,
444 Name: proptools.StringPtr(m.javaGenModuleName()),
Inseob Kimac1e9862019-12-09 18:15:47 +0900445 })
446
447 ctx.CreateModule(java.LibraryFactory, &javaLibraryProperties{
448 Name: proptools.StringPtr(m.BaseModuleName()),
449 Srcs: []string{":" + m.javaGenModuleName()},
450 Soc_specific: proptools.BoolPtr(ctx.SocSpecific()),
451 Device_specific: proptools.BoolPtr(ctx.DeviceSpecific()),
452 Product_specific: proptools.BoolPtr(ctx.ProductSpecific()),
453 Installable: m.properties.Installable,
454 Sdk_version: proptools.StringPtr("core_current"),
455 Libs: []string{stub},
456 })
457
458 // if platform sysprop_library is installed in /system or /system-ext, we regard it as an API
459 // and allow any modules (even from different partition) to link against the sysprop_library.
460 // To do that, we create a public stub and expose it to modules with sdk_version: system_*.
461 if isOwnerPlatform && installedInSystem {
462 m.properties.Public_stub = proptools.BoolPtr(true)
463 ctx.CreateModule(syspropJavaGenFactory, &syspropGenProperties{
464 Srcs: m.properties.Srcs,
465 Scope: "public",
466 Name: proptools.StringPtr(m.javaGenPublicStubName()),
467 })
468
469 ctx.CreateModule(java.LibraryFactory, &javaLibraryProperties{
470 Name: proptools.StringPtr(m.JavaPublicStubName()),
471 Srcs: []string{":" + m.javaGenPublicStubName()},
472 Installable: proptools.BoolPtr(false),
473 Sdk_version: proptools.StringPtr("core_current"),
474 Libs: []string{stub},
475 Stem: proptools.StringPtr(m.BaseModuleName()),
476 })
Inseob Kim988f53c2019-09-16 15:59:01 +0900477 }
Inseob Kimc0907f12019-02-08 21:00:45 +0900478}
Inseob Kim988f53c2019-09-16 15:59:01 +0900479
480func syspropDepsMutator(ctx android.BottomUpMutatorContext) {
481 if m, ok := ctx.Module().(*syspropLibrary); ok {
482 ctx.AddReverseDependency(m, nil, m.javaGenModuleName())
Inseob Kimac1e9862019-12-09 18:15:47 +0900483
484 if proptools.Bool(m.properties.Public_stub) {
485 ctx.AddReverseDependency(m, nil, m.javaGenPublicStubName())
486 }
Inseob Kim988f53c2019-09-16 15:59:01 +0900487 }
488}