Modify android_install_app to install VisualBench

BUG=skia:

Review URL: https://codereview.chromium.org/1181973008
This commit is contained in:
joshualitt 2015-06-18 13:08:26 -07:00 committed by Commit bot
parent 6f5e619b87
commit 74953c388c
2 changed files with 26 additions and 14 deletions

View File

@ -9,6 +9,7 @@ function print_usage {
echo " -h Prints this help message" echo " -h Prints this help message"
echo " --release Install the release build of Skia" echo " --release Install the release build of Skia"
echo " -s [device_s/n] Serial number of the device to be used" echo " -s [device_s/n] Serial number of the device to be used"
echo " AppName Can be either SampleApp or VisualBench"
} }
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -19,31 +20,42 @@ source $SCRIPT_DIR/utils/setup_adb.sh
forceRemoval="false" forceRemoval="false"
installLauncher="false" installLauncher="false"
installOptions="-r" installOptions="-r"
app=""
for arg in ${APP_ARGS[@]} for arg in ${APP_ARGS[@]}; do
do if [[ "${arg}" == "-f" ]]; then
if [[ "${arg}" == "-f" ]];
then
forceRemoval="true" forceRemoval="true"
elif [[ "${arg}" == "-h" ]]; elif [[ "${arg}" == "-h" ]]; then
then
print_usage print_usage
exit exit
elif [[ "${arg}" == "-r" ]]; elif [[ "${arg}" == "-r" ]]; then
then
echo "DEPRECATED: -r is now a no-op" echo "DEPRECATED: -r is now a no-op"
else elif [[ ${arg} == '-'* ]]; then
echo "ERROR: unrecognized option ${arg}" echo "ERROR: unrecognized option ${arg}"
print_usage print_usage
exit 1; exit 1;
else
if [[ ${app} != "" ]]; then
echo "ERROR: app already defined ${app}"
exit 1;
else
app=${arg}
fi
fi fi
done done
if [[ ${app} == "" ]]; then
echo "defaulting to installing SampleApp."
app="SampleApp"
fi
if [[ "$forceRemoval" == "true" ]]; if [[ "$forceRemoval" == "true" ]];
then then
echo "Forcing removal of previously installed packages" echo "Forcing removal of previously installed packages"
$ADB ${DEVICE_SERIAL} uninstall com.skia > /dev/null $ADB ${DEVICE_SERIAL} uninstall com.skia > /dev/null
fi fi
echo "Installing Skia App from ${SKIA_OUT}/${BUILDTYPE}" echo "Installing ${app} from ${SKIA_OUT}/${BUILDTYPE}"
$ADB ${DEVICE_SERIAL} install ${installOptions} ${SKIA_OUT}/${BUILDTYPE}/android/bin/SkiaAndroid.apk $ADB ${DEVICE_SERIAL} install ${installOptions} ${SKIA_OUT}/${BUILDTYPE}/android/${app}/bin/${app}.apk

View File

@ -78,7 +78,7 @@
}, },
'actions': [ 'actions': [
{ {
'action_name': 'SkiaAndroid_apk', 'action_name': 'SampleApp_apk',
'inputs': [ 'inputs': [
'<(android_base)/app/AndroidManifest.xml', '<(android_base)/app/AndroidManifest.xml',
'<(android_base)/app/build.xml', '<(android_base)/app/build.xml',
@ -90,7 +90,7 @@
'<(android_base)/app/src/com/skia/SkiaSampleView.java', '<(android_base)/app/src/com/skia/SkiaSampleView.java',
], ],
'outputs': [ 'outputs': [
'<(PRODUCT_DIR)/../android/SampleApp/bin/SkiaAndroid.apk', '<(PRODUCT_DIR)/../android/SampleApp/bin/SampleApp.apk',
], ],
'action': [ 'action': [
'ant', 'ant',
@ -100,7 +100,7 @@
'-Dout.dir=<(ANDROID_OUT)/bin', '-Dout.dir=<(ANDROID_OUT)/bin',
'-Dgen.absolute.dir=<(ANDROID_OUT)/gen', '-Dgen.absolute.dir=<(ANDROID_OUT)/gen',
'-Dnative.libs.absolute.dir=<(ANDROID_OUT)/libs', '-Dnative.libs.absolute.dir=<(ANDROID_OUT)/libs',
'-Dout.final.file=<(ANDROID_OUT)/bin/SkiaAndroid.apk', '-Dout.final.file=<(ANDROID_OUT)/bin/SampleApp.apk',
'-Dsdk.dir=<(ANDROID_SDK_ROOT)', '-Dsdk.dir=<(ANDROID_SDK_ROOT)',
'debug', 'debug',
], ],