Loading apex/apex_test.go +34 −24 Original line number Diff line number Diff line Loading @@ -2282,13 +2282,22 @@ func TestVendorApex_use_vndk_as_stable(t *testing.T) { ensureListContains(t, requireNativeLibs, ":vndk") } func TestVendorApex_withPrebuiltFirmware(t *testing.T) { func TestApex_withPrebuiltFirmware(t *testing.T) { testCases := []struct { name string additionalProp string }{ {"system apex with prebuilt_firmware", ""}, {"vendor apex with prebuilt_firmware", "vendor: true,"}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ctx, _ := testApex(t, ` apex { name: "myapex", key: "myapex.key", prebuilts: ["myfirmware"], vendor: true, `+tc.additionalProp+` } apex_key { name: "myapex.key", Loading @@ -2299,13 +2308,14 @@ func TestVendorApex_withPrebuiltFirmware(t *testing.T) { name: "myfirmware", src: "myfirmware.bin", filename_from_src: true, vendor: true, `+tc.additionalProp+` } `) ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{ "firmware/myfirmware.bin", "etc/firmware/myfirmware.bin", }) }) } } func TestAndroidMk_UseVendorRequired(t *testing.T) { Loading etc/prebuilt_etc.go +8 −8 Original line number Diff line number Diff line Loading @@ -172,13 +172,7 @@ func (p *PrebuiltEtc) SubDir() string { } func (p *PrebuiltEtc) BaseDir() string { // If soc install dir was specified and SOC specific is set, set the installDirPath to the specified // socInstallDirBase. installBaseDir := p.installDirBase if p.SocSpecific() && p.socInstallDirBase != "" { installBaseDir = p.socInstallDirBase } return installBaseDir return p.installDirBase } func (p *PrebuiltEtc) Installable() bool { Loading @@ -205,7 +199,13 @@ func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) { ctx.PropertyErrorf("sub_dir", "relative_install_path is set. Cannot set sub_dir") } p.installDirPath = android.PathForModuleInstall(ctx, p.BaseDir(), p.SubDir()) // If soc install dir was specified and SOC specific is set, set the installDirPath to the specified // socInstallDirBase. installBaseDir := p.installDirBase if p.SocSpecific() && p.socInstallDirBase != "" { installBaseDir = p.socInstallDirBase } p.installDirPath = android.PathForModuleInstall(ctx, installBaseDir, p.SubDir()) // This ensures that outputFilePath has the correct name for others to // use, as the source file may have a different name. Loading Loading
apex/apex_test.go +34 −24 Original line number Diff line number Diff line Loading @@ -2282,13 +2282,22 @@ func TestVendorApex_use_vndk_as_stable(t *testing.T) { ensureListContains(t, requireNativeLibs, ":vndk") } func TestVendorApex_withPrebuiltFirmware(t *testing.T) { func TestApex_withPrebuiltFirmware(t *testing.T) { testCases := []struct { name string additionalProp string }{ {"system apex with prebuilt_firmware", ""}, {"vendor apex with prebuilt_firmware", "vendor: true,"}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { ctx, _ := testApex(t, ` apex { name: "myapex", key: "myapex.key", prebuilts: ["myfirmware"], vendor: true, `+tc.additionalProp+` } apex_key { name: "myapex.key", Loading @@ -2299,13 +2308,14 @@ func TestVendorApex_withPrebuiltFirmware(t *testing.T) { name: "myfirmware", src: "myfirmware.bin", filename_from_src: true, vendor: true, `+tc.additionalProp+` } `) ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{ "firmware/myfirmware.bin", "etc/firmware/myfirmware.bin", }) }) } } func TestAndroidMk_UseVendorRequired(t *testing.T) { Loading
etc/prebuilt_etc.go +8 −8 Original line number Diff line number Diff line Loading @@ -172,13 +172,7 @@ func (p *PrebuiltEtc) SubDir() string { } func (p *PrebuiltEtc) BaseDir() string { // If soc install dir was specified and SOC specific is set, set the installDirPath to the specified // socInstallDirBase. installBaseDir := p.installDirBase if p.SocSpecific() && p.socInstallDirBase != "" { installBaseDir = p.socInstallDirBase } return installBaseDir return p.installDirBase } func (p *PrebuiltEtc) Installable() bool { Loading @@ -205,7 +199,13 @@ func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) { ctx.PropertyErrorf("sub_dir", "relative_install_path is set. Cannot set sub_dir") } p.installDirPath = android.PathForModuleInstall(ctx, p.BaseDir(), p.SubDir()) // If soc install dir was specified and SOC specific is set, set the installDirPath to the specified // socInstallDirBase. installBaseDir := p.installDirBase if p.SocSpecific() && p.socInstallDirBase != "" { installBaseDir = p.socInstallDirBase } p.installDirPath = android.PathForModuleInstall(ctx, installBaseDir, p.SubDir()) // This ensures that outputFilePath has the correct name for others to // use, as the source file may have a different name. Loading