Merge "Add property to apex soong modules to forcefully compress an APEX" am: fdb9e89642
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1535000 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icd656fcaa47ed198933b050db1fbedbc8d2174b1
This commit is contained in:
@@ -168,6 +168,10 @@ type apexBundleProperties struct {
|
|||||||
// used in tests.
|
// used in tests.
|
||||||
Test_only_unsigned_payload *bool
|
Test_only_unsigned_payload *bool
|
||||||
|
|
||||||
|
// Whenever apex should be compressed, regardless of product flag used. Should be only
|
||||||
|
// used in tests.
|
||||||
|
Test_only_force_compression *bool
|
||||||
|
|
||||||
IsCoverageVariant bool `blueprint:"mutated"`
|
IsCoverageVariant bool `blueprint:"mutated"`
|
||||||
|
|
||||||
// List of sanitizer names that this APEX is enabled for
|
// List of sanitizer names that this APEX is enabled for
|
||||||
@@ -1241,6 +1245,11 @@ func (a *apexBundle) testOnlyShouldSkipPayloadSign() bool {
|
|||||||
return proptools.Bool(a.properties.Test_only_unsigned_payload)
|
return proptools.Bool(a.properties.Test_only_unsigned_payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See the test_only_force_compression property
|
||||||
|
func (a *apexBundle) testOnlyShouldForceCompression() bool {
|
||||||
|
return proptools.Bool(a.properties.Test_only_force_compression)
|
||||||
|
}
|
||||||
|
|
||||||
// These functions are interfacing with cc/sanitizer.go. The entire APEX (along with all of its
|
// These functions are interfacing with cc/sanitizer.go. The entire APEX (along with all of its
|
||||||
// members) can be sanitized, either forcibly, or by the global configuration. For some of the
|
// members) can be sanitized, either forcibly, or by the global configuration. For some of the
|
||||||
// sanitizers, extra dependencies can be forcibly added as well.
|
// sanitizers, extra dependencies can be forcibly added as well.
|
||||||
|
@@ -763,9 +763,13 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
})
|
})
|
||||||
a.outputFile = signedOutputFile
|
a.outputFile = signedOutputFile
|
||||||
|
|
||||||
// Process APEX compression if enabled
|
// Process APEX compression if enabled or forced
|
||||||
|
if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && a.testOnlyShouldForceCompression() {
|
||||||
|
ctx.PropertyErrorf("test_only_force_compression", "not available")
|
||||||
|
return
|
||||||
|
}
|
||||||
compressionEnabled := ctx.Config().CompressedApex() && proptools.BoolDefault(a.properties.Compressible, true)
|
compressionEnabled := ctx.Config().CompressedApex() && proptools.BoolDefault(a.properties.Compressible, true)
|
||||||
if compressionEnabled && apexType == imageApex {
|
if apexType == imageApex && (compressionEnabled || a.testOnlyShouldForceCompression()) {
|
||||||
a.isCompressed = true
|
a.isCompressed = true
|
||||||
unsignedCompressedOutputFile := android.PathForModuleOut(ctx, a.Name()+".capex.unsigned")
|
unsignedCompressedOutputFile := android.PathForModuleOut(ctx, a.Name()+".capex.unsigned")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user