diff options
author | 2021-05-20 11:00:12 +0100 | |
---|---|---|
committer | 2021-06-29 15:55:27 +0000 | |
commit | d0b99cea0ac389e831dfddbd3cb10fa09a040d2c (patch) | |
tree | 6537f167152036d8337dfbb0cfe572a8757b34fe /sdk/sdk.go | |
parent | 22fd032ccbe6b8352964fc01d961f0d71b20c949 (diff) |
Flag to control if generated SDK prebuilts are preferred.
This is needed because:
- the SDK prebuilt drop is being automated, including the Android.bp
- We want to control the prefer flag on a per-module level
It augments the existing SOONG_SDK_SNAPSHOT_PREFER which now overrides
this new flag when set to true.
Bug: 188427719
Test: m nothing
Change-Id: Ieb5ab9fab53a34c615345b7a9d19cadf713eec26
Diffstat (limited to 'sdk/sdk.go')
-rw-r--r-- | sdk/sdk.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sdk/sdk.go b/sdk/sdk.go index b1c8aebf9..afc6aa400 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -93,6 +93,10 @@ type sdkProperties struct { // dropped. Adding a rule to members that have //visibility:private will // cause the //visibility:private to be discarded. Prebuilt_visibility []string + + // Specifying whether the generated prebuilt SDK build rule should have the + // prefer flag set or not. + Prebuilts_prefer *bool // default: false } // Contains information about the sdk properties that list sdk members, e.g. @@ -292,6 +296,10 @@ func (s *sdk) snapshot() bool { return s.properties.Snapshot } +func (s *sdk) PreferPrebuilts() bool { + return proptools.BoolDefault(s.properties.Prebuilts_prefer, false) +} + func (s *sdk) GenerateAndroidBuildActions(ctx android.ModuleContext) { if s.snapshot() { // We don't need to create a snapshot out of sdk_snapshot. |