From d0b99cea0ac389e831dfddbd3cb10fa09a040d2c Mon Sep 17 00:00:00 2001 From: Mathew Inwood Date: Thu, 20 May 2021 11:00:12 +0100 Subject: 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 --- sdk/sdk.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sdk/sdk.go') 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. -- cgit v1.2.3-59-g8ed1b