Merge "apex supports ".apex" tag"
This commit is contained in:
10
apex/apex.go
10
apex/apex.go
@@ -416,8 +416,12 @@ type apexBundle struct {
|
|||||||
mergedNotices android.NoticeOutputs
|
mergedNotices android.NoticeOutputs
|
||||||
|
|
||||||
// The built APEX file. This is the main product.
|
// The built APEX file. This is the main product.
|
||||||
|
// Could be .apex or .capex
|
||||||
outputFile android.WritablePath
|
outputFile android.WritablePath
|
||||||
|
|
||||||
|
// The built uncompressed .apex file.
|
||||||
|
outputApexFile android.WritablePath
|
||||||
|
|
||||||
// The built APEX file in app bundle format. This file is not directly installed to the
|
// The built APEX file in app bundle format. This file is not directly installed to the
|
||||||
// device. For an APEX, multiple app bundles are created each of which is for a specific ABI
|
// device. For an APEX, multiple app bundles are created each of which is for a specific ABI
|
||||||
// like arm, arm64, x86, etc. Then they are processed again (outside of the Android build
|
// like arm, arm64, x86, etc. Then they are processed again (outside of the Android build
|
||||||
@@ -1284,6 +1288,12 @@ func (a *apexBundle) OutputFiles(tag string) (android.Paths, error) {
|
|||||||
case "", android.DefaultDistTag:
|
case "", android.DefaultDistTag:
|
||||||
// This is the default dist path.
|
// This is the default dist path.
|
||||||
return android.Paths{a.outputFile}, nil
|
return android.Paths{a.outputFile}, nil
|
||||||
|
case imageApexSuffix:
|
||||||
|
// uncompressed one
|
||||||
|
if a.outputApexFile != nil {
|
||||||
|
return android.Paths{a.outputApexFile}, nil
|
||||||
|
}
|
||||||
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
|
return nil, fmt.Errorf("unsupported module reference tag %q", tag)
|
||||||
}
|
}
|
||||||
|
@@ -8661,6 +8661,54 @@ func TestAndroidMk_RequiredModules(t *testing.T) {
|
|||||||
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += otherapex")
|
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += otherapex")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestApexOutputFileProducer(t *testing.T) {
|
||||||
|
for _, tc := range []struct {
|
||||||
|
name string
|
||||||
|
ref string
|
||||||
|
expected_data []string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "test_using_output",
|
||||||
|
ref: ":myapex",
|
||||||
|
expected_data: []string{"out/soong/.intermediates/myapex/android_common_myapex_image/myapex.capex:myapex.capex"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "test_using_apex",
|
||||||
|
ref: ":myapex{.apex}",
|
||||||
|
expected_data: []string{"out/soong/.intermediates/myapex/android_common_myapex_image/myapex.apex:myapex.apex"},
|
||||||
|
},
|
||||||
|
} {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
ctx := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
compressible: true,
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
java_test {
|
||||||
|
name: "`+tc.name+`",
|
||||||
|
srcs: ["a.java"],
|
||||||
|
data: ["`+tc.ref+`"],
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
|
variables.CompressedApex = proptools.BoolPtr(true)
|
||||||
|
}))
|
||||||
|
javaTest := ctx.ModuleForTests(tc.name, "android_common").Module().(*java.Test)
|
||||||
|
data := android.AndroidMkEntriesForTest(t, ctx, javaTest)[0].EntryMap["LOCAL_COMPATIBILITY_SUPPORT_FILES"]
|
||||||
|
android.AssertStringPathsRelativeToTopEquals(t, "data", ctx.Config(), tc.expected_data, data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) {
|
func TestSdkLibraryCanHaveHigherMinSdkVersion(t *testing.T) {
|
||||||
preparer := android.GroupFixturePreparers(
|
preparer := android.GroupFixturePreparers(
|
||||||
PrepareForTestWithApexBuildComponents,
|
PrepareForTestWithApexBuildComponents,
|
||||||
|
@@ -810,6 +810,9 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
|
|||||||
Implicits: implicits,
|
Implicits: implicits,
|
||||||
Args: args,
|
Args: args,
|
||||||
})
|
})
|
||||||
|
if suffix == imageApexSuffix {
|
||||||
|
a.outputApexFile = signedOutputFile
|
||||||
|
}
|
||||||
a.outputFile = signedOutputFile
|
a.outputFile = signedOutputFile
|
||||||
|
|
||||||
if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && a.testOnlyShouldForceCompression() {
|
if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && a.testOnlyShouldForceCompression() {
|
||||||
|
Reference in New Issue
Block a user