build: Reduce empty blocks and files

This commit is contained in:
Danny Lin 2021-12-13 19:52:42 -08:00
parent a1df9e718f
commit 9d71cfc36e
3 changed files with 8 additions and 4 deletions

View file

@ -117,7 +117,9 @@ export async function generateBuild(
}
let buildPackages = Array.from(namedModules.keys())
buildPackages.push('device_symlinks')
if (symlinks.length > 0) {
buildPackages.push('device_symlinks')
}
return {
rootBlueprint: {

View file

@ -131,7 +131,7 @@ include $(BUILD_PREBUILT)`)
}
function addContBlock(blocks: Array<string>, variable: String, items: Array<string> | undefined) {
if (items != undefined) {
if (items != undefined && items.length > 0) {
blocks.push(`${variable} += \\
${items.join(CONT_SEPARATOR)}`)
}

View file

@ -322,8 +322,10 @@ export async function generateBuildFiles(
}
// Dump list
let fileList = serializeBlobList(entries)
await fs.writeFile(`${dirs.out}/proprietary-files.txt`, fileList + '\n')
if (entries.length > 0) {
let fileList = serializeBlobList(entries)
await fs.writeFile(`${dirs.out}/proprietary-files.txt`, fileList + '\n')
}
await writeBuildFiles(build, dirs)
}