Vendor CM Build: Allow parallelize the optimization of framework-res.apk

from: http://review.cyanogenmod.com/#/c/19170/

This change enhancement the optimization of cm ota package, allowing do the optimization of
framework-res.apk in a parallel way. The current script optimize first the
framework-res package and then the rest of packages with xargs in parallel. The framework-res
package can be processed with xargs in parallel copying all the packages to a temporally folder
to apply xargs (because opticharged need that the package is the current directory).
This shortens the time of optimization process, because while framework-res package is
optimized, the rest of processor cores can be optimizing other packages.

Change-Id: I047f8c01b066db99e4dcc8bcb2f30c72492e1af8
This commit is contained in:
Jorge Ruesga 2012-08-12 20:42:54 +02:00 committed by Gerrit Code Review
parent bcb880c47f
commit 547bd46507

View File

@ -53,10 +53,25 @@ cd $REPACK/ota
printf "Unpacking $OTAPACKAGE..."
unzip $QUIET $OTAPACKAGE
echo
cd $REPACK/ota/system/framework
$OPTICHARGER framework-res.apk
cd $REPACK/ota/system/app
# Move all apks to the same directory so xargs can
# use also with framework-res.apk. This allow process
# framework-res.apk in parallel with other apks
mkdir -p $REPACK/parallel
cd $REPACK/parallel
cp $REPACK/ota/system/framework/framework-res.apk .
cp $REPACK/ota/system/app/*.apk .
# Do optimization in parallel
find ./ -name \*.apk | $XARGS $OPTICHARGER
# Move optimized apks to repack directory
mv -f $REPACK/parallel/framework-res.apk $REPACK/ota/system/framework/framework-res.apk
mv -f $REPACK/parallel/*.apk $REPACK/ota/system/app/
# Return to directory
cd $REPACK/ota
rm -rf $REPACK/parallel
)
# Fix build.prop