overlays: Fix RRO generation with multiple target configs + same package

This commit is contained in:
Danny Lin 2021-12-19 02:56:13 -08:00
parent ce9d7fa6ca
commit fab307dae8

View file

@ -398,7 +398,8 @@ export async function serializePartOverlays(partValues: PartResValues, overlaysD
// Now serialize each (package,target)-partition combination
for (let [pkgNameKey, values] of pkgValues.entries()) {
let [targetPkg, targetName] = pkgNameKey.split('/')
let rroName = `${targetPkg}.auto_generated_rro_${partition}_adevtool__`
let genTarget = pkgNameKey.replace('/', '__')
let rroName = `${genTarget}.auto_generated_rro_${partition}_adevtool__`
let bp = serializeBlueprint({
modules: [{
@ -456,7 +457,7 @@ export async function serializePartOverlays(partValues: PartResValues, overlaysD
let valuesXml = serializeXmlObject(valuesObj)
// Write files
let overlayDir = `${overlaysDir}/${partition}_${targetPkg}`
let overlayDir = `${overlaysDir}/${partition}_${genTarget}`
let resDir = `${overlayDir}/res/values`
await fs.mkdir(resDir, { recursive: true })
await fs.writeFile(`${overlayDir}/Android.bp`, bp)